From 8e64146addf6410d5d83e3650ac4c44897d17a89 Mon Sep 17 00:00:00 2001 From: "Kaihui (Kerwin) Sun" Date: Fri, 26 Feb 2021 14:31:38 +0800 Subject: [PATCH] T2 web 2021 02 24 (#16901) * release web 2020-09-01 * fix changelog --- sdk/appservice/azure-mgmt-web/CHANGELOG.md | 161 + .../azure/mgmt/web/_operations_mixin.py | 142 +- .../azure-mgmt-web/azure/mgmt/web/_version.py | 10 +- .../mgmt/web/_web_site_management_client.py | 100 +- .../azure/mgmt/web/aio/_operations_mixin.py | 142 +- .../web/aio/_web_site_management_client.py | 100 +- .../azure-mgmt-web/azure/mgmt/web/models.py | 2 +- .../azure/mgmt/web/v2015_04_01/__init__.py | 3 - .../mgmt/web/v2015_04_01/_configuration.py | 3 +- .../web/v2015_04_01/aio/_configuration.py | 3 +- .../azure/mgmt/web/v2015_08_01/__init__.py | 3 - .../mgmt/web/v2015_08_01/_configuration.py | 3 +- .../web/v2015_08_01/aio/_configuration.py | 3 +- .../azure/mgmt/web/v2016_03_01/__init__.py | 3 - .../mgmt/web/v2016_03_01/_configuration.py | 3 +- .../web/v2016_03_01/aio/_configuration.py | 3 +- .../azure/mgmt/web/v2016_08_01/__init__.py | 3 - .../mgmt/web/v2016_08_01/_configuration.py | 3 +- .../web/v2016_08_01/aio/_configuration.py | 3 +- .../azure/mgmt/web/v2016_09_01/__init__.py | 3 - .../mgmt/web/v2016_09_01/_configuration.py | 3 +- .../azure/mgmt/web/v2016_09_01/_version.py | 9 - .../web/v2016_09_01/aio/_configuration.py | 3 +- .../azure/mgmt/web/v2018_02_01/__init__.py | 3 - .../mgmt/web/v2018_02_01/_configuration.py | 3 +- .../azure/mgmt/web/v2018_02_01/_version.py | 9 - .../web/v2018_02_01/aio/_configuration.py | 3 +- .../azure/mgmt/web/v2018_11_01/__init__.py | 3 - .../mgmt/web/v2018_11_01/_configuration.py | 3 +- .../azure/mgmt/web/v2018_11_01/_version.py | 9 - .../web/v2018_11_01/aio/_configuration.py | 3 +- .../azure/mgmt/web/v2019_08_01/__init__.py | 3 - .../mgmt/web/v2019_08_01/_configuration.py | 3 +- .../azure/mgmt/web/v2019_08_01/_version.py | 9 - .../web/v2019_08_01/aio/_configuration.py | 3 +- .../_version.py => v2020_06_01/__init__.py} | 9 +- .../mgmt/web/v2020_06_01/_configuration.py | 70 + .../azure/mgmt/web/v2020_06_01/_metadata.json | 267 + .../_web_site_management_client.py | 141 + .../aio/__init__.py} | 3 +- .../web/v2020_06_01/aio/_configuration.py | 66 + .../aio/_web_site_management_client.py | 135 + .../v2020_06_01/aio/operations/__init__.py | 43 + ...p_service_certificate_orders_operations.py | 1491 + .../_app_service_environments_operations.py | 3246 ++ .../_app_service_plans_operations.py | 2007 ++ ...ficate_registration_provider_operations.py | 108 + .../operations/_certificates_operations.py | 441 + .../_deleted_web_apps_operations.py | 245 + .../aio/operations/_diagnostics_operations.py | 1774 + ...domain_registration_provider_operations.py | 108 + .../aio/operations/_domains_operations.py | 1119 + .../aio/operations/_provider_operations.py | 252 + .../operations/_recommendations_operations.py | 1109 + .../_resource_health_metadata_operations.py | 471 + .../operations/_static_sites_operations.py | 1913 + .../_top_level_domains_operations.py | 252 + .../aio/operations/_web_apps_operations.py | 28546 +++++++++++++++ .../_web_site_management_client_operations.py | 1059 + .../mgmt/web/v2020_06_01/models/__init__.py | 1199 + .../mgmt/web/v2020_06_01/models/_models.py | 16943 +++++++++ .../web/v2020_06_01/models/_models_py3.py | 18799 ++++++++++ .../_web_site_management_client_enums.py | 751 + .../web/v2020_06_01/operations/__init__.py | 43 + ...p_service_certificate_orders_operations.py | 1517 + .../_app_service_environments_operations.py | 3293 ++ .../_app_service_plans_operations.py | 2039 ++ ...ficate_registration_provider_operations.py | 113 + .../operations/_certificates_operations.py | 451 + .../_deleted_web_apps_operations.py | 252 + .../operations/_diagnostics_operations.py | 1800 + ...domain_registration_provider_operations.py | 113 + .../operations/_domains_operations.py | 1139 + .../operations/_provider_operations.py | 259 + .../operations/_recommendations_operations.py | 1128 + .../_resource_health_metadata_operations.py | 481 + .../operations/_static_sites_operations.py | 1944 ++ .../_top_level_domains_operations.py | 259 + .../operations/_web_apps_operations.py | 28958 ++++++++++++++++ .../_web_site_management_client_operations.py | 1079 + .../azure/mgmt/web/v2020_06_01/py.typed | 1 + .../_version.py => v2020_09_01/__init__.py} | 9 +- .../mgmt/web/v2020_09_01/_configuration.py | 70 + .../azure/mgmt/web/v2020_09_01/_metadata.json | 279 + .../_web_site_management_client.py | 141 + .../aio/__init__.py} | 3 +- .../web/v2020_09_01/aio/_configuration.py | 66 + .../aio/_web_site_management_client.py | 135 + .../v2020_09_01/aio/operations/__init__.py | 43 + ...p_service_certificate_orders_operations.py | 1491 + .../_app_service_environments_operations.py | 3246 ++ .../_app_service_plans_operations.py | 2007 ++ ...ficate_registration_provider_operations.py | 108 + .../operations/_certificates_operations.py | 441 + .../_deleted_web_apps_operations.py | 245 + .../aio/operations/_diagnostics_operations.py | 1774 + ...domain_registration_provider_operations.py | 108 + .../aio/operations/_domains_operations.py | 1119 + .../aio/operations/_provider_operations.py | 252 + .../operations/_recommendations_operations.py | 1109 + .../_resource_health_metadata_operations.py | 471 + .../operations/_static_sites_operations.py | 1913 + .../_top_level_domains_operations.py | 252 + .../aio/operations/_web_apps_operations.py | 28546 +++++++++++++++ .../_web_site_management_client_operations.py | 1121 + .../mgmt/web/v2020_09_01/models/__init__.py | 1210 + .../mgmt/web/v2020_09_01/models/_models.py | 17635 ++++++++++ .../web/v2020_09_01/models/_models_py3.py | 19507 +++++++++++ .../_web_site_management_client_enums.py | 760 + .../web/v2020_09_01/operations/__init__.py | 43 + ...p_service_certificate_orders_operations.py | 1517 + .../_app_service_environments_operations.py | 3293 ++ .../_app_service_plans_operations.py | 2039 ++ ...ficate_registration_provider_operations.py | 113 + .../operations/_certificates_operations.py | 451 + .../_deleted_web_apps_operations.py | 252 + .../operations/_diagnostics_operations.py | 1800 + ...domain_registration_provider_operations.py | 113 + .../operations/_domains_operations.py | 1139 + .../operations/_provider_operations.py | 259 + .../operations/_recommendations_operations.py | 1128 + .../_resource_health_metadata_operations.py | 481 + .../operations/_static_sites_operations.py | 1944 ++ .../_top_level_domains_operations.py | 259 + .../operations/_web_apps_operations.py | 28958 ++++++++++++++++ .../_web_site_management_client_operations.py | 1142 + .../azure/mgmt/web/v2020_09_01/py.typed | 1 + ...gmt_app_service.test_app_service_plan.yaml | 45 +- ...cli_mgmt_static_site.test_static_site.yaml | 56 +- .../test_cli_mgmt_web_app.test_web_app.yaml | 217 +- ...st_cli_mgmt_web_app.test_web_app_slot.yaml | 213 +- 131 files changed, 257284 insertions(+), 441 deletions(-) delete mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/_version.py delete mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/_version.py delete mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_11_01/_version.py delete mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/_version.py rename sdk/appservice/azure-mgmt-web/azure/mgmt/web/{v2016_03_01/_version.py => v2020_06_01/__init__.py} (69%) create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/_configuration.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/_metadata.json create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/_web_site_management_client.py rename sdk/appservice/azure-mgmt-web/azure/mgmt/web/{v2015_04_01/_version.py => v2020_06_01/aio/__init__.py} (81%) create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/_configuration.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/_web_site_management_client.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/__init__.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_app_service_certificate_orders_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_app_service_environments_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_app_service_plans_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_certificate_registration_provider_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_certificates_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_deleted_web_apps_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_diagnostics_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_domain_registration_provider_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_domains_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_provider_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_recommendations_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_resource_health_metadata_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_static_sites_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_top_level_domains_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_web_apps_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_web_site_management_client_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/models/__init__.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/models/_models.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/models/_models_py3.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/models/_web_site_management_client_enums.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/__init__.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_app_service_certificate_orders_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_app_service_environments_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_app_service_plans_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_certificate_registration_provider_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_certificates_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_deleted_web_apps_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_diagnostics_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_domain_registration_provider_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_domains_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_provider_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_recommendations_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_resource_health_metadata_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_static_sites_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_top_level_domains_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_web_apps_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_web_site_management_client_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/py.typed rename sdk/appservice/azure-mgmt-web/azure/mgmt/web/{v2016_08_01/_version.py => v2020_09_01/__init__.py} (69%) create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/_configuration.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/_metadata.json create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/_web_site_management_client.py rename sdk/appservice/azure-mgmt-web/azure/mgmt/web/{v2015_08_01/_version.py => v2020_09_01/aio/__init__.py} (81%) create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/_configuration.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/_web_site_management_client.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/__init__.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_app_service_certificate_orders_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_app_service_environments_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_app_service_plans_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_certificate_registration_provider_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_certificates_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_deleted_web_apps_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_diagnostics_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_domain_registration_provider_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_domains_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_provider_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_recommendations_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_resource_health_metadata_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_static_sites_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_top_level_domains_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_web_apps_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_web_site_management_client_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/models/__init__.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/models/_models.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/models/_models_py3.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/models/_web_site_management_client_enums.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/__init__.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_app_service_certificate_orders_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_app_service_environments_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_app_service_plans_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_certificate_registration_provider_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_certificates_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_deleted_web_apps_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_diagnostics_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_domain_registration_provider_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_domains_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_provider_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_recommendations_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_resource_health_metadata_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_static_sites_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_top_level_domains_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_web_apps_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_web_site_management_client_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/py.typed diff --git a/sdk/appservice/azure-mgmt-web/CHANGELOG.md b/sdk/appservice/azure-mgmt-web/CHANGELOG.md index 3b85ed038260..20ba0c77003e 100644 --- a/sdk/appservice/azure-mgmt-web/CHANGELOG.md +++ b/sdk/appservice/azure-mgmt-web/CHANGELOG.md @@ -1,7 +1,168 @@ # Release History +## 2.0.0 (2021-02-25) + +**Features** + + - Model Usage has a new parameter system_data + - Model StaticSiteFunctionOverviewARMResource has a new parameter system_data + - Model HybridConnection has a new parameter system_data + - Model GeoRegion has a new parameter system_data + - Model IpSecurityRestriction has a new parameter headers + - Model StaticSiteBuildARMResource has a new parameter system_data + - Model PushSettings has a new parameter system_data + - Model SlotDifference has a new parameter system_data + - Model AppServiceCertificatePatchResource has a new parameter system_data + - Model DiagnosticDetectorResponse has a new parameter system_data + - Model MetricSpecification has a new parameter supported_aggregation_types + - Model PremierAddOnPatchResource has a new parameter system_data + - Model SitePatchResource has a new parameter custom_domain_verification_id + - Model SitePatchResource has a new parameter system_data + - Model SitePatchResource has a new parameter client_cert_mode + - Model HostNameBinding has a new parameter system_data + - Model CustomHostnameAnalysisResult has a new parameter system_data + - Model VnetGateway has a new parameter system_data + - Model MSDeployLog has a new parameter system_data + - Model Site has a new parameter custom_domain_verification_id + - Model Site has a new parameter system_data + - Model Site has a new parameter client_cert_mode + - Model PrivateEndpointConnectionResource has a new parameter system_data + - Model ResourceHealthMetadata has a new parameter system_data + - Model CertificatePatchResource has a new parameter system_data + - Model WorkerPoolResource has a new parameter system_data + - Model AppServiceEnvironmentResource has a new parameter system_data + - Model DetectorResponse has a new parameter system_data + - Model TriggeredWebJob has a new parameter system_data + - Model SiteSourceControl has a new parameter is_git_hub_action + - Model SiteSourceControl has a new parameter system_data + - Model MSDeploy has a new parameter system_data + - Model TriggeredJobHistory has a new parameter system_data + - Model SiteConfigResource has a new parameter vnet_route_all_enabled + - Model SiteConfigResource has a new parameter system_data + - Model SiteConfigResource has a new parameter scm_min_tls_version + - Model SiteConfigResource has a new parameter vnet_private_ports_count + - Model BackupRequest has a new parameter system_data + - Model DeletedSite has a new parameter system_data + - Model RenewCertificateOrderRequest has a new parameter system_data + - Model StorageMigrationResponse has a new parameter system_data + - Model CsmPublishingCredentialsPoliciesCollection has a new parameter system_data + - Model AddressResponse has a new parameter system_data + - Model BillingMeter has a new parameter system_data + - Model Deployment has a new parameter system_data + - Model ProcessModuleInfo has a new parameter system_data + - Model CertificateEmail has a new parameter system_data + - Model Certificate has a new parameter system_data + - Model StaticSitePatchResource has a new parameter system_data + - Model SitePhpErrorLogFlag has a new parameter system_data + - Model CsmPublishingCredentialsPoliciesEntity has a new parameter system_data + - Model SwiftVirtualNetwork has a new parameter system_data + - Model VnetRoute has a new parameter system_data + - Model ConnectionStringDictionary has a new parameter system_data + - Model WebSiteInstanceStatus has a new parameter system_data + - Model WebSiteInstanceStatus has a new parameter health_check_url + - Model HybridConnectionKey has a new parameter system_data + - Model PremierAddOnOffer has a new parameter system_data + - Model ContinuousWebJob has a new parameter system_data + - Model SnapshotRestoreRequest has a new parameter system_data + - Model SiteAuthSettings has a new parameter git_hub_client_id + - Model SiteAuthSettings has a new parameter microsoft_account_client_secret_setting_name + - Model SiteAuthSettings has a new parameter git_hub_client_secret + - Model SiteAuthSettings has a new parameter is_auth_from_file + - Model SiteAuthSettings has a new parameter auth_file_path + - Model SiteAuthSettings has a new parameter google_client_secret_setting_name + - Model SiteAuthSettings has a new parameter git_hub_client_secret_setting_name + - Model SiteAuthSettings has a new parameter aad_claims_authorization + - Model SiteAuthSettings has a new parameter system_data + - Model SiteAuthSettings has a new parameter git_hub_o_auth_scopes + - Model SiteAuthSettings has a new parameter client_secret_setting_name + - Model SiteAuthSettings has a new parameter twitter_consumer_secret_setting_name + - Model SiteAuthSettings has a new parameter facebook_app_secret_setting_name + - Model DetectorDefinition has a new parameter system_data + - Model SiteConfigurationSnapshotInfo has a new parameter system_data + - Model PublicCertificate has a new parameter system_data + - Model DomainOwnershipIdentifier has a new parameter system_data + - Model StringDictionary has a new parameter system_data + - Model PrivateLinkConnectionApprovalRequestResource has a new parameter system_data + - Model SlotConfigNamesResource has a new parameter system_data + - Model WebJob has a new parameter system_data + - Model ApplicationStackResource has a new parameter system_data + - Model ReissueCertificateOrderRequest has a new parameter system_data + - Model User has a new parameter system_data + - Model RestoreRequest has a new parameter system_data + - Model StaticSiteUserInvitationRequestResource has a new parameter system_data + - Model StorageMigrationOptions has a new parameter system_data + - Model HybridConnectionLimits has a new parameter system_data + - Model StaticSiteUserARMResource has a new parameter system_data + - Model AppServiceCertificateResource has a new parameter system_data + - Model AnalysisDefinition has a new parameter system_data + - Model VnetInfo has a new parameter system_data + - Model DomainPatchResource has a new parameter system_data + - Model MSDeployStatus has a new parameter system_data + - Model MigrateMySqlRequest has a new parameter system_data + - Model Identifier has a new parameter system_data + - Model SiteLogsConfig has a new parameter system_data + - Model AppServiceCertificateOrder has a new parameter system_data + - Model BackupItem has a new parameter system_data + - Model ProcessInfo has a new parameter system_data + - Model MigrateMySqlStatus has a new parameter system_data + - Model StaticSiteResetPropertiesARMResource has a new parameter system_data + - Model NetworkFeatures has a new parameter system_data + - Model Recommendation has a new parameter system_data + - Model ProcessThreadInfo has a new parameter system_data + - Model AzureStoragePropertyDictionaryResource has a new parameter system_data + - Model Domain has a new parameter system_data + - Model StaticSiteARMResource has a new parameter system_data + - Model ResourceMetricDefinition has a new parameter system_data + - Model VnetValidationTestFailure has a new parameter system_data + - Model StaticSiteUserInvitationResponseResource has a new parameter system_data + - Model PrivateAccess has a new parameter system_data + - Model SiteConfig has a new parameter vnet_route_all_enabled + - Model SiteConfig has a new parameter vnet_private_ports_count + - Model SiteConfig has a new parameter scm_min_tls_version + - Model FunctionEnvelope has a new parameter system_data + - Model TopLevelDomain has a new parameter system_data + - Model RecommendationRule has a new parameter system_data + - Model RelayServiceConnectionEntity has a new parameter system_data + - Model ProxyOnlyResource has a new parameter system_data + - Model Snapshot has a new parameter system_data + - Model VnetParameters has a new parameter system_data + - Model DiagnosticAnalysis has a new parameter system_data + - Model CertificateOrderAction has a new parameter system_data + - Model DeletedAppRestoreRequest has a new parameter system_data + - Model AppServicePlan has a new parameter system_data + - Model Resource has a new parameter system_data + - Model StaticSiteCustomDomainOverviewARMResource has a new parameter system_data + - Model PremierAddOn has a new parameter system_data + - Model TriggeredJobRun has a new parameter system_data + - Model LogSpecification has a new parameter log_filter_pattern + - Model DiagnosticCategory has a new parameter system_data + - Model SourceControl has a new parameter system_data + - Model VnetValidationFailureDetails has a new parameter system_data + - Model AppServiceEnvironmentPatchResource has a new parameter system_data + - Model AppServiceCertificateOrderPatchResource has a new parameter system_data + - Model SiteExtensionInfo has a new parameter system_data + - Model AppServicePlanPatchResource has a new parameter system_data + - Added operation WebAppsOperations.update_auth_settings_v2 + - Added operation WebAppsOperations.update_auth_settings_v2_slot + - Added operation WebAppsOperations.get_auth_settings_v2 + - Added operation WebAppsOperations.get_auth_settings_v2_slot + - Added operation StaticSitesOperations.preview_workflow + - Added operation WebSiteManagementClientOperationsMixin.generate_github_access_token_for_appservice_cli_async + +**Breaking changes** + + - Model SiteConfigResource no longer has parameter acr_use_managed_identity_creds + - Model SiteConfigResource no longer has parameter acr_user_managed_identity_id + - Model SiteConfig no longer has parameter acr_use_managed_identity_creds + - Model SiteConfig no longer has parameter acr_user_managed_identity_id + - Model FunctionSecrets has a new signature + - Removed operation WebAppsOperations.get_app_settings_key_vault_references + - Removed operation WebAppsOperations.get_app_setting_key_vault_reference + ## 1.0.0 (2020-11-23) +- GA release + ## 1.0.0b1 (2020-10-13) This is beta preview version. diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_operations_mixin.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_operations_mixin.py index 3ea29b98ed99..4dc9bde189d6 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_operations_mixin.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_operations_mixin.py @@ -39,12 +39,12 @@ def check_name_availability( :param name: Resource name to verify. :type name: str :param type: Resource type used for verification. - :type type: str or ~azure.mgmt.web.v2019_08_01.models.CheckNameResourceTypes + :type type: str or ~azure.mgmt.web.v2020_09_01.models.CheckNameResourceTypes :param is_fqdn: Is fully qualified domain name. :type is_fqdn: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceNameAvailability, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2019_08_01.models.ResourceNameAvailability + :rtype: ~azure.mgmt.web.v2020_09_01.models.ResourceNameAvailability :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('check_name_availability') @@ -54,6 +54,10 @@ def check_name_availability( from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'check_name_availability'".format(api_version)) mixin_instance = OperationClass() @@ -64,6 +68,38 @@ def check_name_availability( mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) return mixin_instance.check_name_availability(name, type, is_fqdn, **kwargs) + def generate_github_access_token_for_appservice_cli_async( + self, + code, # type: str + state, # type: str + **kwargs # type: Any + ): + """Exchange code for GitHub access token for AppService CLI. + + Description for Exchange code for GitHub access token for AppService CLI. + + :param code: Code string to exchange for Github Access token. + :type code: str + :param state: State string used for verification. + :type state: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppserviceGithubToken, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AppserviceGithubToken + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = self._get_api_version('generate_github_access_token_for_appservice_cli_async') + if api_version == '2020-09-01': + from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + else: + raise ValueError("API version {} does not have operation 'generate_github_access_token_for_appservice_cli_async'".format(api_version)) + mixin_instance = OperationClass() + mixin_instance._client = self._client + mixin_instance._config = self._config + mixin_instance._serialize = Serializer(self._models_dict(api_version)) + mixin_instance._serialize.client_side_validation = False + mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) + return mixin_instance.generate_github_access_token_for_appservice_cli_async(code, state, **kwargs) + def get_publishing_user( self, **kwargs # type: Any @@ -74,7 +110,7 @@ def get_publishing_user( :keyword callable cls: A custom type or function that will be passed the direct response :return: User, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2019_08_01.models.User + :rtype: ~azure.mgmt.web.v2020_09_01.models.User :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_publishing_user') @@ -84,6 +120,10 @@ def get_publishing_user( from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_publishing_user'".format(api_version)) mixin_instance = OperationClass() @@ -107,7 +147,7 @@ def get_source_control( :type source_control_type: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControl, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2019_08_01.models.SourceControl + :rtype: ~azure.mgmt.web.v2020_09_01.models.SourceControl :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_source_control') @@ -117,6 +157,10 @@ def get_source_control( from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_source_control'".format(api_version)) mixin_instance = OperationClass() @@ -137,7 +181,7 @@ def get_subscription_deployment_locations( :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentLocations, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2019_08_01.models.DeploymentLocations + :rtype: ~azure.mgmt.web.v2020_09_01.models.DeploymentLocations :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_subscription_deployment_locations') @@ -147,6 +191,10 @@ def get_subscription_deployment_locations( from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_subscription_deployment_locations'".format(api_version)) mixin_instance = OperationClass() @@ -173,7 +221,7 @@ def list_billing_meters( :type os_type: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BillingMeterCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2019_08_01.models.BillingMeterCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.BillingMeterCollection] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_billing_meters') @@ -181,6 +229,10 @@ def list_billing_meters( from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_billing_meters'".format(api_version)) mixin_instance = OperationClass() @@ -204,7 +256,7 @@ def list_geo_regions( Description for Get a list of available geographical regions. :param sku: Name of SKU used to filter the regions. - :type sku: str or ~azure.mgmt.web.v2019_08_01.models.SkuName + :type sku: str or ~azure.mgmt.web.v2020_09_01.models.SkuName :param linux_workers_enabled: Specify :code:`true` if you want to filter to only regions that support Linux workers. :type linux_workers_enabled: bool @@ -216,7 +268,7 @@ def list_geo_regions( :type linux_dynamic_workers_enabled: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GeoRegionCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2019_08_01.models.GeoRegionCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.GeoRegionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_geo_regions') @@ -226,6 +278,10 @@ def list_geo_regions( from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_geo_regions'".format(api_version)) mixin_instance = OperationClass() @@ -246,7 +302,7 @@ def list_premier_add_on_offers( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PremierAddOnOfferCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2019_08_01.models.PremierAddOnOfferCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.PremierAddOnOfferCollection] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_premier_add_on_offers') @@ -256,6 +312,10 @@ def list_premier_add_on_offers( from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_premier_add_on_offers'".format(api_version)) mixin_instance = OperationClass() @@ -276,10 +336,10 @@ def list_site_identifiers_assigned_to_host_name( Description for List all apps that are assigned to a hostname. :param name_identifier: Hostname information. - :type name_identifier: ~azure.mgmt.web.v2019_08_01.models.NameIdentifier + :type name_identifier: ~azure.mgmt.web.v2020_09_01.models.NameIdentifier :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either IdentifierCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2019_08_01.models.IdentifierCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.IdentifierCollection] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_site_identifiers_assigned_to_host_name') @@ -289,6 +349,10 @@ def list_site_identifiers_assigned_to_host_name( from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_site_identifiers_assigned_to_host_name'".format(api_version)) mixin_instance = OperationClass() @@ -309,7 +373,7 @@ def list_skus( :keyword callable cls: A custom type or function that will be passed the direct response :return: SkuInfos, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2019_08_01.models.SkuInfos + :rtype: ~azure.mgmt.web.v2020_09_01.models.SkuInfos :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_skus') @@ -319,6 +383,10 @@ def list_skus( from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_skus'".format(api_version)) mixin_instance = OperationClass() @@ -339,7 +407,7 @@ def list_source_controls( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SourceControlCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2019_08_01.models.SourceControlCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.SourceControlCollection] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_source_controls') @@ -349,6 +417,10 @@ def list_source_controls( from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_source_controls'".format(api_version)) mixin_instance = OperationClass() @@ -372,7 +444,7 @@ def move( :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param move_resource_envelope: Object that represents the resource to move. - :type move_resource_envelope: ~azure.mgmt.web.v2019_08_01.models.CsmMoveResourceEnvelope + :type move_resource_envelope: ~azure.mgmt.web.v2020_09_01.models.CsmMoveResourceEnvelope :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -385,6 +457,10 @@ def move( from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'move'".format(api_version)) mixin_instance = OperationClass() @@ -405,10 +481,10 @@ def update_publishing_user( Description for Updates publishing user. :param user_details: Details of publishing user. - :type user_details: ~azure.mgmt.web.v2019_08_01.models.User + :type user_details: ~azure.mgmt.web.v2020_09_01.models.User :keyword callable cls: A custom type or function that will be passed the direct response :return: User, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2019_08_01.models.User + :rtype: ~azure.mgmt.web.v2020_09_01.models.User :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('update_publishing_user') @@ -418,6 +494,10 @@ def update_publishing_user( from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'update_publishing_user'".format(api_version)) mixin_instance = OperationClass() @@ -441,10 +521,10 @@ def update_source_control( :param source_control_type: Type of source control. :type source_control_type: str :param request_message: Source control token information. - :type request_message: ~azure.mgmt.web.v2019_08_01.models.SourceControl + :type request_message: ~azure.mgmt.web.v2020_09_01.models.SourceControl :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControl, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2019_08_01.models.SourceControl + :rtype: ~azure.mgmt.web.v2020_09_01.models.SourceControl :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('update_source_control') @@ -454,6 +534,10 @@ def update_source_control( from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'update_source_control'".format(api_version)) mixin_instance = OperationClass() @@ -477,10 +561,10 @@ def validate( :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param validate_request: Request with the resources to validate. - :type validate_request: ~azure.mgmt.web.v2019_08_01.models.ValidateRequest + :type validate_request: ~azure.mgmt.web.v2020_09_01.models.ValidateRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: ValidateResponse, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2019_08_01.models.ValidateResponse + :rtype: ~azure.mgmt.web.v2020_09_01.models.ValidateResponse :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('validate') @@ -490,6 +574,10 @@ def validate( from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'validate'".format(api_version)) mixin_instance = OperationClass() @@ -545,7 +633,7 @@ def validate_move( :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param move_resource_envelope: Object that represents the resource to move. - :type move_resource_envelope: ~azure.mgmt.web.v2019_08_01.models.CsmMoveResourceEnvelope + :type move_resource_envelope: ~azure.mgmt.web.v2020_09_01.models.CsmMoveResourceEnvelope :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -558,6 +646,10 @@ def validate_move( from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'validate_move'".format(api_version)) mixin_instance = OperationClass() @@ -579,10 +671,10 @@ def verify_hosting_environment_vnet( analyzing the Network Security Group rules. :param parameters: VNET information. - :type parameters: ~azure.mgmt.web.v2019_08_01.models.VnetParameters + :type parameters: ~azure.mgmt.web.v2020_09_01.models.VnetParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: VnetValidationFailureDetails, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2019_08_01.models.VnetValidationFailureDetails + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetValidationFailureDetails :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('verify_hosting_environment_vnet') @@ -592,6 +684,10 @@ def verify_hosting_environment_vnet( from .v2018_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'verify_hosting_environment_vnet'".format(api_version)) mixin_instance = OperationClass() diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_version.py index a39916c162ce..48944bf3938a 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_version.py @@ -1,13 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# 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. +# 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/appservice/azure-mgmt-web/azure/mgmt/web/_web_site_management_client.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_web_site_management_client.py index a0c8927b2b7f..8a2f3426aed5 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_web_site_management_client.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_web_site_management_client.py @@ -46,7 +46,7 @@ class WebSiteManagementClient(WebSiteManagementClientOperationsMixin, MultiApiCl :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2019-08-01' + DEFAULT_API_VERSION = '2020-09-01' _PROFILE_TAG = "azure.mgmt.web.WebSiteManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -91,6 +91,8 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2018-02-01: :mod:`v2018_02_01.models` * 2018-11-01: :mod:`v2018_11_01.models` * 2019-08-01: :mod:`v2019_08_01.models` + * 2020-06-01: :mod:`v2020_06_01.models` + * 2020-09-01: :mod:`v2020_09_01.models` """ if api_version == '2015-04-01': from .v2015_04_01 import models @@ -116,6 +118,12 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2019-08-01': from .v2019_08_01 import models return models + elif api_version == '2020-06-01': + from .v2020_06_01 import models + return models + elif api_version == '2020-09-01': + from .v2020_09_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -125,6 +133,8 @@ def app_service_certificate_orders(self): * 2015-08-01: :class:`AppServiceCertificateOrdersOperations` * 2018-02-01: :class:`AppServiceCertificateOrdersOperations` * 2019-08-01: :class:`AppServiceCertificateOrdersOperations` + * 2020-06-01: :class:`AppServiceCertificateOrdersOperations` + * 2020-09-01: :class:`AppServiceCertificateOrdersOperations` """ api_version = self._get_api_version('app_service_certificate_orders') if api_version == '2015-08-01': @@ -133,6 +143,10 @@ def app_service_certificate_orders(self): from .v2018_02_01.operations import AppServiceCertificateOrdersOperations as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import AppServiceCertificateOrdersOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import AppServiceCertificateOrdersOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import AppServiceCertificateOrdersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'app_service_certificate_orders'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -144,6 +158,8 @@ def app_service_environments(self): * 2016-09-01: :class:`AppServiceEnvironmentsOperations` * 2018-02-01: :class:`AppServiceEnvironmentsOperations` * 2019-08-01: :class:`AppServiceEnvironmentsOperations` + * 2020-06-01: :class:`AppServiceEnvironmentsOperations` + * 2020-09-01: :class:`AppServiceEnvironmentsOperations` """ api_version = self._get_api_version('app_service_environments') if api_version == '2016-09-01': @@ -152,6 +168,10 @@ def app_service_environments(self): from .v2018_02_01.operations import AppServiceEnvironmentsOperations as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import AppServiceEnvironmentsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import AppServiceEnvironmentsOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import AppServiceEnvironmentsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'app_service_environments'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -163,6 +183,8 @@ def app_service_plans(self): * 2016-09-01: :class:`AppServicePlansOperations` * 2018-02-01: :class:`AppServicePlansOperations` * 2019-08-01: :class:`AppServicePlansOperations` + * 2020-06-01: :class:`AppServicePlansOperations` + * 2020-09-01: :class:`AppServicePlansOperations` """ api_version = self._get_api_version('app_service_plans') if api_version == '2016-09-01': @@ -171,6 +193,10 @@ def app_service_plans(self): from .v2018_02_01.operations import AppServicePlansOperations as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import AppServicePlansOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import AppServicePlansOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import AppServicePlansOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'app_service_plans'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -195,6 +221,8 @@ def certificate_registration_provider(self): * 2015-08-01: :class:`CertificateRegistrationProviderOperations` * 2018-02-01: :class:`CertificateRegistrationProviderOperations` * 2019-08-01: :class:`CertificateRegistrationProviderOperations` + * 2020-06-01: :class:`CertificateRegistrationProviderOperations` + * 2020-09-01: :class:`CertificateRegistrationProviderOperations` """ api_version = self._get_api_version('certificate_registration_provider') if api_version == '2015-08-01': @@ -203,6 +231,10 @@ def certificate_registration_provider(self): from .v2018_02_01.operations import CertificateRegistrationProviderOperations as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import CertificateRegistrationProviderOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import CertificateRegistrationProviderOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import CertificateRegistrationProviderOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'certificate_registration_provider'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -215,6 +247,8 @@ def certificates(self): * 2018-02-01: :class:`CertificatesOperations` * 2018-11-01: :class:`CertificatesOperations` * 2019-08-01: :class:`CertificatesOperations` + * 2020-06-01: :class:`CertificatesOperations` + * 2020-09-01: :class:`CertificatesOperations` """ api_version = self._get_api_version('certificates') if api_version == '2016-03-01': @@ -225,6 +259,10 @@ def certificates(self): from .v2018_11_01.operations import CertificatesOperations as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import CertificatesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import CertificatesOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import CertificatesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'certificates'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -236,6 +274,8 @@ def deleted_web_apps(self): * 2016-03-01: :class:`DeletedWebAppsOperations` * 2018-02-01: :class:`DeletedWebAppsOperations` * 2019-08-01: :class:`DeletedWebAppsOperations` + * 2020-06-01: :class:`DeletedWebAppsOperations` + * 2020-09-01: :class:`DeletedWebAppsOperations` """ api_version = self._get_api_version('deleted_web_apps') if api_version == '2016-03-01': @@ -244,6 +284,10 @@ def deleted_web_apps(self): from .v2018_02_01.operations import DeletedWebAppsOperations as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import DeletedWebAppsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import DeletedWebAppsOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import DeletedWebAppsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'deleted_web_apps'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -255,6 +299,8 @@ def diagnostics(self): * 2016-03-01: :class:`DiagnosticsOperations` * 2018-02-01: :class:`DiagnosticsOperations` * 2019-08-01: :class:`DiagnosticsOperations` + * 2020-06-01: :class:`DiagnosticsOperations` + * 2020-09-01: :class:`DiagnosticsOperations` """ api_version = self._get_api_version('diagnostics') if api_version == '2016-03-01': @@ -263,6 +309,10 @@ def diagnostics(self): from .v2018_02_01.operations import DiagnosticsOperations as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import DiagnosticsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import DiagnosticsOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import DiagnosticsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'diagnostics'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -274,6 +324,8 @@ def domain_registration_provider(self): * 2015-04-01: :class:`DomainRegistrationProviderOperations` * 2018-02-01: :class:`DomainRegistrationProviderOperations` * 2019-08-01: :class:`DomainRegistrationProviderOperations` + * 2020-06-01: :class:`DomainRegistrationProviderOperations` + * 2020-09-01: :class:`DomainRegistrationProviderOperations` """ api_version = self._get_api_version('domain_registration_provider') if api_version == '2015-04-01': @@ -282,6 +334,10 @@ def domain_registration_provider(self): from .v2018_02_01.operations import DomainRegistrationProviderOperations as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import DomainRegistrationProviderOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import DomainRegistrationProviderOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import DomainRegistrationProviderOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'domain_registration_provider'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -293,6 +349,8 @@ def domains(self): * 2015-04-01: :class:`DomainsOperations` * 2018-02-01: :class:`DomainsOperations` * 2019-08-01: :class:`DomainsOperations` + * 2020-06-01: :class:`DomainsOperations` + * 2020-09-01: :class:`DomainsOperations` """ api_version = self._get_api_version('domains') if api_version == '2015-04-01': @@ -301,6 +359,10 @@ def domains(self): from .v2018_02_01.operations import DomainsOperations as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import DomainsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import DomainsOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import DomainsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'domains'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -312,6 +374,8 @@ def provider(self): * 2016-03-01: :class:`ProviderOperations` * 2018-02-01: :class:`ProviderOperations` * 2019-08-01: :class:`ProviderOperations` + * 2020-06-01: :class:`ProviderOperations` + * 2020-09-01: :class:`ProviderOperations` """ api_version = self._get_api_version('provider') if api_version == '2016-03-01': @@ -320,6 +384,10 @@ def provider(self): from .v2018_02_01.operations import ProviderOperations as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import ProviderOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ProviderOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import ProviderOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'provider'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -331,6 +399,8 @@ def recommendations(self): * 2016-03-01: :class:`RecommendationsOperations` * 2018-02-01: :class:`RecommendationsOperations` * 2019-08-01: :class:`RecommendationsOperations` + * 2020-06-01: :class:`RecommendationsOperations` + * 2020-09-01: :class:`RecommendationsOperations` """ api_version = self._get_api_version('recommendations') if api_version == '2016-03-01': @@ -339,6 +409,10 @@ def recommendations(self): from .v2018_02_01.operations import RecommendationsOperations as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import RecommendationsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import RecommendationsOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import RecommendationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'recommendations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -350,6 +424,8 @@ def resource_health_metadata(self): * 2016-03-01: :class:`ResourceHealthMetadataOperations` * 2018-02-01: :class:`ResourceHealthMetadataOperations` * 2019-08-01: :class:`ResourceHealthMetadataOperations` + * 2020-06-01: :class:`ResourceHealthMetadataOperations` + * 2020-09-01: :class:`ResourceHealthMetadataOperations` """ api_version = self._get_api_version('resource_health_metadata') if api_version == '2016-03-01': @@ -358,6 +434,10 @@ def resource_health_metadata(self): from .v2018_02_01.operations import ResourceHealthMetadataOperations as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import ResourceHealthMetadataOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ResourceHealthMetadataOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import ResourceHealthMetadataOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'resource_health_metadata'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -367,10 +447,16 @@ def static_sites(self): """Instance depends on the API version: * 2019-08-01: :class:`StaticSitesOperations` + * 2020-06-01: :class:`StaticSitesOperations` + * 2020-09-01: :class:`StaticSitesOperations` """ api_version = self._get_api_version('static_sites') if api_version == '2019-08-01': from .v2019_08_01.operations import StaticSitesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import StaticSitesOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import StaticSitesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'static_sites'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -382,6 +468,8 @@ def top_level_domains(self): * 2015-04-01: :class:`TopLevelDomainsOperations` * 2018-02-01: :class:`TopLevelDomainsOperations` * 2019-08-01: :class:`TopLevelDomainsOperations` + * 2020-06-01: :class:`TopLevelDomainsOperations` + * 2020-09-01: :class:`TopLevelDomainsOperations` """ api_version = self._get_api_version('top_level_domains') if api_version == '2015-04-01': @@ -390,6 +478,10 @@ def top_level_domains(self): from .v2018_02_01.operations import TopLevelDomainsOperations as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import TopLevelDomainsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import TopLevelDomainsOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import TopLevelDomainsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'top_level_domains'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -401,6 +493,8 @@ def web_apps(self): * 2016-08-01: :class:`WebAppsOperations` * 2018-02-01: :class:`WebAppsOperations` * 2019-08-01: :class:`WebAppsOperations` + * 2020-06-01: :class:`WebAppsOperations` + * 2020-09-01: :class:`WebAppsOperations` """ api_version = self._get_api_version('web_apps') if api_version == '2016-08-01': @@ -409,6 +503,10 @@ def web_apps(self): from .v2018_02_01.operations import WebAppsOperations as OperationClass elif api_version == '2019-08-01': from .v2019_08_01.operations import WebAppsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import WebAppsOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import WebAppsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'web_apps'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_operations_mixin.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_operations_mixin.py index 68afcbfab5a3..c960e8f7d65c 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_operations_mixin.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_operations_mixin.py @@ -35,12 +35,12 @@ async def check_name_availability( :param name: Resource name to verify. :type name: str :param type: Resource type used for verification. - :type type: str or ~azure.mgmt.web.v2019_08_01.models.CheckNameResourceTypes + :type type: str or ~azure.mgmt.web.v2020_09_01.models.CheckNameResourceTypes :param is_fqdn: Is fully qualified domain name. :type is_fqdn: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceNameAvailability, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2019_08_01.models.ResourceNameAvailability + :rtype: ~azure.mgmt.web.v2020_09_01.models.ResourceNameAvailability :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('check_name_availability') @@ -50,6 +50,10 @@ async def check_name_availability( from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'check_name_availability'".format(api_version)) mixin_instance = OperationClass() @@ -60,6 +64,38 @@ async def check_name_availability( mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) return await mixin_instance.check_name_availability(name, type, is_fqdn, **kwargs) + async def generate_github_access_token_for_appservice_cli_async( + self, + code: str, + state: str, + **kwargs + ) -> "_models.AppserviceGithubToken": + """Exchange code for GitHub access token for AppService CLI. + + Description for Exchange code for GitHub access token for AppService CLI. + + :param code: Code string to exchange for Github Access token. + :type code: str + :param state: State string used for verification. + :type state: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppserviceGithubToken, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AppserviceGithubToken + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = self._get_api_version('generate_github_access_token_for_appservice_cli_async') + if api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + else: + raise ValueError("API version {} does not have operation 'generate_github_access_token_for_appservice_cli_async'".format(api_version)) + mixin_instance = OperationClass() + mixin_instance._client = self._client + mixin_instance._config = self._config + mixin_instance._serialize = Serializer(self._models_dict(api_version)) + mixin_instance._serialize.client_side_validation = False + mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) + return await mixin_instance.generate_github_access_token_for_appservice_cli_async(code, state, **kwargs) + async def get_publishing_user( self, **kwargs @@ -70,7 +106,7 @@ async def get_publishing_user( :keyword callable cls: A custom type or function that will be passed the direct response :return: User, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2019_08_01.models.User + :rtype: ~azure.mgmt.web.v2020_09_01.models.User :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_publishing_user') @@ -80,6 +116,10 @@ async def get_publishing_user( from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_publishing_user'".format(api_version)) mixin_instance = OperationClass() @@ -103,7 +143,7 @@ async def get_source_control( :type source_control_type: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControl, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2019_08_01.models.SourceControl + :rtype: ~azure.mgmt.web.v2020_09_01.models.SourceControl :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_source_control') @@ -113,6 +153,10 @@ async def get_source_control( from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_source_control'".format(api_version)) mixin_instance = OperationClass() @@ -133,7 +177,7 @@ async def get_subscription_deployment_locations( :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentLocations, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2019_08_01.models.DeploymentLocations + :rtype: ~azure.mgmt.web.v2020_09_01.models.DeploymentLocations :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_subscription_deployment_locations') @@ -143,6 +187,10 @@ async def get_subscription_deployment_locations( from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_subscription_deployment_locations'".format(api_version)) mixin_instance = OperationClass() @@ -169,7 +217,7 @@ def list_billing_meters( :type os_type: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BillingMeterCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2019_08_01.models.BillingMeterCollection] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.BillingMeterCollection] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_billing_meters') @@ -177,6 +225,10 @@ def list_billing_meters( from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_billing_meters'".format(api_version)) mixin_instance = OperationClass() @@ -200,7 +252,7 @@ def list_geo_regions( Description for Get a list of available geographical regions. :param sku: Name of SKU used to filter the regions. - :type sku: str or ~azure.mgmt.web.v2019_08_01.models.SkuName + :type sku: str or ~azure.mgmt.web.v2020_09_01.models.SkuName :param linux_workers_enabled: Specify :code:`true` if you want to filter to only regions that support Linux workers. :type linux_workers_enabled: bool @@ -212,7 +264,7 @@ def list_geo_regions( :type linux_dynamic_workers_enabled: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GeoRegionCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2019_08_01.models.GeoRegionCollection] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.GeoRegionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_geo_regions') @@ -222,6 +274,10 @@ def list_geo_regions( from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_geo_regions'".format(api_version)) mixin_instance = OperationClass() @@ -242,7 +298,7 @@ def list_premier_add_on_offers( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PremierAddOnOfferCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2019_08_01.models.PremierAddOnOfferCollection] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.PremierAddOnOfferCollection] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_premier_add_on_offers') @@ -252,6 +308,10 @@ def list_premier_add_on_offers( from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_premier_add_on_offers'".format(api_version)) mixin_instance = OperationClass() @@ -272,10 +332,10 @@ def list_site_identifiers_assigned_to_host_name( Description for List all apps that are assigned to a hostname. :param name_identifier: Hostname information. - :type name_identifier: ~azure.mgmt.web.v2019_08_01.models.NameIdentifier + :type name_identifier: ~azure.mgmt.web.v2020_09_01.models.NameIdentifier :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either IdentifierCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2019_08_01.models.IdentifierCollection] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.IdentifierCollection] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_site_identifiers_assigned_to_host_name') @@ -285,6 +345,10 @@ def list_site_identifiers_assigned_to_host_name( from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_site_identifiers_assigned_to_host_name'".format(api_version)) mixin_instance = OperationClass() @@ -305,7 +369,7 @@ async def list_skus( :keyword callable cls: A custom type or function that will be passed the direct response :return: SkuInfos, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2019_08_01.models.SkuInfos + :rtype: ~azure.mgmt.web.v2020_09_01.models.SkuInfos :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_skus') @@ -315,6 +379,10 @@ async def list_skus( from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_skus'".format(api_version)) mixin_instance = OperationClass() @@ -335,7 +403,7 @@ def list_source_controls( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SourceControlCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2019_08_01.models.SourceControlCollection] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.SourceControlCollection] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_source_controls') @@ -345,6 +413,10 @@ def list_source_controls( from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_source_controls'".format(api_version)) mixin_instance = OperationClass() @@ -368,7 +440,7 @@ async def move( :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param move_resource_envelope: Object that represents the resource to move. - :type move_resource_envelope: ~azure.mgmt.web.v2019_08_01.models.CsmMoveResourceEnvelope + :type move_resource_envelope: ~azure.mgmt.web.v2020_09_01.models.CsmMoveResourceEnvelope :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -381,6 +453,10 @@ async def move( from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'move'".format(api_version)) mixin_instance = OperationClass() @@ -401,10 +477,10 @@ async def update_publishing_user( Description for Updates publishing user. :param user_details: Details of publishing user. - :type user_details: ~azure.mgmt.web.v2019_08_01.models.User + :type user_details: ~azure.mgmt.web.v2020_09_01.models.User :keyword callable cls: A custom type or function that will be passed the direct response :return: User, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2019_08_01.models.User + :rtype: ~azure.mgmt.web.v2020_09_01.models.User :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('update_publishing_user') @@ -414,6 +490,10 @@ async def update_publishing_user( from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'update_publishing_user'".format(api_version)) mixin_instance = OperationClass() @@ -437,10 +517,10 @@ async def update_source_control( :param source_control_type: Type of source control. :type source_control_type: str :param request_message: Source control token information. - :type request_message: ~azure.mgmt.web.v2019_08_01.models.SourceControl + :type request_message: ~azure.mgmt.web.v2020_09_01.models.SourceControl :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControl, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2019_08_01.models.SourceControl + :rtype: ~azure.mgmt.web.v2020_09_01.models.SourceControl :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('update_source_control') @@ -450,6 +530,10 @@ async def update_source_control( from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'update_source_control'".format(api_version)) mixin_instance = OperationClass() @@ -473,10 +557,10 @@ async def validate( :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param validate_request: Request with the resources to validate. - :type validate_request: ~azure.mgmt.web.v2019_08_01.models.ValidateRequest + :type validate_request: ~azure.mgmt.web.v2020_09_01.models.ValidateRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: ValidateResponse, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2019_08_01.models.ValidateResponse + :rtype: ~azure.mgmt.web.v2020_09_01.models.ValidateResponse :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('validate') @@ -486,6 +570,10 @@ async def validate( from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'validate'".format(api_version)) mixin_instance = OperationClass() @@ -541,7 +629,7 @@ async def validate_move( :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param move_resource_envelope: Object that represents the resource to move. - :type move_resource_envelope: ~azure.mgmt.web.v2019_08_01.models.CsmMoveResourceEnvelope + :type move_resource_envelope: ~azure.mgmt.web.v2020_09_01.models.CsmMoveResourceEnvelope :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -554,6 +642,10 @@ async def validate_move( from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'validate_move'".format(api_version)) mixin_instance = OperationClass() @@ -575,10 +667,10 @@ async def verify_hosting_environment_vnet( analyzing the Network Security Group rules. :param parameters: VNET information. - :type parameters: ~azure.mgmt.web.v2019_08_01.models.VnetParameters + :type parameters: ~azure.mgmt.web.v2020_09_01.models.VnetParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: VnetValidationFailureDetails, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2019_08_01.models.VnetValidationFailureDetails + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetValidationFailureDetails :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('verify_hosting_environment_vnet') @@ -588,6 +680,10 @@ async def verify_hosting_environment_vnet( from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'verify_hosting_environment_vnet'".format(api_version)) mixin_instance = OperationClass() diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_web_site_management_client.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_web_site_management_client.py index 888fdd9272f0..3c0a3f9de7d7 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_web_site_management_client.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_web_site_management_client.py @@ -46,7 +46,7 @@ class WebSiteManagementClient(WebSiteManagementClientOperationsMixin, MultiApiCl :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2019-08-01' + DEFAULT_API_VERSION = '2020-09-01' _PROFILE_TAG = "azure.mgmt.web.WebSiteManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -91,6 +91,8 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2018-02-01: :mod:`v2018_02_01.models` * 2018-11-01: :mod:`v2018_11_01.models` * 2019-08-01: :mod:`v2019_08_01.models` + * 2020-06-01: :mod:`v2020_06_01.models` + * 2020-09-01: :mod:`v2020_09_01.models` """ if api_version == '2015-04-01': from ..v2015_04_01 import models @@ -116,6 +118,12 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2019-08-01': from ..v2019_08_01 import models return models + elif api_version == '2020-06-01': + from ..v2020_06_01 import models + return models + elif api_version == '2020-09-01': + from ..v2020_09_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -125,6 +133,8 @@ def app_service_certificate_orders(self): * 2015-08-01: :class:`AppServiceCertificateOrdersOperations` * 2018-02-01: :class:`AppServiceCertificateOrdersOperations` * 2019-08-01: :class:`AppServiceCertificateOrdersOperations` + * 2020-06-01: :class:`AppServiceCertificateOrdersOperations` + * 2020-09-01: :class:`AppServiceCertificateOrdersOperations` """ api_version = self._get_api_version('app_service_certificate_orders') if api_version == '2015-08-01': @@ -133,6 +143,10 @@ def app_service_certificate_orders(self): from ..v2018_02_01.aio.operations import AppServiceCertificateOrdersOperations as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import AppServiceCertificateOrdersOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import AppServiceCertificateOrdersOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import AppServiceCertificateOrdersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'app_service_certificate_orders'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -144,6 +158,8 @@ def app_service_environments(self): * 2016-09-01: :class:`AppServiceEnvironmentsOperations` * 2018-02-01: :class:`AppServiceEnvironmentsOperations` * 2019-08-01: :class:`AppServiceEnvironmentsOperations` + * 2020-06-01: :class:`AppServiceEnvironmentsOperations` + * 2020-09-01: :class:`AppServiceEnvironmentsOperations` """ api_version = self._get_api_version('app_service_environments') if api_version == '2016-09-01': @@ -152,6 +168,10 @@ def app_service_environments(self): from ..v2018_02_01.aio.operations import AppServiceEnvironmentsOperations as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import AppServiceEnvironmentsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import AppServiceEnvironmentsOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import AppServiceEnvironmentsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'app_service_environments'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -163,6 +183,8 @@ def app_service_plans(self): * 2016-09-01: :class:`AppServicePlansOperations` * 2018-02-01: :class:`AppServicePlansOperations` * 2019-08-01: :class:`AppServicePlansOperations` + * 2020-06-01: :class:`AppServicePlansOperations` + * 2020-09-01: :class:`AppServicePlansOperations` """ api_version = self._get_api_version('app_service_plans') if api_version == '2016-09-01': @@ -171,6 +193,10 @@ def app_service_plans(self): from ..v2018_02_01.aio.operations import AppServicePlansOperations as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import AppServicePlansOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import AppServicePlansOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import AppServicePlansOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'app_service_plans'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -195,6 +221,8 @@ def certificate_registration_provider(self): * 2015-08-01: :class:`CertificateRegistrationProviderOperations` * 2018-02-01: :class:`CertificateRegistrationProviderOperations` * 2019-08-01: :class:`CertificateRegistrationProviderOperations` + * 2020-06-01: :class:`CertificateRegistrationProviderOperations` + * 2020-09-01: :class:`CertificateRegistrationProviderOperations` """ api_version = self._get_api_version('certificate_registration_provider') if api_version == '2015-08-01': @@ -203,6 +231,10 @@ def certificate_registration_provider(self): from ..v2018_02_01.aio.operations import CertificateRegistrationProviderOperations as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import CertificateRegistrationProviderOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import CertificateRegistrationProviderOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import CertificateRegistrationProviderOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'certificate_registration_provider'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -215,6 +247,8 @@ def certificates(self): * 2018-02-01: :class:`CertificatesOperations` * 2018-11-01: :class:`CertificatesOperations` * 2019-08-01: :class:`CertificatesOperations` + * 2020-06-01: :class:`CertificatesOperations` + * 2020-09-01: :class:`CertificatesOperations` """ api_version = self._get_api_version('certificates') if api_version == '2016-03-01': @@ -225,6 +259,10 @@ def certificates(self): from ..v2018_11_01.aio.operations import CertificatesOperations as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import CertificatesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import CertificatesOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import CertificatesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'certificates'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -236,6 +274,8 @@ def deleted_web_apps(self): * 2016-03-01: :class:`DeletedWebAppsOperations` * 2018-02-01: :class:`DeletedWebAppsOperations` * 2019-08-01: :class:`DeletedWebAppsOperations` + * 2020-06-01: :class:`DeletedWebAppsOperations` + * 2020-09-01: :class:`DeletedWebAppsOperations` """ api_version = self._get_api_version('deleted_web_apps') if api_version == '2016-03-01': @@ -244,6 +284,10 @@ def deleted_web_apps(self): from ..v2018_02_01.aio.operations import DeletedWebAppsOperations as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import DeletedWebAppsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import DeletedWebAppsOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import DeletedWebAppsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'deleted_web_apps'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -255,6 +299,8 @@ def diagnostics(self): * 2016-03-01: :class:`DiagnosticsOperations` * 2018-02-01: :class:`DiagnosticsOperations` * 2019-08-01: :class:`DiagnosticsOperations` + * 2020-06-01: :class:`DiagnosticsOperations` + * 2020-09-01: :class:`DiagnosticsOperations` """ api_version = self._get_api_version('diagnostics') if api_version == '2016-03-01': @@ -263,6 +309,10 @@ def diagnostics(self): from ..v2018_02_01.aio.operations import DiagnosticsOperations as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import DiagnosticsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import DiagnosticsOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import DiagnosticsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'diagnostics'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -274,6 +324,8 @@ def domain_registration_provider(self): * 2015-04-01: :class:`DomainRegistrationProviderOperations` * 2018-02-01: :class:`DomainRegistrationProviderOperations` * 2019-08-01: :class:`DomainRegistrationProviderOperations` + * 2020-06-01: :class:`DomainRegistrationProviderOperations` + * 2020-09-01: :class:`DomainRegistrationProviderOperations` """ api_version = self._get_api_version('domain_registration_provider') if api_version == '2015-04-01': @@ -282,6 +334,10 @@ def domain_registration_provider(self): from ..v2018_02_01.aio.operations import DomainRegistrationProviderOperations as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import DomainRegistrationProviderOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import DomainRegistrationProviderOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import DomainRegistrationProviderOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'domain_registration_provider'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -293,6 +349,8 @@ def domains(self): * 2015-04-01: :class:`DomainsOperations` * 2018-02-01: :class:`DomainsOperations` * 2019-08-01: :class:`DomainsOperations` + * 2020-06-01: :class:`DomainsOperations` + * 2020-09-01: :class:`DomainsOperations` """ api_version = self._get_api_version('domains') if api_version == '2015-04-01': @@ -301,6 +359,10 @@ def domains(self): from ..v2018_02_01.aio.operations import DomainsOperations as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import DomainsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import DomainsOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import DomainsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'domains'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -312,6 +374,8 @@ def provider(self): * 2016-03-01: :class:`ProviderOperations` * 2018-02-01: :class:`ProviderOperations` * 2019-08-01: :class:`ProviderOperations` + * 2020-06-01: :class:`ProviderOperations` + * 2020-09-01: :class:`ProviderOperations` """ api_version = self._get_api_version('provider') if api_version == '2016-03-01': @@ -320,6 +384,10 @@ def provider(self): from ..v2018_02_01.aio.operations import ProviderOperations as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import ProviderOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import ProviderOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import ProviderOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'provider'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -331,6 +399,8 @@ def recommendations(self): * 2016-03-01: :class:`RecommendationsOperations` * 2018-02-01: :class:`RecommendationsOperations` * 2019-08-01: :class:`RecommendationsOperations` + * 2020-06-01: :class:`RecommendationsOperations` + * 2020-09-01: :class:`RecommendationsOperations` """ api_version = self._get_api_version('recommendations') if api_version == '2016-03-01': @@ -339,6 +409,10 @@ def recommendations(self): from ..v2018_02_01.aio.operations import RecommendationsOperations as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import RecommendationsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import RecommendationsOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import RecommendationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'recommendations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -350,6 +424,8 @@ def resource_health_metadata(self): * 2016-03-01: :class:`ResourceHealthMetadataOperations` * 2018-02-01: :class:`ResourceHealthMetadataOperations` * 2019-08-01: :class:`ResourceHealthMetadataOperations` + * 2020-06-01: :class:`ResourceHealthMetadataOperations` + * 2020-09-01: :class:`ResourceHealthMetadataOperations` """ api_version = self._get_api_version('resource_health_metadata') if api_version == '2016-03-01': @@ -358,6 +434,10 @@ def resource_health_metadata(self): from ..v2018_02_01.aio.operations import ResourceHealthMetadataOperations as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import ResourceHealthMetadataOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import ResourceHealthMetadataOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import ResourceHealthMetadataOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'resource_health_metadata'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -367,10 +447,16 @@ def static_sites(self): """Instance depends on the API version: * 2019-08-01: :class:`StaticSitesOperations` + * 2020-06-01: :class:`StaticSitesOperations` + * 2020-09-01: :class:`StaticSitesOperations` """ api_version = self._get_api_version('static_sites') if api_version == '2019-08-01': from ..v2019_08_01.aio.operations import StaticSitesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import StaticSitesOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import StaticSitesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'static_sites'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -382,6 +468,8 @@ def top_level_domains(self): * 2015-04-01: :class:`TopLevelDomainsOperations` * 2018-02-01: :class:`TopLevelDomainsOperations` * 2019-08-01: :class:`TopLevelDomainsOperations` + * 2020-06-01: :class:`TopLevelDomainsOperations` + * 2020-09-01: :class:`TopLevelDomainsOperations` """ api_version = self._get_api_version('top_level_domains') if api_version == '2015-04-01': @@ -390,6 +478,10 @@ def top_level_domains(self): from ..v2018_02_01.aio.operations import TopLevelDomainsOperations as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import TopLevelDomainsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import TopLevelDomainsOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import TopLevelDomainsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'top_level_domains'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -401,6 +493,8 @@ def web_apps(self): * 2016-08-01: :class:`WebAppsOperations` * 2018-02-01: :class:`WebAppsOperations` * 2019-08-01: :class:`WebAppsOperations` + * 2020-06-01: :class:`WebAppsOperations` + * 2020-09-01: :class:`WebAppsOperations` """ api_version = self._get_api_version('web_apps') if api_version == '2016-08-01': @@ -409,6 +503,10 @@ def web_apps(self): from ..v2018_02_01.aio.operations import WebAppsOperations as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations import WebAppsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import WebAppsOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import WebAppsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'web_apps'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/models.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/models.py index f7ccf42a3554..af31b0624539 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/models.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/models.py @@ -6,4 +6,4 @@ # -------------------------------------------------------------------------- from .v2016_03_01.models import * from .v2018_02_01.models import * -from .v2019_08_01.models import * +from .v2020_09_01.models import * diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_04_01/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_04_01/__init__.py index 45c59c58316a..32779ae9e1b0 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_04_01/__init__.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_04_01/__init__.py @@ -7,9 +7,6 @@ # -------------------------------------------------------------------------- from ._web_site_management_client import WebSiteManagementClient -from ._version import VERSION - -__version__ = VERSION __all__ = ['WebSiteManagementClient'] try: diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_04_01/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_04_01/_configuration.py index 0c813892959a..d21cdef02387 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_04_01/_configuration.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_04_01/_configuration.py @@ -12,14 +12,13 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy -from ._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential +VERSION = "unknown" class WebSiteManagementClientConfiguration(Configuration): """Configuration for WebSiteManagementClient. diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_04_01/aio/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_04_01/aio/_configuration.py index 4ef3d8640866..05de4e5e0cb5 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_04_01/aio/_configuration.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_04_01/aio/_configuration.py @@ -12,12 +12,11 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy -from .._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential +VERSION = "unknown" class WebSiteManagementClientConfiguration(Configuration): """Configuration for WebSiteManagementClient. diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/__init__.py index 45c59c58316a..32779ae9e1b0 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/__init__.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/__init__.py @@ -7,9 +7,6 @@ # -------------------------------------------------------------------------- from ._web_site_management_client import WebSiteManagementClient -from ._version import VERSION - -__version__ = VERSION __all__ = ['WebSiteManagementClient'] try: diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/_configuration.py index ee2eeb612b3a..8c2d65eb1b5e 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/_configuration.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/_configuration.py @@ -12,14 +12,13 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy -from ._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential +VERSION = "unknown" class WebSiteManagementClientConfiguration(Configuration): """Configuration for WebSiteManagementClient. diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/aio/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/aio/_configuration.py index f7000d37df1b..bbaa147a6b73 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/aio/_configuration.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/aio/_configuration.py @@ -12,12 +12,11 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy -from .._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential +VERSION = "unknown" class WebSiteManagementClientConfiguration(Configuration): """Configuration for WebSiteManagementClient. diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/__init__.py index 45c59c58316a..32779ae9e1b0 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/__init__.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/__init__.py @@ -7,9 +7,6 @@ # -------------------------------------------------------------------------- from ._web_site_management_client import WebSiteManagementClient -from ._version import VERSION - -__version__ = VERSION __all__ = ['WebSiteManagementClient'] try: diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/_configuration.py index 7c90c5f7b8fc..f48d49366b26 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/_configuration.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/_configuration.py @@ -12,14 +12,13 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy -from ._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential +VERSION = "unknown" class WebSiteManagementClientConfiguration(Configuration): """Configuration for WebSiteManagementClient. diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/aio/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/aio/_configuration.py index 80c223878906..ec6b4f114182 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/aio/_configuration.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/aio/_configuration.py @@ -12,12 +12,11 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy -from .._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential +VERSION = "unknown" class WebSiteManagementClientConfiguration(Configuration): """Configuration for WebSiteManagementClient. diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/__init__.py index 45c59c58316a..32779ae9e1b0 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/__init__.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/__init__.py @@ -7,9 +7,6 @@ # -------------------------------------------------------------------------- from ._web_site_management_client import WebSiteManagementClient -from ._version import VERSION - -__version__ = VERSION __all__ = ['WebSiteManagementClient'] try: diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/_configuration.py index 34859d13f251..3911ab48338c 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/_configuration.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/_configuration.py @@ -12,14 +12,13 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy -from ._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential +VERSION = "unknown" class WebSiteManagementClientConfiguration(Configuration): """Configuration for WebSiteManagementClient. diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/aio/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/aio/_configuration.py index 86a3e099a91f..4a83888832e6 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/aio/_configuration.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/aio/_configuration.py @@ -12,12 +12,11 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy -from .._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential +VERSION = "unknown" class WebSiteManagementClientConfiguration(Configuration): """Configuration for WebSiteManagementClient. diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/__init__.py index 45c59c58316a..32779ae9e1b0 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/__init__.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/__init__.py @@ -7,9 +7,6 @@ # -------------------------------------------------------------------------- from ._web_site_management_client import WebSiteManagementClient -from ._version import VERSION - -__version__ = VERSION __all__ = ['WebSiteManagementClient'] try: diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/_configuration.py index 7fd05d3967f8..870caf551976 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/_configuration.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/_configuration.py @@ -12,14 +12,13 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy -from ._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential +VERSION = "unknown" class WebSiteManagementClientConfiguration(Configuration): """Configuration for WebSiteManagementClient. diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/_version.py deleted file mode 100644 index 5c14e0d8303d..000000000000 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/_version.py +++ /dev/null @@ -1,9 +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. -# -------------------------------------------------------------------------- - -VERSION = "0.42.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/aio/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/aio/_configuration.py index 7a0b7491a6a3..8952108d56f0 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/aio/_configuration.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/aio/_configuration.py @@ -12,12 +12,11 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy -from .._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential +VERSION = "unknown" class WebSiteManagementClientConfiguration(Configuration): """Configuration for WebSiteManagementClient. diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/__init__.py index 45c59c58316a..32779ae9e1b0 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/__init__.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/__init__.py @@ -7,9 +7,6 @@ # -------------------------------------------------------------------------- from ._web_site_management_client import WebSiteManagementClient -from ._version import VERSION - -__version__ = VERSION __all__ = ['WebSiteManagementClient'] try: diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/_configuration.py index 20b106b6e2da..c39f12853558 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/_configuration.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/_configuration.py @@ -12,14 +12,13 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy -from ._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential +VERSION = "unknown" class WebSiteManagementClientConfiguration(Configuration): """Configuration for WebSiteManagementClient. diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/_version.py deleted file mode 100644 index 5c14e0d8303d..000000000000 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/_version.py +++ /dev/null @@ -1,9 +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. -# -------------------------------------------------------------------------- - -VERSION = "0.42.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/aio/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/aio/_configuration.py index af56b6258589..80c3cb9d30c4 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/aio/_configuration.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/aio/_configuration.py @@ -12,12 +12,11 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy -from .._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential +VERSION = "unknown" class WebSiteManagementClientConfiguration(Configuration): """Configuration for WebSiteManagementClient. diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_11_01/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_11_01/__init__.py index 45c59c58316a..32779ae9e1b0 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_11_01/__init__.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_11_01/__init__.py @@ -7,9 +7,6 @@ # -------------------------------------------------------------------------- from ._web_site_management_client import WebSiteManagementClient -from ._version import VERSION - -__version__ = VERSION __all__ = ['WebSiteManagementClient'] try: diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_11_01/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_11_01/_configuration.py index 93ee893dbacc..f2fea06223e9 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_11_01/_configuration.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_11_01/_configuration.py @@ -12,14 +12,13 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy -from ._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential +VERSION = "unknown" class WebSiteManagementClientConfiguration(Configuration): """Configuration for WebSiteManagementClient. diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_11_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_11_01/_version.py deleted file mode 100644 index 5c14e0d8303d..000000000000 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_11_01/_version.py +++ /dev/null @@ -1,9 +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. -# -------------------------------------------------------------------------- - -VERSION = "0.42.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_11_01/aio/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_11_01/aio/_configuration.py index 34b940936229..912eceb9824b 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_11_01/aio/_configuration.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_11_01/aio/_configuration.py @@ -12,12 +12,11 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy -from .._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential +VERSION = "unknown" class WebSiteManagementClientConfiguration(Configuration): """Configuration for WebSiteManagementClient. diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/__init__.py index 45c59c58316a..32779ae9e1b0 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/__init__.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/__init__.py @@ -7,9 +7,6 @@ # -------------------------------------------------------------------------- from ._web_site_management_client import WebSiteManagementClient -from ._version import VERSION - -__version__ = VERSION __all__ = ['WebSiteManagementClient'] try: diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/_configuration.py index ac656a9a822f..6352cef88fde 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/_configuration.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/_configuration.py @@ -12,14 +12,13 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy -from ._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential +VERSION = "unknown" class WebSiteManagementClientConfiguration(Configuration): """Configuration for WebSiteManagementClient. diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/_version.py deleted file mode 100644 index 5c14e0d8303d..000000000000 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/_version.py +++ /dev/null @@ -1,9 +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. -# -------------------------------------------------------------------------- - -VERSION = "0.42.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/aio/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/aio/_configuration.py index 823ae878264f..8fef553016cc 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/aio/_configuration.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/aio/_configuration.py @@ -12,12 +12,11 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy -from .._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential +VERSION = "unknown" class WebSiteManagementClientConfiguration(Configuration): """Configuration for WebSiteManagementClient. diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/__init__.py similarity index 69% rename from sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/_version.py rename to sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/__init__.py index 5c14e0d8303d..32779ae9e1b0 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/__init__.py @@ -6,4 +6,11 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.42.0" +from ._web_site_management_client import WebSiteManagementClient +__all__ = ['WebSiteManagementClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/_configuration.py new file mode 100644 index 000000000000..7d9ffea3ff94 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/_configuration.py @@ -0,0 +1,70 @@ +# 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 TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class WebSiteManagementClientConfiguration(Configuration): + """Configuration for WebSiteManagementClient. + + 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. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(WebSiteManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-06-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-web/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.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.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/_metadata.json b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/_metadata.json new file mode 100644 index 000000000000..6ff75acaaea6 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/_metadata.json @@ -0,0 +1,267 @@ +{ + "chosen_version": "2020-06-01", + "total_api_version_list": ["2020-06-01"], + "client": { + "name": "WebSiteManagementClient", + "filename": "_web_site_management_client", + "description": "WebSite Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null + }, + "operation_groups": { + "app_service_certificate_orders": "AppServiceCertificateOrdersOperations", + "certificate_registration_provider": "CertificateRegistrationProviderOperations", + "domains": "DomainsOperations", + "top_level_domains": "TopLevelDomainsOperations", + "domain_registration_provider": "DomainRegistrationProviderOperations", + "certificates": "CertificatesOperations", + "deleted_web_apps": "DeletedWebAppsOperations", + "diagnostics": "DiagnosticsOperations", + "provider": "ProviderOperations", + "recommendations": "RecommendationsOperations", + "web_apps": "WebAppsOperations", + "static_sites": "StaticSitesOperations", + "app_service_environments": "AppServiceEnvironmentsOperations", + "app_service_plans": "AppServicePlansOperations", + "resource_health_metadata": "ResourceHealthMetadataOperations" + }, + "operation_mixins": { + "get_publishing_user" : { + "sync": { + "signature": "def get_publishing_user(\n self,\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Gets publishing user.\n\nDescription for Gets publishing user.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: User, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_06_01.models.User\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_publishing_user(\n self,\n **kwargs\n) -\u003e \"_models.User\":\n", + "doc": "\"\"\"Gets publishing user.\n\nDescription for Gets publishing user.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: User, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_06_01.models.User\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "" + }, + "update_publishing_user" : { + "sync": { + "signature": "def update_publishing_user(\n self,\n user_details, # type: \"_models.User\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Updates publishing user.\n\nDescription for Updates publishing user.\n\n:param user_details: Details of publishing user.\n:type user_details: ~azure.mgmt.web.v2020_06_01.models.User\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: User, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_06_01.models.User\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def update_publishing_user(\n self,\n user_details: \"_models.User\",\n **kwargs\n) -\u003e \"_models.User\":\n", + "doc": "\"\"\"Updates publishing user.\n\nDescription for Updates publishing user.\n\n:param user_details: Details of publishing user.\n:type user_details: ~azure.mgmt.web.v2020_06_01.models.User\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: User, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_06_01.models.User\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "user_details" + }, + "list_source_controls" : { + "sync": { + "signature": "def list_source_controls(\n self,\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Gets the source controls available for Azure websites.\n\nDescription for Gets the source controls available for Azure websites.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either SourceControlCollection or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.SourceControlCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": false, + "signature": "def list_source_controls(\n self,\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.SourceControlCollection\"]:\n", + "doc": "\"\"\"Gets the source controls available for Azure websites.\n\nDescription for Gets the source controls available for Azure websites.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either SourceControlCollection or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.SourceControlCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "" + }, + "get_source_control" : { + "sync": { + "signature": "def get_source_control(\n self,\n source_control_type, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Gets source control token.\n\nDescription for Gets source control token.\n\n:param source_control_type: Type of source control.\n:type source_control_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SourceControl, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_06_01.models.SourceControl\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_source_control(\n self,\n source_control_type: str,\n **kwargs\n) -\u003e \"_models.SourceControl\":\n", + "doc": "\"\"\"Gets source control token.\n\nDescription for Gets source control token.\n\n:param source_control_type: Type of source control.\n:type source_control_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SourceControl, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_06_01.models.SourceControl\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "source_control_type" + }, + "update_source_control" : { + "sync": { + "signature": "def update_source_control(\n self,\n source_control_type, # type: str\n request_message, # type: \"_models.SourceControl\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Updates source control token.\n\nDescription for Updates source control token.\n\n:param source_control_type: Type of source control.\n:type source_control_type: str\n:param request_message: Source control token information.\n:type request_message: ~azure.mgmt.web.v2020_06_01.models.SourceControl\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SourceControl, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_06_01.models.SourceControl\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def update_source_control(\n self,\n source_control_type: str,\n request_message: \"_models.SourceControl\",\n **kwargs\n) -\u003e \"_models.SourceControl\":\n", + "doc": "\"\"\"Updates source control token.\n\nDescription for Updates source control token.\n\n:param source_control_type: Type of source control.\n:type source_control_type: str\n:param request_message: Source control token information.\n:type request_message: ~azure.mgmt.web.v2020_06_01.models.SourceControl\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SourceControl, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_06_01.models.SourceControl\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "source_control_type, request_message" + }, + "list_billing_meters" : { + "sync": { + "signature": "def list_billing_meters(\n self,\n billing_location=None, # type: Optional[str]\n os_type=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Gets a list of meters for a given location.\n\nDescription for Gets a list of meters for a given location.\n\n:param billing_location: Azure Location of billable resource.\n:type billing_location: str\n:param os_type: App Service OS type meters used for.\n:type os_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BillingMeterCollection or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.BillingMeterCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": false, + "signature": "def list_billing_meters(\n self,\n billing_location: Optional[str] = None,\n os_type: Optional[str] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.BillingMeterCollection\"]:\n", + "doc": "\"\"\"Gets a list of meters for a given location.\n\nDescription for Gets a list of meters for a given location.\n\n:param billing_location: Azure Location of billable resource.\n:type billing_location: str\n:param os_type: App Service OS type meters used for.\n:type os_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BillingMeterCollection or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.BillingMeterCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "billing_location, os_type" + }, + "check_name_availability" : { + "sync": { + "signature": "def check_name_availability(\n self,\n name, # type: str\n type, # type: Union[str, \"_models.CheckNameResourceTypes\"]\n is_fqdn=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Check if a resource name is available.\n\nDescription for Check if a resource name is available.\n\n:param name: Resource name to verify.\n:type name: str\n:param type: Resource type used for verification.\n:type type: str or ~azure.mgmt.web.v2020_06_01.models.CheckNameResourceTypes\n:param is_fqdn: Is fully qualified domain name.\n:type is_fqdn: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ResourceNameAvailability, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_06_01.models.ResourceNameAvailability\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def check_name_availability(\n self,\n name: str,\n type: Union[str, \"_models.CheckNameResourceTypes\"],\n is_fqdn: Optional[bool] = None,\n **kwargs\n) -\u003e \"_models.ResourceNameAvailability\":\n", + "doc": "\"\"\"Check if a resource name is available.\n\nDescription for Check if a resource name is available.\n\n:param name: Resource name to verify.\n:type name: str\n:param type: Resource type used for verification.\n:type type: str or ~azure.mgmt.web.v2020_06_01.models.CheckNameResourceTypes\n:param is_fqdn: Is fully qualified domain name.\n:type is_fqdn: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ResourceNameAvailability, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_06_01.models.ResourceNameAvailability\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "name, type, is_fqdn" + }, + "get_subscription_deployment_locations" : { + "sync": { + "signature": "def get_subscription_deployment_locations(\n self,\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Gets list of available geo regions plus ministamps.\n\nDescription for Gets list of available geo regions plus ministamps.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeploymentLocations, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_06_01.models.DeploymentLocations\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_subscription_deployment_locations(\n self,\n **kwargs\n) -\u003e \"_models.DeploymentLocations\":\n", + "doc": "\"\"\"Gets list of available geo regions plus ministamps.\n\nDescription for Gets list of available geo regions plus ministamps.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeploymentLocations, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_06_01.models.DeploymentLocations\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "" + }, + "list_geo_regions" : { + "sync": { + "signature": "def list_geo_regions(\n self,\n sku=None, # type: Optional[Union[str, \"_models.SkuName\"]]\n linux_workers_enabled=None, # type: Optional[bool]\n xenon_workers_enabled=None, # type: Optional[bool]\n linux_dynamic_workers_enabled=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Get a list of available geographical regions.\n\nDescription for Get a list of available geographical regions.\n\n:param sku: Name of SKU used to filter the regions.\n:type sku: str or ~azure.mgmt.web.v2020_06_01.models.SkuName\n:param linux_workers_enabled: Specify :code:`\u003ccode\u003etrue\u003c/code\u003e` if you want to filter to only\n regions that support Linux workers.\n:type linux_workers_enabled: bool\n:param xenon_workers_enabled: Specify :code:`\u003ccode\u003etrue\u003c/code\u003e` if you want to filter to only\n regions that support Xenon workers.\n:type xenon_workers_enabled: bool\n:param linux_dynamic_workers_enabled: Specify :code:`\u003ccode\u003etrue\u003c/code\u003e` if you want to filter\n to only regions that support Linux Consumption Workers.\n:type linux_dynamic_workers_enabled: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either GeoRegionCollection or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.GeoRegionCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": false, + "signature": "def list_geo_regions(\n self,\n sku: Optional[Union[str, \"_models.SkuName\"]] = None,\n linux_workers_enabled: Optional[bool] = None,\n xenon_workers_enabled: Optional[bool] = None,\n linux_dynamic_workers_enabled: Optional[bool] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.GeoRegionCollection\"]:\n", + "doc": "\"\"\"Get a list of available geographical regions.\n\nDescription for Get a list of available geographical regions.\n\n:param sku: Name of SKU used to filter the regions.\n:type sku: str or ~azure.mgmt.web.v2020_06_01.models.SkuName\n:param linux_workers_enabled: Specify :code:`\u003ccode\u003etrue\u003c/code\u003e` if you want to filter to only\n regions that support Linux workers.\n:type linux_workers_enabled: bool\n:param xenon_workers_enabled: Specify :code:`\u003ccode\u003etrue\u003c/code\u003e` if you want to filter to only\n regions that support Xenon workers.\n:type xenon_workers_enabled: bool\n:param linux_dynamic_workers_enabled: Specify :code:`\u003ccode\u003etrue\u003c/code\u003e` if you want to filter\n to only regions that support Linux Consumption Workers.\n:type linux_dynamic_workers_enabled: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either GeoRegionCollection or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.GeoRegionCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "sku, linux_workers_enabled, xenon_workers_enabled, linux_dynamic_workers_enabled" + }, + "list_site_identifiers_assigned_to_host_name" : { + "sync": { + "signature": "def list_site_identifiers_assigned_to_host_name(\n self,\n name_identifier, # type: \"_models.NameIdentifier\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"List all apps that are assigned to a hostname.\n\nDescription for List all apps that are assigned to a hostname.\n\n:param name_identifier: Hostname information.\n:type name_identifier: ~azure.mgmt.web.v2020_06_01.models.NameIdentifier\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either IdentifierCollection or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.IdentifierCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": false, + "signature": "def list_site_identifiers_assigned_to_host_name(\n self,\n name_identifier: \"_models.NameIdentifier\",\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.IdentifierCollection\"]:\n", + "doc": "\"\"\"List all apps that are assigned to a hostname.\n\nDescription for List all apps that are assigned to a hostname.\n\n:param name_identifier: Hostname information.\n:type name_identifier: ~azure.mgmt.web.v2020_06_01.models.NameIdentifier\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either IdentifierCollection or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.IdentifierCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "name_identifier" + }, + "list_premier_add_on_offers" : { + "sync": { + "signature": "def list_premier_add_on_offers(\n self,\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"List all premier add-on offers.\n\nDescription for List all premier add-on offers.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either PremierAddOnOfferCollection or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.PremierAddOnOfferCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": false, + "signature": "def list_premier_add_on_offers(\n self,\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.PremierAddOnOfferCollection\"]:\n", + "doc": "\"\"\"List all premier add-on offers.\n\nDescription for List all premier add-on offers.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either PremierAddOnOfferCollection or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.PremierAddOnOfferCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "" + }, + "list_skus" : { + "sync": { + "signature": "def list_skus(\n self,\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"List all SKUs.\n\nDescription for List all SKUs.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SkuInfos, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_06_01.models.SkuInfos\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def list_skus(\n self,\n **kwargs\n) -\u003e \"_models.SkuInfos\":\n", + "doc": "\"\"\"List all SKUs.\n\nDescription for List all SKUs.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SkuInfos, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_06_01.models.SkuInfos\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "" + }, + "verify_hosting_environment_vnet" : { + "sync": { + "signature": "def verify_hosting_environment_vnet(\n self,\n parameters, # type: \"_models.VnetParameters\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules.\n\nDescription for Verifies if this VNET is compatible with an App Service Environment by\nanalyzing the Network Security Group rules.\n\n:param parameters: VNET information.\n:type parameters: ~azure.mgmt.web.v2020_06_01.models.VnetParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VnetValidationFailureDetails, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_06_01.models.VnetValidationFailureDetails\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def verify_hosting_environment_vnet(\n self,\n parameters: \"_models.VnetParameters\",\n **kwargs\n) -\u003e \"_models.VnetValidationFailureDetails\":\n", + "doc": "\"\"\"Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules.\n\nDescription for Verifies if this VNET is compatible with an App Service Environment by\nanalyzing the Network Security Group rules.\n\n:param parameters: VNET information.\n:type parameters: ~azure.mgmt.web.v2020_06_01.models.VnetParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VnetValidationFailureDetails, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_06_01.models.VnetValidationFailureDetails\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "parameters" + }, + "move" : { + "sync": { + "signature": "def move(\n self,\n resource_group_name, # type: str\n move_resource_envelope, # type: \"_models.CsmMoveResourceEnvelope\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Move resources between resource groups.\n\nDescription for Move resources between resource groups.\n\n:param resource_group_name: Name of the resource group to which the resource belongs.\n:type resource_group_name: str\n:param move_resource_envelope: Object that represents the resource to move.\n:type move_resource_envelope: ~azure.mgmt.web.v2020_06_01.models.CsmMoveResourceEnvelope\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def move(\n self,\n resource_group_name: str,\n move_resource_envelope: \"_models.CsmMoveResourceEnvelope\",\n **kwargs\n) -\u003e None:\n", + "doc": "\"\"\"Move resources between resource groups.\n\nDescription for Move resources between resource groups.\n\n:param resource_group_name: Name of the resource group to which the resource belongs.\n:type resource_group_name: str\n:param move_resource_envelope: Object that represents the resource to move.\n:type move_resource_envelope: ~azure.mgmt.web.v2020_06_01.models.CsmMoveResourceEnvelope\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "resource_group_name, move_resource_envelope" + }, + "validate" : { + "sync": { + "signature": "def validate(\n self,\n resource_group_name, # type: str\n validate_request, # type: \"_models.ValidateRequest\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Validate if a resource can be created.\n\nDescription for Validate if a resource can be created.\n\n:param resource_group_name: Name of the resource group to which the resource belongs.\n:type resource_group_name: str\n:param validate_request: Request with the resources to validate.\n:type validate_request: ~azure.mgmt.web.v2020_06_01.models.ValidateRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ValidateResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_06_01.models.ValidateResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def validate(\n self,\n resource_group_name: str,\n validate_request: \"_models.ValidateRequest\",\n **kwargs\n) -\u003e \"_models.ValidateResponse\":\n", + "doc": "\"\"\"Validate if a resource can be created.\n\nDescription for Validate if a resource can be created.\n\n:param resource_group_name: Name of the resource group to which the resource belongs.\n:type resource_group_name: str\n:param validate_request: Request with the resources to validate.\n:type validate_request: ~azure.mgmt.web.v2020_06_01.models.ValidateRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ValidateResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_06_01.models.ValidateResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "resource_group_name, validate_request" + }, + "validate_move" : { + "sync": { + "signature": "def validate_move(\n self,\n resource_group_name, # type: str\n move_resource_envelope, # type: \"_models.CsmMoveResourceEnvelope\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Validate whether a resource can be moved.\n\nDescription for Validate whether a resource can be moved.\n\n:param resource_group_name: Name of the resource group to which the resource belongs.\n:type resource_group_name: str\n:param move_resource_envelope: Object that represents the resource to move.\n:type move_resource_envelope: ~azure.mgmt.web.v2020_06_01.models.CsmMoveResourceEnvelope\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def validate_move(\n self,\n resource_group_name: str,\n move_resource_envelope: \"_models.CsmMoveResourceEnvelope\",\n **kwargs\n) -\u003e None:\n", + "doc": "\"\"\"Validate whether a resource can be moved.\n\nDescription for Validate whether a resource can be moved.\n\n:param resource_group_name: Name of the resource group to which the resource belongs.\n:type resource_group_name: str\n:param move_resource_envelope: Object that represents the resource to move.\n:type move_resource_envelope: ~azure.mgmt.web.v2020_06_01.models.CsmMoveResourceEnvelope\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "resource_group_name, move_resource_envelope" + } + }, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Iterable\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"], \"azure.core.async_paging\": [\"AsyncItemPaged\", \"AsyncList\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}" +} \ No newline at end of file diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/_web_site_management_client.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/_web_site_management_client.py new file mode 100644 index 000000000000..54fa56f31e5e --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/_web_site_management_client.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import WebSiteManagementClientConfiguration +from .operations import AppServiceCertificateOrdersOperations +from .operations import CertificateRegistrationProviderOperations +from .operations import DomainsOperations +from .operations import TopLevelDomainsOperations +from .operations import DomainRegistrationProviderOperations +from .operations import CertificatesOperations +from .operations import DeletedWebAppsOperations +from .operations import DiagnosticsOperations +from .operations import ProviderOperations +from .operations import RecommendationsOperations +from .operations import WebSiteManagementClientOperationsMixin +from .operations import WebAppsOperations +from .operations import StaticSitesOperations +from .operations import AppServiceEnvironmentsOperations +from .operations import AppServicePlansOperations +from .operations import ResourceHealthMetadataOperations +from . import models + + +class WebSiteManagementClient(WebSiteManagementClientOperationsMixin): + """WebSite Management Client. + + :ivar app_service_certificate_orders: AppServiceCertificateOrdersOperations operations + :vartype app_service_certificate_orders: azure.mgmt.web.v2020_06_01.operations.AppServiceCertificateOrdersOperations + :ivar certificate_registration_provider: CertificateRegistrationProviderOperations operations + :vartype certificate_registration_provider: azure.mgmt.web.v2020_06_01.operations.CertificateRegistrationProviderOperations + :ivar domains: DomainsOperations operations + :vartype domains: azure.mgmt.web.v2020_06_01.operations.DomainsOperations + :ivar top_level_domains: TopLevelDomainsOperations operations + :vartype top_level_domains: azure.mgmt.web.v2020_06_01.operations.TopLevelDomainsOperations + :ivar domain_registration_provider: DomainRegistrationProviderOperations operations + :vartype domain_registration_provider: azure.mgmt.web.v2020_06_01.operations.DomainRegistrationProviderOperations + :ivar certificates: CertificatesOperations operations + :vartype certificates: azure.mgmt.web.v2020_06_01.operations.CertificatesOperations + :ivar deleted_web_apps: DeletedWebAppsOperations operations + :vartype deleted_web_apps: azure.mgmt.web.v2020_06_01.operations.DeletedWebAppsOperations + :ivar diagnostics: DiagnosticsOperations operations + :vartype diagnostics: azure.mgmt.web.v2020_06_01.operations.DiagnosticsOperations + :ivar provider: ProviderOperations operations + :vartype provider: azure.mgmt.web.v2020_06_01.operations.ProviderOperations + :ivar recommendations: RecommendationsOperations operations + :vartype recommendations: azure.mgmt.web.v2020_06_01.operations.RecommendationsOperations + :ivar web_apps: WebAppsOperations operations + :vartype web_apps: azure.mgmt.web.v2020_06_01.operations.WebAppsOperations + :ivar static_sites: StaticSitesOperations operations + :vartype static_sites: azure.mgmt.web.v2020_06_01.operations.StaticSitesOperations + :ivar app_service_environments: AppServiceEnvironmentsOperations operations + :vartype app_service_environments: azure.mgmt.web.v2020_06_01.operations.AppServiceEnvironmentsOperations + :ivar app_service_plans: AppServicePlansOperations operations + :vartype app_service_plans: azure.mgmt.web.v2020_06_01.operations.AppServicePlansOperations + :ivar resource_health_metadata: ResourceHealthMetadataOperations operations + :vartype resource_health_metadata: azure.mgmt.web.v2020_06_01.operations.ResourceHealthMetadataOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = WebSiteManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = 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._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.app_service_certificate_orders = AppServiceCertificateOrdersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.certificate_registration_provider = CertificateRegistrationProviderOperations( + self._client, self._config, self._serialize, self._deserialize) + self.domains = DomainsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.top_level_domains = TopLevelDomainsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.domain_registration_provider = DomainRegistrationProviderOperations( + self._client, self._config, self._serialize, self._deserialize) + self.certificates = CertificatesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.deleted_web_apps = DeletedWebAppsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.diagnostics = DiagnosticsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.provider = ProviderOperations( + self._client, self._config, self._serialize, self._deserialize) + self.recommendations = RecommendationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.web_apps = WebAppsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.static_sites = StaticSitesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.app_service_environments = AppServiceEnvironmentsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.app_service_plans = AppServicePlansOperations( + self._client, self._config, self._serialize, self._deserialize) + self.resource_health_metadata = ResourceHealthMetadataOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> WebSiteManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_04_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/__init__.py similarity index 81% rename from sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_04_01/_version.py rename to sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/__init__.py index 5c14e0d8303d..fc106a4f3d78 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_04_01/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/__init__.py @@ -6,4 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.42.0" +from ._web_site_management_client import WebSiteManagementClient +__all__ = ['WebSiteManagementClient'] diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/_configuration.py new file mode 100644 index 000000000000..59a16dc32a16 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class WebSiteManagementClientConfiguration(Configuration): + """Configuration for WebSiteManagementClient. + + 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. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(WebSiteManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-06-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-web/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.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.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/_web_site_management_client.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/_web_site_management_client.py new file mode 100644 index 000000000000..bfd495d2cbfd --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/_web_site_management_client.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import WebSiteManagementClientConfiguration +from .operations import AppServiceCertificateOrdersOperations +from .operations import CertificateRegistrationProviderOperations +from .operations import DomainsOperations +from .operations import TopLevelDomainsOperations +from .operations import DomainRegistrationProviderOperations +from .operations import CertificatesOperations +from .operations import DeletedWebAppsOperations +from .operations import DiagnosticsOperations +from .operations import ProviderOperations +from .operations import RecommendationsOperations +from .operations import WebSiteManagementClientOperationsMixin +from .operations import WebAppsOperations +from .operations import StaticSitesOperations +from .operations import AppServiceEnvironmentsOperations +from .operations import AppServicePlansOperations +from .operations import ResourceHealthMetadataOperations +from .. import models + + +class WebSiteManagementClient(WebSiteManagementClientOperationsMixin): + """WebSite Management Client. + + :ivar app_service_certificate_orders: AppServiceCertificateOrdersOperations operations + :vartype app_service_certificate_orders: azure.mgmt.web.v2020_06_01.aio.operations.AppServiceCertificateOrdersOperations + :ivar certificate_registration_provider: CertificateRegistrationProviderOperations operations + :vartype certificate_registration_provider: azure.mgmt.web.v2020_06_01.aio.operations.CertificateRegistrationProviderOperations + :ivar domains: DomainsOperations operations + :vartype domains: azure.mgmt.web.v2020_06_01.aio.operations.DomainsOperations + :ivar top_level_domains: TopLevelDomainsOperations operations + :vartype top_level_domains: azure.mgmt.web.v2020_06_01.aio.operations.TopLevelDomainsOperations + :ivar domain_registration_provider: DomainRegistrationProviderOperations operations + :vartype domain_registration_provider: azure.mgmt.web.v2020_06_01.aio.operations.DomainRegistrationProviderOperations + :ivar certificates: CertificatesOperations operations + :vartype certificates: azure.mgmt.web.v2020_06_01.aio.operations.CertificatesOperations + :ivar deleted_web_apps: DeletedWebAppsOperations operations + :vartype deleted_web_apps: azure.mgmt.web.v2020_06_01.aio.operations.DeletedWebAppsOperations + :ivar diagnostics: DiagnosticsOperations operations + :vartype diagnostics: azure.mgmt.web.v2020_06_01.aio.operations.DiagnosticsOperations + :ivar provider: ProviderOperations operations + :vartype provider: azure.mgmt.web.v2020_06_01.aio.operations.ProviderOperations + :ivar recommendations: RecommendationsOperations operations + :vartype recommendations: azure.mgmt.web.v2020_06_01.aio.operations.RecommendationsOperations + :ivar web_apps: WebAppsOperations operations + :vartype web_apps: azure.mgmt.web.v2020_06_01.aio.operations.WebAppsOperations + :ivar static_sites: StaticSitesOperations operations + :vartype static_sites: azure.mgmt.web.v2020_06_01.aio.operations.StaticSitesOperations + :ivar app_service_environments: AppServiceEnvironmentsOperations operations + :vartype app_service_environments: azure.mgmt.web.v2020_06_01.aio.operations.AppServiceEnvironmentsOperations + :ivar app_service_plans: AppServicePlansOperations operations + :vartype app_service_plans: azure.mgmt.web.v2020_06_01.aio.operations.AppServicePlansOperations + :ivar resource_health_metadata: ResourceHealthMetadataOperations operations + :vartype resource_health_metadata: azure.mgmt.web.v2020_06_01.aio.operations.ResourceHealthMetadataOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = WebSiteManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = 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._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.app_service_certificate_orders = AppServiceCertificateOrdersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.certificate_registration_provider = CertificateRegistrationProviderOperations( + self._client, self._config, self._serialize, self._deserialize) + self.domains = DomainsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.top_level_domains = TopLevelDomainsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.domain_registration_provider = DomainRegistrationProviderOperations( + self._client, self._config, self._serialize, self._deserialize) + self.certificates = CertificatesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.deleted_web_apps = DeletedWebAppsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.diagnostics = DiagnosticsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.provider = ProviderOperations( + self._client, self._config, self._serialize, self._deserialize) + self.recommendations = RecommendationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.web_apps = WebAppsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.static_sites = StaticSitesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.app_service_environments = AppServiceEnvironmentsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.app_service_plans = AppServicePlansOperations( + self._client, self._config, self._serialize, self._deserialize) + self.resource_health_metadata = ResourceHealthMetadataOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "WebSiteManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/__init__.py new file mode 100644 index 000000000000..8f414125deed --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/__init__.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._app_service_certificate_orders_operations import AppServiceCertificateOrdersOperations +from ._certificate_registration_provider_operations import CertificateRegistrationProviderOperations +from ._domains_operations import DomainsOperations +from ._top_level_domains_operations import TopLevelDomainsOperations +from ._domain_registration_provider_operations import DomainRegistrationProviderOperations +from ._certificates_operations import CertificatesOperations +from ._deleted_web_apps_operations import DeletedWebAppsOperations +from ._diagnostics_operations import DiagnosticsOperations +from ._provider_operations import ProviderOperations +from ._recommendations_operations import RecommendationsOperations +from ._web_site_management_client_operations import WebSiteManagementClientOperationsMixin +from ._web_apps_operations import WebAppsOperations +from ._static_sites_operations import StaticSitesOperations +from ._app_service_environments_operations import AppServiceEnvironmentsOperations +from ._app_service_plans_operations import AppServicePlansOperations +from ._resource_health_metadata_operations import ResourceHealthMetadataOperations + +__all__ = [ + 'AppServiceCertificateOrdersOperations', + 'CertificateRegistrationProviderOperations', + 'DomainsOperations', + 'TopLevelDomainsOperations', + 'DomainRegistrationProviderOperations', + 'CertificatesOperations', + 'DeletedWebAppsOperations', + 'DiagnosticsOperations', + 'ProviderOperations', + 'RecommendationsOperations', + 'WebSiteManagementClientOperationsMixin', + 'WebAppsOperations', + 'StaticSitesOperations', + 'AppServiceEnvironmentsOperations', + 'AppServicePlansOperations', + 'ResourceHealthMetadataOperations', +] diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_app_service_certificate_orders_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_app_service_certificate_orders_operations.py new file mode 100644 index 000000000000..2a81d852adf7 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_app_service_certificate_orders_operations.py @@ -0,0 +1,1491 @@ +# 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, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AppServiceCertificateOrdersOperations: + """AppServiceCertificateOrdersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.AppServiceCertificateOrderCollection"]: + """List all certificate orders in a subscription. + + Description for List all certificate orders in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceCertificateOrderCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrderCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrderCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateOrderCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/certificateOrders'} # type: ignore + + async def validate_purchase_information( + self, + app_service_certificate_order: "_models.AppServiceCertificateOrder", + **kwargs + ) -> None: + """Validate information for a certificate order. + + Description for Validate information for a certificate order. + + :param app_service_certificate_order: Information for a certificate order. + :type app_service_certificate_order: ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrder + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_purchase_information.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_service_certificate_order, 'AppServiceCertificateOrder') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + validate_purchase_information.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/validateCertificateRegistrationInformation'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.AppServiceCertificateOrderCollection"]: + """Get certificate orders in a resource group. + + Description for Get certificate orders in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 AppServiceCertificateOrderCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrderCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrderCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateOrderCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.CertificateRegistration/certificateOrders'} # type: ignore + + async def get( + self, + resource_group_name: str, + certificate_order_name: str, + **kwargs + ) -> "_models.AppServiceCertificateOrder": + """Get a certificate order. + + Description for Get a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order.. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateOrder, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrder + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + certificate_order_name: str, + certificate_distinguished_name: "_models.AppServiceCertificateOrder", + **kwargs + ) -> "_models.AppServiceCertificateOrder": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_distinguished_name, 'AppServiceCertificateOrder') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + certificate_order_name: str, + certificate_distinguished_name: "_models.AppServiceCertificateOrder", + **kwargs + ) -> AsyncLROPoller["_models.AppServiceCertificateOrder"]: + """Create or update a certificate purchase order. + + Description for Create or update a certificate purchase order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param certificate_distinguished_name: Distinguished name to use for the certificate order. + :type certificate_distinguished_name: ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrder + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 AppServiceCertificateOrder or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrder] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + certificate_order_name=certificate_order_name, + certificate_distinguished_name=certificate_distinguished_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + certificate_order_name: str, + **kwargs + ) -> None: + """Delete an existing certificate order. + + Description for Delete an existing certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + certificate_order_name: str, + certificate_distinguished_name: "_models.AppServiceCertificateOrderPatchResource", + **kwargs + ) -> "_models.AppServiceCertificateOrder": + """Create or update a certificate purchase order. + + Description for Create or update a certificate purchase order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param certificate_distinguished_name: Distinguished name to use for the certificate order. + :type certificate_distinguished_name: ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrderPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateOrder, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrder + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_distinguished_name, 'AppServiceCertificateOrderPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + def list_certificates( + self, + resource_group_name: str, + certificate_order_name: str, + **kwargs + ) -> AsyncIterable["_models.AppServiceCertificateCollection"]: + """List all certificates associated with a certificate order. + + Description for List all certificates associated with a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceCertificateCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_certificates.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates'} # type: ignore + + async def get_certificate( + self, + resource_group_name: str, + certificate_order_name: str, + name: str, + **kwargs + ) -> "_models.AppServiceCertificateResource": + """Get the certificate associated with a certificate order. + + Description for Get the certificate associated with a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + async def _create_or_update_certificate_initial( + self, + resource_group_name: str, + certificate_order_name: str, + name: str, + key_vault_certificate: "_models.AppServiceCertificateResource", + **kwargs + ) -> "_models.AppServiceCertificateResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_certificate_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key_vault_certificate, 'AppServiceCertificateResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_certificate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + async def begin_create_or_update_certificate( + self, + resource_group_name: str, + certificate_order_name: str, + name: str, + key_vault_certificate: "_models.AppServiceCertificateResource", + **kwargs + ) -> AsyncLROPoller["_models.AppServiceCertificateResource"]: + """Creates or updates a certificate and associates with key vault secret. + + Description for Creates or updates a certificate and associates with key vault secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :param key_vault_certificate: Key vault certificate resource Id. + :type key_vault_certificate: ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 AppServiceCertificateResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_certificate_initial( + resource_group_name=resource_group_name, + certificate_order_name=certificate_order_name, + name=name, + key_vault_certificate=key_vault_certificate, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + async def delete_certificate( + self, + resource_group_name: str, + certificate_order_name: str, + name: str, + **kwargs + ) -> None: + """Delete the certificate associated with a certificate order. + + Description for Delete the certificate associated with a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + async def update_certificate( + self, + resource_group_name: str, + certificate_order_name: str, + name: str, + key_vault_certificate: "_models.AppServiceCertificatePatchResource", + **kwargs + ) -> "_models.AppServiceCertificateResource": + """Creates or updates a certificate and associates with key vault secret. + + Description for Creates or updates a certificate and associates with key vault secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :param key_vault_certificate: Key vault certificate resource Id. + :type key_vault_certificate: ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificatePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key_vault_certificate, 'AppServiceCertificatePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + async def reissue( + self, + resource_group_name: str, + certificate_order_name: str, + reissue_certificate_order_request: "_models.ReissueCertificateOrderRequest", + **kwargs + ) -> None: + """Reissue an existing certificate order. + + Description for Reissue an existing certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param reissue_certificate_order_request: Parameters for the reissue. + :type reissue_certificate_order_request: ~azure.mgmt.web.v2020_06_01.models.ReissueCertificateOrderRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.reissue.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(reissue_certificate_order_request, 'ReissueCertificateOrderRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reissue.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/reissue'} # type: ignore + + async def renew( + self, + resource_group_name: str, + certificate_order_name: str, + renew_certificate_order_request: "_models.RenewCertificateOrderRequest", + **kwargs + ) -> None: + """Renew an existing certificate order. + + Description for Renew an existing certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param renew_certificate_order_request: Renew parameters. + :type renew_certificate_order_request: ~azure.mgmt.web.v2020_06_01.models.RenewCertificateOrderRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.renew.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(renew_certificate_order_request, 'RenewCertificateOrderRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + renew.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/renew'} # type: ignore + + async def resend_email( + self, + resource_group_name: str, + certificate_order_name: str, + **kwargs + ) -> None: + """Resend certificate email. + + Description for Resend certificate email. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.resend_email.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + resend_email.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendEmail'} # type: ignore + + async def resend_request_emails( + self, + resource_group_name: str, + certificate_order_name: str, + name_identifier: "_models.NameIdentifier", + **kwargs + ) -> None: + """Verify domain ownership for this certificate order. + + Description for Verify domain ownership for this certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name_identifier: Email address. + :type name_identifier: ~azure.mgmt.web.v2020_06_01.models.NameIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.resend_request_emails.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(name_identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + resend_request_emails.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendRequestEmails'} # type: ignore + + async def retrieve_site_seal( + self, + resource_group_name: str, + certificate_order_name: str, + site_seal_request: "_models.SiteSealRequest", + **kwargs + ) -> "_models.SiteSeal": + """Verify domain ownership for this certificate order. + + Description for Verify domain ownership for this certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param site_seal_request: Site seal request. + :type site_seal_request: ~azure.mgmt.web.v2020_06_01.models.SiteSealRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSeal, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteSeal + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSeal"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.retrieve_site_seal.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_seal_request, 'SiteSealRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteSeal', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_site_seal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/retrieveSiteSeal'} # type: ignore + + async def verify_domain_ownership( + self, + resource_group_name: str, + certificate_order_name: str, + **kwargs + ) -> None: + """Verify domain ownership for this certificate order. + + Description for Verify domain ownership for this certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.verify_domain_ownership.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + verify_domain_ownership.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/verifyDomainOwnership'} # type: ignore + + async def retrieve_certificate_actions( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> List["_models.CertificateOrderAction"]: + """Retrieve the list of certificate actions. + + Description for Retrieve the list of certificate actions. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate order. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of CertificateOrderAction, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.CertificateOrderAction] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.CertificateOrderAction"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.retrieve_certificate_actions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[CertificateOrderAction]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_certificate_actions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveCertificateActions'} # type: ignore + + async def retrieve_certificate_email_history( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> List["_models.CertificateEmail"]: + """Retrieve email history. + + Description for Retrieve email history. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate order. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of CertificateEmail, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.CertificateEmail] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.CertificateEmail"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.retrieve_certificate_email_history.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[CertificateEmail]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_certificate_email_history.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveEmailHistory'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_app_service_environments_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_app_service_environments_operations.py new file mode 100644 index 000000000000..2fc42e2c999f --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_app_service_environments_operations.py @@ -0,0 +1,3246 @@ +# 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, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AppServiceEnvironmentsOperations: + """AppServiceEnvironmentsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.AppServiceEnvironmentCollection"]: + """Get all App Service Environments for a subscription. + + Description for Get all App Service Environments for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceEnvironmentCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.AppServiceEnvironmentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceEnvironmentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/hostingEnvironments'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.AppServiceEnvironmentCollection"]: + """Get all App Service Environments in a resource group. + + Description for Get all App Service Environments in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 AppServiceEnvironmentCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.AppServiceEnvironmentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceEnvironmentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.Web/hostingEnvironments'} # type: ignore + + async def get( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.AppServiceEnvironmentResource": + """Get the properties of an App Service Environment. + + Description for Get the properties of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceEnvironmentResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AppServiceEnvironmentResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + name: str, + hosting_environment_envelope: "_models.AppServiceEnvironmentResource", + **kwargs + ) -> "_models.AppServiceEnvironmentResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(hosting_environment_envelope, 'AppServiceEnvironmentResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + name: str, + hosting_environment_envelope: "_models.AppServiceEnvironmentResource", + **kwargs + ) -> AsyncLROPoller["_models.AppServiceEnvironmentResource"]: + """Create or update an App Service Environment. + + Description for Create or update an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param hosting_environment_envelope: Configuration details of the App Service Environment. + :type hosting_environment_envelope: ~azure.mgmt.web.v2020_06_01.models.AppServiceEnvironmentResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 AppServiceEnvironmentResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.AppServiceEnvironmentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + hosting_environment_envelope=hosting_environment_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + name: str, + force_delete: Optional[bool] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if force_delete is not None: + query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **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(_models.DefaultErrorResponse, 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.Web/hostingEnvironments/{name}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + name: str, + force_delete: Optional[bool] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Delete an App Service Environment. + + Description for Delete an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param force_delete: Specify :code:`true` to force the deletion even if the App + Service Environment contains resources. The default is :code:`false`. + :type force_delete: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + name=name, + force_delete=force_delete, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + async def update( + self, + resource_group_name: str, + name: str, + hosting_environment_envelope: "_models.AppServiceEnvironmentPatchResource", + **kwargs + ) -> "_models.AppServiceEnvironmentResource": + """Create or update an App Service Environment. + + Description for Create or update an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param hosting_environment_envelope: Configuration details of the App Service Environment. + :type hosting_environment_envelope: ~azure.mgmt.web.v2020_06_01.models.AppServiceEnvironmentPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceEnvironmentResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AppServiceEnvironmentResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(hosting_environment_envelope, 'AppServiceEnvironmentPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + def list_capacities( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.StampCapacityCollection"]: + """Get the used, available, and total worker capacity an App Service Environment. + + Description for Get the used, available, and total worker capacity an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StampCapacityCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.StampCapacityCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StampCapacityCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_capacities.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StampCapacityCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_capacities.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/compute'} # type: ignore + + async def get_vip_info( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.AddressResponse": + """Get IP addresses assigned to an App Service Environment. + + Description for Get IP addresses assigned to an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AddressResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AddressResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_vip_info.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AddressResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vip_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/virtualip'} # type: ignore + + async def _change_vnet_initial( + self, + resource_group_name: str, + name: str, + vnet_info: "_models.VirtualNetworkProfile", + **kwargs + ) -> "_models.WebAppCollection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._change_vnet_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vnet_info, 'VirtualNetworkProfile') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _change_vnet_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork'} # type: ignore + + async def begin_change_vnet( + self, + resource_group_name: str, + name: str, + vnet_info: "_models.VirtualNetworkProfile", + **kwargs + ) -> AsyncLROPoller[AsyncItemPaged["_models.WebAppCollection"]]: + """Move an App Service Environment to a different VNET. + + Description for Move an App Service Environment to a different VNET. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param vnet_info: Details for the new virtual network. + :type vnet_info: ~azure.mgmt.web.v2020_06_01.models.VirtualNetworkProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 an iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.WebAppCollection]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.change_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vnet_info, 'VirtualNetworkProfile') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vnet_info, 'VirtualNetworkProfile') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._change_vnet_initial( + resource_group_name=resource_group_name, + name=name, + vnet_info=vnet_info, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + async def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return await get_next(next_link) + + return AsyncItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_change_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork'} # type: ignore + + async def list_diagnostics( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> List["_models.HostingEnvironmentDiagnostics"]: + """Get diagnostic information for an App Service Environment. + + Description for Get diagnostic information for an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of HostingEnvironmentDiagnostics, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentDiagnostics] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.HostingEnvironmentDiagnostics"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_diagnostics.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[HostingEnvironmentDiagnostics]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_diagnostics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics'} # type: ignore + + async def get_diagnostics_item( + self, + resource_group_name: str, + name: str, + diagnostics_name: str, + **kwargs + ) -> "_models.HostingEnvironmentDiagnostics": + """Get a diagnostics item for an App Service Environment. + + Description for Get a diagnostics item for an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param diagnostics_name: Name of the diagnostics item. + :type diagnostics_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostingEnvironmentDiagnostics, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentDiagnostics + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostingEnvironmentDiagnostics"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostics_item.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'diagnosticsName': self._serialize.url("diagnostics_name", diagnostics_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostingEnvironmentDiagnostics', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostics_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics/{diagnosticsName}'} # type: ignore + + def get_inbound_network_dependencies_endpoints( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.InboundEnvironmentEndpointCollection"]: + """Get the network endpoints of all inbound dependencies of an App Service Environment. + + Description for Get the network endpoints of all inbound dependencies of an App Service + Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either InboundEnvironmentEndpointCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.InboundEnvironmentEndpointCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundEnvironmentEndpointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_inbound_network_dependencies_endpoints.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('InboundEnvironmentEndpointCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_inbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/inboundNetworkDependenciesEndpoints'} # type: ignore + + def list_multi_role_pools( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.WorkerPoolCollection"]: + """Get all multi-role pools. + + Description for Get all multi-role pools. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkerPoolCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.WorkerPoolCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_pools.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkerPoolCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_multi_role_pools.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools'} # type: ignore + + async def get_multi_role_pool( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.WorkerPoolResource": + """Get properties of a multi-role pool. + + Description for Get properties of a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_multi_role_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_multi_role_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + async def _create_or_update_multi_role_pool_initial( + self, + resource_group_name: str, + name: str, + multi_role_pool_envelope: "_models.WorkerPoolResource", + **kwargs + ) -> "_models.WorkerPoolResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_multi_role_pool_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(multi_role_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_multi_role_pool_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + async def begin_create_or_update_multi_role_pool( + self, + resource_group_name: str, + name: str, + multi_role_pool_envelope: "_models.WorkerPoolResource", + **kwargs + ) -> AsyncLROPoller["_models.WorkerPoolResource"]: + """Create or update a multi-role pool. + + Description for Create or update a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param multi_role_pool_envelope: Properties of the multi-role pool. + :type multi_role_pool_envelope: ~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 WorkerPoolResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_multi_role_pool_initial( + resource_group_name=resource_group_name, + name=name, + multi_role_pool_envelope=multi_role_pool_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_multi_role_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + async def update_multi_role_pool( + self, + resource_group_name: str, + name: str, + multi_role_pool_envelope: "_models.WorkerPoolResource", + **kwargs + ) -> "_models.WorkerPoolResource": + """Create or update a multi-role pool. + + Description for Create or update a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param multi_role_pool_envelope: Properties of the multi-role pool. + :type multi_role_pool_envelope: ~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_multi_role_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(multi_role_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_multi_role_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + def list_multi_role_pool_instance_metric_definitions( + self, + resource_group_name: str, + name: str, + instance: str, + **kwargs + ) -> AsyncIterable["_models.ResourceMetricDefinitionCollection"]: + """Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. + + Description for Get metric definitions for a specific instance of a multi-role pool of an App + Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param instance: Name of the instance in the multi-role pool. + :type instance: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_pool_instance_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instance': self._serialize.url("instance", instance, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_multi_role_pool_instance_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions'} # type: ignore + + def list_multi_role_metric_definitions( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.ResourceMetricDefinitionCollection"]: + """Get metric definitions for a multi-role pool of an App Service Environment. + + Description for Get metric definitions for a multi-role pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_multi_role_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions'} # type: ignore + + def list_multi_role_pool_skus( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.SkuInfoCollection"]: + """Get available SKUs for scaling a multi-role pool. + + Description for Get available SKUs for scaling a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.SkuInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_pool_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SkuInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_multi_role_pool_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/skus'} # type: ignore + + def list_multi_role_usages( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.UsageCollection"]: + """Get usage metrics for a multi-role pool of an App Service Environment. + + Description for Get usage metrics for a multi-role pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsageCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.UsageCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('UsageCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_multi_role_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/usages'} # type: ignore + + async def list_operations( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> List["_models.Operation"]: + """List all currently running operations on the App Service Environment. + + Description for List all currently running operations on the App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Operation, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.Operation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Operation"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[Operation]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_operations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations'} # type: ignore + + def get_outbound_network_dependencies_endpoints( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.OutboundEnvironmentEndpointCollection"]: + """Get the network endpoints of all outbound dependencies of an App Service Environment. + + Description for Get the network endpoints of all outbound dependencies of an App Service + Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.OutboundEnvironmentEndpointCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_outbound_network_dependencies_endpoints.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OutboundEnvironmentEndpointCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/outboundNetworkDependenciesEndpoints'} # type: ignore + + async def reboot( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Reboot all machines in an App Service Environment. + + Description for Reboot all machines in an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.reboot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reboot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/reboot'} # type: ignore + + async def _resume_initial( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.WebAppCollection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._resume_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _resume_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume'} # type: ignore + + async def begin_resume( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncLROPoller[AsyncItemPaged["_models.WebAppCollection"]]: + """Resume an App Service Environment. + + Description for Resume an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type 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: True for ARMPolling, False for no polling, or a + polling object for 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 an iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.WebAppCollection]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.resume.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._resume_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + async def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return await get_next(next_link) + + return AsyncItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume'} # type: ignore + + def list_app_service_plans( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.AppServicePlanCollection"]: + """Get all App Service plans in an App Service Environment. + + Description for Get all App Service plans in an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServicePlanCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.AppServicePlanCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlanCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_app_service_plans.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServicePlanCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_app_service_plans.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/serverfarms'} # type: ignore + + def list_web_apps( + self, + resource_group_name: str, + name: str, + properties_to_include: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.WebAppCollection"]: + """Get all apps in an App Service Environment. + + Description for Get all apps in an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param properties_to_include: Comma separated list of app properties to include. + :type properties_to_include: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_apps.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if properties_to_include is not None: + query_parameters['propertiesToInclude'] = self._serialize.query("properties_to_include", properties_to_include, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_web_apps.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/sites'} # type: ignore + + async def _suspend_initial( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.WebAppCollection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._suspend_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _suspend_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend'} # type: ignore + + async def begin_suspend( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncLROPoller[AsyncItemPaged["_models.WebAppCollection"]]: + """Suspend an App Service Environment. + + Description for Suspend an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type 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: True for ARMPolling, False for no polling, or a + polling object for 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 an iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.WebAppCollection]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.suspend.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._suspend_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + async def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return await get_next(next_link) + + return AsyncItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_suspend.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend'} # type: ignore + + def list_usages( + self, + resource_group_name: str, + name: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.CsmUsageQuotaCollection"]: + """Get global usage metrics of an App Service Environment. + + Description for Get global usage metrics of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq + 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages'} # type: ignore + + def list_worker_pools( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.WorkerPoolCollection"]: + """Get all worker pools of an App Service Environment. + + Description for Get all worker pools of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkerPoolCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.WorkerPoolCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_worker_pools.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkerPoolCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_worker_pools.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools'} # type: ignore + + async def get_worker_pool( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + **kwargs + ) -> "_models.WorkerPoolResource": + """Get properties of a worker pool. + + Description for Get properties of a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_worker_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_worker_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + async def _create_or_update_worker_pool_initial( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + worker_pool_envelope: "_models.WorkerPoolResource", + **kwargs + ) -> "_models.WorkerPoolResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_worker_pool_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(worker_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_worker_pool_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + async def begin_create_or_update_worker_pool( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + worker_pool_envelope: "_models.WorkerPoolResource", + **kwargs + ) -> AsyncLROPoller["_models.WorkerPoolResource"]: + """Create or update a worker pool. + + Description for Create or update a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :param worker_pool_envelope: Properties of the worker pool. + :type worker_pool_envelope: ~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 WorkerPoolResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_worker_pool_initial( + resource_group_name=resource_group_name, + name=name, + worker_pool_name=worker_pool_name, + worker_pool_envelope=worker_pool_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_worker_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + async def update_worker_pool( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + worker_pool_envelope: "_models.WorkerPoolResource", + **kwargs + ) -> "_models.WorkerPoolResource": + """Create or update a worker pool. + + Description for Create or update a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :param worker_pool_envelope: Properties of the worker pool. + :type worker_pool_envelope: ~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_worker_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(worker_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_worker_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + def list_worker_pool_instance_metric_definitions( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + instance: str, + **kwargs + ) -> AsyncIterable["_models.ResourceMetricDefinitionCollection"]: + """Get metric definitions for a specific instance of a worker pool of an App Service Environment. + + Description for Get metric definitions for a specific instance of a worker pool of an App + Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :param instance: Name of the instance in the worker pool. + :type instance: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_worker_pool_instance_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'instance': self._serialize.url("instance", instance, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_worker_pool_instance_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metricdefinitions'} # type: ignore + + def list_web_worker_metric_definitions( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + **kwargs + ) -> AsyncIterable["_models.ResourceMetricDefinitionCollection"]: + """Get metric definitions for a worker pool of an App Service Environment. + + Description for Get metric definitions for a worker pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_worker_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_web_worker_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metricdefinitions'} # type: ignore + + def list_worker_pool_skus( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + **kwargs + ) -> AsyncIterable["_models.SkuInfoCollection"]: + """Get available SKUs for scaling a worker pool. + + Description for Get available SKUs for scaling a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.SkuInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_worker_pool_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SkuInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_worker_pool_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/skus'} # type: ignore + + def list_web_worker_usages( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + **kwargs + ) -> AsyncIterable["_models.UsageCollection"]: + """Get usage metrics for a worker pool of an App Service Environment. + + Description for Get usage metrics for a worker pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsageCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.UsageCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_worker_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('UsageCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_web_worker_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/usages'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_app_service_plans_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_app_service_plans_operations.py new file mode 100644 index 000000000000..839b52cb3628 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_app_service_plans_operations.py @@ -0,0 +1,2007 @@ +# 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, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AppServicePlansOperations: + """AppServicePlansOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + detailed: Optional[bool] = None, + **kwargs + ) -> AsyncIterable["_models.AppServicePlanCollection"]: + """Get all App Service plans for a subscription. + + Description for Get all App Service plans for a subscription. + + :param detailed: Specify :code:`true` to return all App Service plan properties. + The default is :code:`false`, which returns a subset of the properties. + Retrieval of all properties may increase the API latency. + :type detailed: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServicePlanCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.AppServicePlanCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlanCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if detailed is not None: + query_parameters['detailed'] = self._serialize.query("detailed", detailed, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServicePlanCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/serverfarms'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.AppServicePlanCollection"]: + """Get all App Service plans in a resource group. + + Description for Get all App Service plans in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 AppServicePlanCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.AppServicePlanCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlanCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServicePlanCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.Web/serverfarms'} # type: ignore + + async def get( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> Optional["_models.AppServicePlan"]: + """Get an App Service plan. + + Description for Get an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServicePlan, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AppServicePlan or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AppServicePlan"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + name: str, + app_service_plan: "_models.AppServicePlan", + **kwargs + ) -> "_models.AppServicePlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlan"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_service_plan, 'AppServicePlan') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + name: str, + app_service_plan: "_models.AppServicePlan", + **kwargs + ) -> AsyncLROPoller["_models.AppServicePlan"]: + """Creates or updates an App Service Plan. + + Description for Creates or updates an App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param app_service_plan: Details of the App Service plan. + :type app_service_plan: ~azure.mgmt.web.v2020_06_01.models.AppServicePlan + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 AppServicePlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.AppServicePlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlan"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + app_service_plan=app_service_plan, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Delete an App Service plan. + + Description for Delete an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + async def update( + self, + resource_group_name: str, + name: str, + app_service_plan: "_models.AppServicePlanPatchResource", + **kwargs + ) -> "_models.AppServicePlan": + """Creates or updates an App Service Plan. + + Description for Creates or updates an App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param app_service_plan: Details of the App Service plan. + :type app_service_plan: ~azure.mgmt.web.v2020_06_01.models.AppServicePlanPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServicePlan, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AppServicePlan + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlan"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_service_plan, 'AppServicePlanPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + async def list_capabilities( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> List["_models.Capability"]: + """List all capabilities of an App Service plan. + + Description for List all capabilities of an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Capability, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.Capability] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Capability"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_capabilities.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[Capability]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_capabilities.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/capabilities'} # type: ignore + + async def get_hybrid_connection( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + **kwargs + ) -> "_models.HybridConnection": + """Retrieve a Hybrid Connection in use in an App Service plan. + + Description for Retrieve a Hybrid Connection in use in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: Name of the Service Bus namespace. + :type namespace_name: str + :param relay_name: Name of the Service Bus relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def delete_hybrid_connection( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + **kwargs + ) -> None: + """Delete a Hybrid Connection in use in an App Service plan. + + Description for Delete a Hybrid Connection in use in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: Name of the Service Bus namespace. + :type namespace_name: str + :param relay_name: Name of the Service Bus relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def list_hybrid_connection_keys( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + **kwargs + ) -> "_models.HybridConnectionKey": + """Get the send key name and value of a Hybrid Connection. + + Description for Get the send key name and value of a Hybrid Connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: The name of the Service Bus namespace. + :type namespace_name: str + :param relay_name: The name of the Service Bus relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnectionKey, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnectionKey + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnectionKey"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_hybrid_connection_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnectionKey', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_hybrid_connection_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'} # type: ignore + + def list_web_apps_by_hybrid_connection( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + **kwargs + ) -> AsyncIterable["_models.ResourceCollection"]: + """Get all apps that use a Hybrid Connection in an App Service Plan. + + Description for Get all apps that use a Hybrid Connection in an App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: Name of the Hybrid Connection namespace. + :type namespace_name: str + :param relay_name: Name of the Hybrid Connection relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_apps_by_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_web_apps_by_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/sites'} # type: ignore + + async def get_hybrid_connection_plan_limit( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.HybridConnectionLimits": + """Get the maximum number of Hybrid Connections allowed in an App Service plan. + + Description for Get the maximum number of Hybrid Connections allowed in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnectionLimits, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnectionLimits + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnectionLimits"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection_plan_limit.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnectionLimits', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection_plan_limit.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionPlanLimits/limit'} # type: ignore + + def list_hybrid_connections( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.HybridConnectionCollection"]: + """Retrieve all Hybrid Connections in use in an App Service plan. + + Description for Retrieve all Hybrid Connections in use in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HybridConnectionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.HybridConnectionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnectionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_hybrid_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('HybridConnectionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_hybrid_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionRelays'} # type: ignore + + async def restart_web_apps( + self, + resource_group_name: str, + name: str, + soft_restart: Optional[bool] = None, + **kwargs + ) -> None: + """Restart all apps in an App Service plan. + + Description for Restart all apps in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param soft_restart: Specify :code:`true` to perform a soft restart, applies the + configuration settings and restarts the apps if necessary. The default is + :code:`false`, which always restarts and reprovisions the apps. + :type soft_restart: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.restart_web_apps.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if soft_restart is not None: + query_parameters['softRestart'] = self._serialize.query("soft_restart", soft_restart, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restart_web_apps.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/restartSites'} # type: ignore + + def list_web_apps( + self, + resource_group_name: str, + name: str, + skip_token: Optional[str] = None, + filter: Optional[str] = None, + top: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.WebAppCollection"]: + """Get all apps associated with an App Service plan. + + Description for Get all apps associated with an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param skip_token: Skip to a web app in the list of webapps associated with app service plan. + If specified, the resulting list will contain web apps starting from (including) the skipToken. + Otherwise, the resulting list contains web apps from the start of the list. + :type skip_token: str + :param filter: Supported filter: $filter=state eq running. Returns only web apps that are + currently running. + :type filter: str + :param top: List page size. If specified, results are paged. + :type top: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_apps.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_web_apps.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites'} # type: ignore + + async def get_server_farm_skus( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> object: + """Gets all selectable SKUs for a given App Service Plan. + + Description for Gets all selectable SKUs for a given App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of App Service Plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: object, or the result of cls(response) + :rtype: object + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[object] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_server_farm_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_server_farm_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/skus'} # type: ignore + + def list_usages( + self, + resource_group_name: str, + name: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.CsmUsageQuotaCollection"]: + """Gets server farm usage information. + + Description for Gets server farm usage information. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of App Service Plan. + :type name: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/usages'} # type: ignore + + async def list_vnets( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> List["_models.VnetInfo"]: + """Get all Virtual Networks associated with an App Service plan. + + Description for Get all Virtual Networks associated with an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetInfo, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.VnetInfo] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_vnets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetInfo]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_vnets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections'} # type: ignore + + async def get_vnet_from_server_farm( + self, + resource_group_name: str, + name: str, + vnet_name: str, + **kwargs + ) -> Optional["_models.VnetInfo"]: + """Get a Virtual Network associated with an App Service plan. + + Description for Get a Virtual Network associated with an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VnetInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_from_server_farm.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_from_server_farm.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def get_vnet_gateway( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + **kwargs + ) -> "_models.VnetGateway": + """Get a Virtual Network gateway. + + Description for Get a Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Only the 'primary' gateway is supported. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + async def update_vnet_gateway( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + connection_envelope: "_models.VnetGateway", + **kwargs + ) -> "_models.VnetGateway": + """Update a Virtual Network gateway. + + Description for Update a Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Only the 'primary' gateway is supported. + :type gateway_name: str + :param connection_envelope: Definition of the gateway. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + async def list_routes_for_vnet( + self, + resource_group_name: str, + name: str, + vnet_name: str, + **kwargs + ) -> List["_models.VnetRoute"]: + """Get all routes that are associated with a Virtual Network in an App Service plan. + + Description for Get all routes that are associated with a Virtual Network in an App Service + plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetRoute, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.VnetRoute] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetRoute"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_routes_for_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetRoute]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_routes_for_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes'} # type: ignore + + async def get_route_for_vnet( + self, + resource_group_name: str, + name: str, + vnet_name: str, + route_name: str, + **kwargs + ) -> Optional[List["_models.VnetRoute"]]: + """Get a Virtual Network route in an App Service plan. + + Description for Get a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetRoute, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.VnetRoute] or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[List["_models.VnetRoute"]]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_route_for_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[VnetRoute]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_route_for_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + async def create_or_update_vnet_route( + self, + resource_group_name: str, + name: str, + vnet_name: str, + route_name: str, + route: "_models.VnetRoute", + **kwargs + ) -> Optional["_models.VnetRoute"]: + """Create or update a Virtual Network route in an App Service plan. + + Description for Create or update a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :param route: Definition of the Virtual Network route. + :type route: ~azure.mgmt.web.v2020_06_01.models.VnetRoute + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetRoute, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetRoute or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VnetRoute"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_route.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route, 'VnetRoute') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 400, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VnetRoute', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + async def delete_vnet_route( + self, + resource_group_name: str, + name: str, + vnet_name: str, + route_name: str, + **kwargs + ) -> None: + """Delete a Virtual Network route in an App Service plan. + + Description for Delete a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_vnet_route.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_vnet_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + async def update_vnet_route( + self, + resource_group_name: str, + name: str, + vnet_name: str, + route_name: str, + route: "_models.VnetRoute", + **kwargs + ) -> Optional["_models.VnetRoute"]: + """Create or update a Virtual Network route in an App Service plan. + + Description for Create or update a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :param route: Definition of the Virtual Network route. + :type route: ~azure.mgmt.web.v2020_06_01.models.VnetRoute + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetRoute, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetRoute or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VnetRoute"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_route.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route, 'VnetRoute') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 400, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VnetRoute', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + async def reboot_worker( + self, + resource_group_name: str, + name: str, + worker_name: str, + **kwargs + ) -> None: + """Reboot a worker machine in an App Service plan. + + Description for Reboot a worker machine in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param worker_name: Name of worker machine, which typically starts with RD. + :type worker_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.reboot_worker.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerName': self._serialize.url("worker_name", worker_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reboot_worker.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/workers/{workerName}/reboot'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_certificate_registration_provider_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_certificate_registration_provider_operations.py new file mode 100644 index 000000000000..9c37dd92c6b1 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_certificate_registration_provider_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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CertificateRegistrationProviderOperations: + """CertificateRegistrationProviderOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_operations( + self, + **kwargs + ) -> AsyncIterable["_models.CsmOperationCollection"]: + """Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. + + Description for Implements Csm operations Api to exposes the list of available Csm Apis under + the resource provider. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmOperationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.CsmOperationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmOperationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CsmOperationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_operations.metadata = {'url': '/providers/Microsoft.CertificateRegistration/operations'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_certificates_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_certificates_operations.py new file mode 100644 index 000000000000..e0fbf6dbd315 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_certificates_operations.py @@ -0,0 +1,441 @@ +# 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, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CertificatesOperations: + """CertificatesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.CertificateCollection"]: + """Get all certificates for a subscription. + + Description for Get all certificates for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CertificateCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.CertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/certificates'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.CertificateCollection"]: + """Get all certificates in a resource group. + + Description for Get all certificates in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 CertificateCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.CertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.Web/certificates'} # type: ignore + + async def get( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.Certificate": + """Get a certificate. + + Description for Get a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + name: str, + certificate_envelope: "_models.Certificate", + **kwargs + ) -> "_models.Certificate": + """Create or update a certificate. + + Description for Create or update a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :param certificate_envelope: Details of certificate, if it exists already. + :type certificate_envelope: ~azure.mgmt.web.v2020_06_01.models.Certificate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_envelope, 'Certificate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Delete a certificate. + + Description for Delete a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore + + async def update( + self, + resource_group_name: str, + name: str, + certificate_envelope: "_models.CertificatePatchResource", + **kwargs + ) -> "_models.Certificate": + """Create or update a certificate. + + Description for Create or update a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :param certificate_envelope: Details of certificate, if it exists already. + :type certificate_envelope: ~azure.mgmt.web.v2020_06_01.models.CertificatePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_envelope, 'CertificatePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_deleted_web_apps_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_deleted_web_apps_operations.py new file mode 100644 index 000000000000..ea7bc96b055c --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_deleted_web_apps_operations.py @@ -0,0 +1,245 @@ +# 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, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DeletedWebAppsOperations: + """DeletedWebAppsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.DeletedWebAppCollection"]: + """Get all deleted apps for a subscription. + + Description for Get all deleted apps for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeletedWebAppCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.DeletedWebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedWebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DeletedWebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites'} # type: ignore + + def list_by_location( + self, + location: str, + **kwargs + ) -> AsyncIterable["_models.DeletedWebAppCollection"]: + """Get all deleted apps for a subscription at location. + + Description for Get all deleted apps for a subscription at location. + + :param location: + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeletedWebAppCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.DeletedWebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedWebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_location.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DeletedWebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/deletedSites'} # type: ignore + + async def get_deleted_web_app_by_location( + self, + location: str, + deleted_site_id: str, + **kwargs + ) -> "_models.DeletedSite": + """Get deleted app for a subscription at location. + + Description for Get deleted app for a subscription at location. + + :param location: + :type location: str + :param deleted_site_id: The numeric ID of the deleted app, e.g. 12345. + :type deleted_site_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeletedSite, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DeletedSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedSite"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_deleted_web_app_by_location.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'deletedSiteId': self._serialize.url("deleted_site_id", deleted_site_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeletedSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deleted_web_app_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/deletedSites/{deletedSiteId}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_diagnostics_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_diagnostics_operations.py new file mode 100644 index 000000000000..f9da6107d42c --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_diagnostics_operations.py @@ -0,0 +1,1774 @@ +# 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. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DiagnosticsOperations: + """DiagnosticsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_hosting_environment_detector_responses( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.DetectorResponseCollection"]: + """List Hosting Environment Detector Responses. + + Description for List Hosting Environment Detector Responses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site Name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DetectorResponseCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.DetectorResponseCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponseCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_hosting_environment_detector_responses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DetectorResponseCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_hosting_environment_detector_responses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors'} # type: ignore + + async def get_hosting_environment_detector_response( + self, + resource_group_name: str, + name: str, + detector_name: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs + ) -> "_models.DetectorResponse": + """Get Hosting Environment Detector Response. + + Description for Get Hosting Environment Detector Response. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: App Service Environment Name. + :type name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_hosting_environment_detector_response.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hosting_environment_detector_response.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors/{detectorName}'} # type: ignore + + def list_site_detector_responses( + self, + resource_group_name: str, + site_name: str, + **kwargs + ) -> AsyncIterable["_models.DetectorResponseCollection"]: + """List Site Detector Responses. + + Description for List Site Detector Responses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DetectorResponseCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.DetectorResponseCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponseCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detector_responses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DetectorResponseCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_detector_responses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors'} # type: ignore + + async def get_site_detector_response( + self, + resource_group_name: str, + site_name: str, + detector_name: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs + ) -> "_models.DetectorResponse": + """Get site detector response. + + Description for Get site detector response. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector_response.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector_response.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors/{detectorName}'} # type: ignore + + def list_site_diagnostic_categories( + self, + resource_group_name: str, + site_name: str, + **kwargs + ) -> AsyncIterable["_models.DiagnosticCategoryCollection"]: + """Get Diagnostics Categories. + + Description for Get Diagnostics Categories. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticCategoryCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.DiagnosticCategoryCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_diagnostic_categories.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticCategoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_diagnostic_categories.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics'} # type: ignore + + async def get_site_diagnostic_category( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + **kwargs + ) -> "_models.DiagnosticCategory": + """Get Diagnostics Category. + + Description for Get Diagnostics Category. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticCategory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DiagnosticCategory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategory"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_diagnostic_category.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticCategory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_diagnostic_category.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}'} # type: ignore + + def list_site_analyses( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + **kwargs + ) -> AsyncIterable["_models.DiagnosticAnalysisCollection"]: + """Get Site Analyses. + + Description for Get Site Analyses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticAnalysisCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.DiagnosticAnalysisCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysisCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_analyses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticAnalysisCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_analyses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses'} # type: ignore + + async def get_site_analysis( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + analysis_name: str, + **kwargs + ) -> "_models.AnalysisDefinition": + """Get Site Analysis. + + Description for Get Site Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param analysis_name: Analysis Name. + :type analysis_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalysisDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AnalysisDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalysisDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_analysis.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AnalysisDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_analysis.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}'} # type: ignore + + async def execute_site_analysis( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + analysis_name: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs + ) -> "_models.DiagnosticAnalysis": + """Execute Analysis. + + Description for Execute Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param analysis_name: Analysis Resource Name. + :type analysis_name: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticAnalysis, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DiagnosticAnalysis + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysis"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_analysis.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticAnalysis', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_analysis.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute'} # type: ignore + + def list_site_detectors( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + **kwargs + ) -> AsyncIterable["_models.DiagnosticDetectorCollection"]: + """Get Detectors. + + Description for Get Detectors. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticDetectorCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.DiagnosticDetectorCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detectors.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticDetectorCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_detectors.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors'} # type: ignore + + async def get_site_detector( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + detector_name: str, + **kwargs + ) -> "_models.DetectorDefinition": + """Get Detector. + + Description for Get Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param detector_name: Detector Name. + :type detector_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DetectorDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}'} # type: ignore + + async def execute_site_detector( + self, + resource_group_name: str, + site_name: str, + detector_name: str, + diagnostic_category: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs + ) -> "_models.DiagnosticDetectorResponse": + """Execute Detector. + + Description for Execute Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticDetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DiagnosticDetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_detector.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticDetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_detector.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute'} # type: ignore + + def list_site_detector_responses_slot( + self, + resource_group_name: str, + site_name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.DetectorResponseCollection"]: + """List Site Detector Responses. + + Description for List Site Detector Responses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DetectorResponseCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.DetectorResponseCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponseCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detector_responses_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DetectorResponseCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_detector_responses_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors'} # type: ignore + + async def get_site_detector_response_slot( + self, + resource_group_name: str, + site_name: str, + detector_name: str, + slot: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs + ) -> "_models.DetectorResponse": + """Get site detector response. + + Description for Get site detector response. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param slot: Slot Name. + :type slot: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector_response_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector_response_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors/{detectorName}'} # type: ignore + + def list_site_diagnostic_categories_slot( + self, + resource_group_name: str, + site_name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.DiagnosticCategoryCollection"]: + """Get Diagnostics Categories. + + Description for Get Diagnostics Categories. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticCategoryCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.DiagnosticCategoryCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_diagnostic_categories_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticCategoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_diagnostic_categories_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics'} # type: ignore + + async def get_site_diagnostic_category_slot( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + slot: str, + **kwargs + ) -> "_models.DiagnosticCategory": + """Get Diagnostics Category. + + Description for Get Diagnostics Category. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticCategory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DiagnosticCategory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategory"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_diagnostic_category_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticCategory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_diagnostic_category_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}'} # type: ignore + + def list_site_analyses_slot( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.DiagnosticAnalysisCollection"]: + """Get Site Analyses. + + Description for Get Site Analyses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticAnalysisCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.DiagnosticAnalysisCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysisCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_analyses_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticAnalysisCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_analyses_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses'} # type: ignore + + async def get_site_analysis_slot( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + analysis_name: str, + slot: str, + **kwargs + ) -> "_models.AnalysisDefinition": + """Get Site Analysis. + + Description for Get Site Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param analysis_name: Analysis Name. + :type analysis_name: str + :param slot: Slot - optional. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalysisDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AnalysisDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalysisDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_analysis_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AnalysisDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_analysis_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses/{analysisName}'} # type: ignore + + async def execute_site_analysis_slot( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + analysis_name: str, + slot: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs + ) -> "_models.DiagnosticAnalysis": + """Execute Analysis. + + Description for Execute Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param analysis_name: Analysis Resource Name. + :type analysis_name: str + :param slot: Slot Name. + :type slot: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticAnalysis, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DiagnosticAnalysis + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysis"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_analysis_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticAnalysis', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_analysis_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute'} # type: ignore + + def list_site_detectors_slot( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.DiagnosticDetectorCollection"]: + """Get Detectors. + + Description for Get Detectors. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticDetectorCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.DiagnosticDetectorCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detectors_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticDetectorCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_detectors_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors'} # type: ignore + + async def get_site_detector_slot( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + detector_name: str, + slot: str, + **kwargs + ) -> "_models.DetectorDefinition": + """Get Detector. + + Description for Get Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param detector_name: Detector Name. + :type detector_name: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DetectorDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors/{detectorName}'} # type: ignore + + async def execute_site_detector_slot( + self, + resource_group_name: str, + site_name: str, + detector_name: str, + diagnostic_category: str, + slot: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs + ) -> "_models.DiagnosticDetectorResponse": + """Execute Detector. + + Description for Execute Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticDetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DiagnosticDetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_detector_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticDetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_detector_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_domain_registration_provider_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_domain_registration_provider_operations.py new file mode 100644 index 000000000000..bb3043ec7a35 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_domain_registration_provider_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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DomainRegistrationProviderOperations: + """DomainRegistrationProviderOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_operations( + self, + **kwargs + ) -> AsyncIterable["_models.CsmOperationCollection"]: + """Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. + + Description for Implements Csm operations Api to exposes the list of available Csm Apis under + the resource provider. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmOperationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.CsmOperationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmOperationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CsmOperationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_operations.metadata = {'url': '/providers/Microsoft.DomainRegistration/operations'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_domains_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_domains_operations.py new file mode 100644 index 000000000000..adac89038081 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_domains_operations.py @@ -0,0 +1,1119 @@ +# 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, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DomainsOperations: + """DomainsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def check_availability( + self, + identifier: "_models.NameIdentifier", + **kwargs + ) -> "_models.DomainAvailabilityCheckResult": + """Check if a domain is available for registration. + + Description for Check if a domain is available for registration. + + :param identifier: Name of the domain. + :type identifier: ~azure.mgmt.web.v2020_06_01.models.NameIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainAvailabilityCheckResult, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DomainAvailabilityCheckResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainAvailabilityCheckResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainAvailabilityCheckResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/checkDomainAvailability'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.DomainCollection"]: + """Get all domains in a subscription. + + Description for Get all domains in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DomainCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.DomainCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DomainCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/domains'} # type: ignore + + async def get_control_center_sso_request( + self, + **kwargs + ) -> "_models.DomainControlCenterSsoRequest": + """Generate a single sign-on request for the domain management portal. + + Description for Generate a single sign-on request for the domain management portal. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainControlCenterSsoRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DomainControlCenterSsoRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainControlCenterSsoRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_control_center_sso_request.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainControlCenterSsoRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_control_center_sso_request.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/generateSsoRequest'} # type: ignore + + def list_recommendations( + self, + parameters: "_models.DomainRecommendationSearchParameters", + **kwargs + ) -> AsyncIterable["_models.NameIdentifierCollection"]: + """Get domain name recommendations based on keywords. + + Description for Get domain name recommendations based on keywords. + + :param parameters: Search parameters for domain name recommendations. + :type parameters: ~azure.mgmt.web.v2020_06_01.models.DomainRecommendationSearchParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NameIdentifierCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.NameIdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NameIdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_recommendations.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DomainRecommendationSearchParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DomainRecommendationSearchParameters') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NameIdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_recommendations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/listDomainRecommendations'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.DomainCollection"]: + """Get all domains in a resource group. + + Description for Get all domains in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 DomainCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.DomainCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DomainCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.DomainRegistration/domains'} # type: ignore + + async def get( + self, + resource_group_name: str, + domain_name: str, + **kwargs + ) -> "_models.Domain": + """Get a domain. + + Description for Get a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Domain, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Domain + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + domain_name: str, + domain: "_models.Domain", + **kwargs + ) -> "_models.Domain": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str', pattern=r'[a-zA-Z0-9][a-zA-Z0-9\.-]+'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain, 'Domain') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Domain', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + domain_name: str, + domain: "_models.Domain", + **kwargs + ) -> AsyncLROPoller["_models.Domain"]: + """Creates or updates a domain. + + Description for Creates or updates a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param domain: Domain registration information. + :type domain: ~azure.mgmt.web.v2020_06_01.models.Domain + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 Domain or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.Domain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + domain_name=domain_name, + domain=domain, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str', pattern=r'[a-zA-Z0-9][a-zA-Z0-9\.-]+'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + domain_name: str, + force_hard_delete_domain: Optional[bool] = None, + **kwargs + ) -> None: + """Delete a domain. + + Description for Delete a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param force_hard_delete_domain: Specify :code:`true` to delete the domain + immediately. The default is :code:`false` which deletes the domain after 24 hours. + :type force_hard_delete_domain: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if force_hard_delete_domain is not None: + query_parameters['forceHardDeleteDomain'] = self._serialize.query("force_hard_delete_domain", force_hard_delete_domain, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + domain_name: str, + domain: "_models.DomainPatchResource", + **kwargs + ) -> "_models.Domain": + """Creates or updates a domain. + + Description for Creates or updates a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param domain: Domain registration information. + :type domain: ~azure.mgmt.web.v2020_06_01.models.DomainPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Domain, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Domain + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str', pattern=r'[a-zA-Z0-9][a-zA-Z0-9\.-]+'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain, 'DomainPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Domain', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + def list_ownership_identifiers( + self, + resource_group_name: str, + domain_name: str, + **kwargs + ) -> AsyncIterable["_models.DomainOwnershipIdentifierCollection"]: + """Lists domain ownership identifiers. + + Description for Lists domain ownership identifiers. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type 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 DomainOwnershipIdentifierCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.DomainOwnershipIdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_ownership_identifiers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DomainOwnershipIdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_ownership_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers'} # type: ignore + + async def get_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + **kwargs + ) -> "_models.DomainOwnershipIdentifier": + """Get ownership identifier for domain. + + Description for Get ownership identifier for domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainOwnershipIdentifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DomainOwnershipIdentifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainOwnershipIdentifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + async def create_or_update_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + domain_ownership_identifier: "_models.DomainOwnershipIdentifier", + **kwargs + ) -> "_models.DomainOwnershipIdentifier": + """Creates an ownership identifier for a domain or updates identifier details for an existing identifer. + + Description for Creates an ownership identifier for a domain or updates identifier details for + an existing identifer. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_06_01.models.DomainOwnershipIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainOwnershipIdentifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DomainOwnershipIdentifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'DomainOwnershipIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainOwnershipIdentifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + async def delete_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + **kwargs + ) -> None: + """Delete ownership identifier for domain. + + Description for Delete ownership identifier for domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + async def update_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + domain_ownership_identifier: "_models.DomainOwnershipIdentifier", + **kwargs + ) -> "_models.DomainOwnershipIdentifier": + """Creates an ownership identifier for a domain or updates identifier details for an existing identifer. + + Description for Creates an ownership identifier for a domain or updates identifier details for + an existing identifer. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_06_01.models.DomainOwnershipIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainOwnershipIdentifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DomainOwnershipIdentifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'DomainOwnershipIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainOwnershipIdentifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + async def renew( + self, + resource_group_name: str, + domain_name: str, + **kwargs + ) -> None: + """Renew a domain. + + Description for Renew a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.renew.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + renew.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/renew'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_provider_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_provider_operations.py new file mode 100644 index 000000000000..77e77cd8e645 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_provider_operations.py @@ -0,0 +1,252 @@ +# 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, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProviderOperations: + """ProviderOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get_available_stacks( + self, + os_type_selected: Optional[Union[str, "_models.Enum4"]] = None, + **kwargs + ) -> AsyncIterable["_models.ApplicationStackCollection"]: + """Get available application frameworks and their versions. + + Description for Get available application frameworks and their versions. + + :param os_type_selected: + :type os_type_selected: str or ~azure.mgmt.web.v2020_06_01.models.Enum4 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationStackCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ApplicationStackCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationStackCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_available_stacks.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if os_type_selected is not None: + query_parameters['osTypeSelected'] = self._serialize.query("os_type_selected", os_type_selected, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationStackCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_available_stacks.metadata = {'url': '/providers/Microsoft.Web/availableStacks'} # type: ignore + + def list_operations( + self, + **kwargs + ) -> AsyncIterable["_models.CsmOperationCollection"]: + """Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. + + Description for Gets all available operations for the Microsoft.Web resource provider. Also + exposes resource metric definitions. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmOperationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.CsmOperationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmOperationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CsmOperationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_operations.metadata = {'url': '/providers/Microsoft.Web/operations'} # type: ignore + + def get_available_stacks_on_prem( + self, + os_type_selected: Optional[Union[str, "_models.Enum5"]] = None, + **kwargs + ) -> AsyncIterable["_models.ApplicationStackCollection"]: + """Get available application frameworks and their versions. + + Description for Get available application frameworks and their versions. + + :param os_type_selected: + :type os_type_selected: str or ~azure.mgmt.web.v2020_06_01.models.Enum5 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationStackCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ApplicationStackCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationStackCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_available_stacks_on_prem.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if os_type_selected is not None: + query_parameters['osTypeSelected'] = self._serialize.query("os_type_selected", os_type_selected, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationStackCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_available_stacks_on_prem.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_recommendations_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_recommendations_operations.py new file mode 100644 index 000000000000..28d69824079b --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_recommendations_operations.py @@ -0,0 +1,1109 @@ +# 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, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RecommendationsOperations: + """RecommendationsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + featured: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.RecommendationCollection"]: + """List all recommendations for a subscription. + + Description for List all recommendations for a subscription. + + :param featured: Specify :code:`true` to return only the most critical + recommendations. The default is :code:`false`, which returns all recommendations. + :type featured: bool + :param filter: Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or + channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq + 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if featured is not None: + query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations'} # type: ignore + + async def reset_all_filters( + self, + **kwargs + ) -> None: + """Reset all recommendation opt-out settings for a subscription. + + Description for Reset all recommendation opt-out settings for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.reset_all_filters.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_all_filters.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/reset'} # type: ignore + + async def disable_recommendation_for_subscription( + self, + name: str, + **kwargs + ) -> None: + """Disables the specified rule so it will not apply to a subscription in the future. + + Description for Disables the specified rule so it will not apply to a subscription in the + future. + + :param name: Rule name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.disable_recommendation_for_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_recommendation_for_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/{name}/disable'} # type: ignore + + def list_history_for_hosting_environment( + self, + resource_group_name: str, + hosting_environment_name: str, + expired_only: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.RecommendationCollection"]: + """Get past recommendations for an app, optionally specified by the time range. + + Description for Get past recommendations for an app, optionally specified by the time range. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param hosting_environment_name: Name of the hosting environment. + :type hosting_environment_name: str + :param expired_only: Specify :code:`false` to return all recommendations. The + default is :code:`true`, which returns only expired recommendations. + :type expired_only: bool + :param filter: Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or + channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq + 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_history_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expired_only is not None: + query_parameters['expiredOnly'] = self._serialize.query("expired_only", expired_only, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_history_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendationHistory'} # type: ignore + + def list_recommended_rules_for_hosting_environment( + self, + resource_group_name: str, + hosting_environment_name: str, + featured: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.RecommendationCollection"]: + """Get all recommendations for a hosting environment. + + Description for Get all recommendations for a hosting environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param hosting_environment_name: Name of the app. + :type hosting_environment_name: str + :param featured: Specify :code:`true` to return only the most critical + recommendations. The default is :code:`false`, which returns all recommendations. + :type featured: bool + :param filter: Return only channels specified in the filter. Filter is specified by using OData + syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_recommended_rules_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if featured is not None: + query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_recommended_rules_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations'} # type: ignore + + async def disable_all_for_hosting_environment( + self, + resource_group_name: str, + environment_name: str, + hosting_environment_name: str, + **kwargs + ) -> None: + """Disable all recommendations for an app. + + Description for Disable all recommendations for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param environment_name: Name of the app. + :type environment_name: str + :param hosting_environment_name: + :type hosting_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.disable_all_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['environmentName'] = self._serialize.query("environment_name", environment_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_all_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/disable'} # type: ignore + + async def reset_all_filters_for_hosting_environment( + self, + resource_group_name: str, + environment_name: str, + hosting_environment_name: str, + **kwargs + ) -> None: + """Reset all recommendation opt-out settings for an app. + + Description for Reset all recommendation opt-out settings for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param environment_name: Name of the app. + :type environment_name: str + :param hosting_environment_name: + :type hosting_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.reset_all_filters_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['environmentName'] = self._serialize.query("environment_name", environment_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_all_filters_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/reset'} # type: ignore + + async def get_rule_details_by_hosting_environment( + self, + resource_group_name: str, + hosting_environment_name: str, + name: str, + update_seen: Optional[bool] = None, + recommendation_id: Optional[str] = None, + **kwargs + ) -> "_models.RecommendationRule": + """Get a recommendation rule for an app. + + Description for Get a recommendation rule for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param hosting_environment_name: Name of the hosting environment. + :type hosting_environment_name: str + :param name: Name of the recommendation. + :type name: str + :param update_seen: Specify :code:`true` to update the last-seen timestamp of the + recommendation object. + :type update_seen: bool + :param recommendation_id: The GUID of the recommendation object if you query an expired one. + You don't need to specify it to query an active entry. + :type recommendation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RecommendationRule, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RecommendationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_rule_details_by_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if update_seen is not None: + query_parameters['updateSeen'] = self._serialize.query("update_seen", update_seen, 'bool') + if recommendation_id is not None: + query_parameters['recommendationId'] = self._serialize.query("recommendation_id", recommendation_id, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RecommendationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_rule_details_by_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}'} # type: ignore + + async def disable_recommendation_for_hosting_environment( + self, + resource_group_name: str, + environment_name: str, + name: str, + hosting_environment_name: str, + **kwargs + ) -> None: + """Disables the specific rule for a web site permanently. + + Description for Disables the specific rule for a web site permanently. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param environment_name: Site name. + :type environment_name: str + :param name: Rule name. + :type name: str + :param hosting_environment_name: + :type hosting_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.disable_recommendation_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['environmentName'] = self._serialize.query("environment_name", environment_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_recommendation_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}/disable'} # type: ignore + + def list_history_for_web_app( + self, + resource_group_name: str, + site_name: str, + expired_only: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.RecommendationCollection"]: + """Get past recommendations for an app, optionally specified by the time range. + + Description for Get past recommendations for an app, optionally specified by the time range. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :param expired_only: Specify :code:`false` to return all recommendations. The + default is :code:`true`, which returns only expired recommendations. + :type expired_only: bool + :param filter: Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or + channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq + 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_history_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expired_only is not None: + query_parameters['expiredOnly'] = self._serialize.query("expired_only", expired_only, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_history_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendationHistory'} # type: ignore + + def list_recommended_rules_for_web_app( + self, + resource_group_name: str, + site_name: str, + featured: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.RecommendationCollection"]: + """Get all recommendations for an app. + + Description for Get all recommendations for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :param featured: Specify :code:`true` to return only the most critical + recommendations. The default is :code:`false`, which returns all recommendations. + :type featured: bool + :param filter: Return only channels specified in the filter. Filter is specified by using OData + syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_recommended_rules_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if featured is not None: + query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_recommended_rules_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations'} # type: ignore + + async def disable_all_for_web_app( + self, + resource_group_name: str, + site_name: str, + **kwargs + ) -> None: + """Disable all recommendations for an app. + + Description for Disable all recommendations for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.disable_all_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_all_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/disable'} # type: ignore + + async def reset_all_filters_for_web_app( + self, + resource_group_name: str, + site_name: str, + **kwargs + ) -> None: + """Reset all recommendation opt-out settings for an app. + + Description for Reset all recommendation opt-out settings for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.reset_all_filters_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_all_filters_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/reset'} # type: ignore + + async def get_rule_details_by_web_app( + self, + resource_group_name: str, + site_name: str, + name: str, + update_seen: Optional[bool] = None, + recommendation_id: Optional[str] = None, + **kwargs + ) -> "_models.RecommendationRule": + """Get a recommendation rule for an app. + + Description for Get a recommendation rule for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :param name: Name of the recommendation. + :type name: str + :param update_seen: Specify :code:`true` to update the last-seen timestamp of the + recommendation object. + :type update_seen: bool + :param recommendation_id: The GUID of the recommendation object if you query an expired one. + You don't need to specify it to query an active entry. + :type recommendation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RecommendationRule, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RecommendationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_rule_details_by_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if update_seen is not None: + query_parameters['updateSeen'] = self._serialize.query("update_seen", update_seen, 'bool') + if recommendation_id is not None: + query_parameters['recommendationId'] = self._serialize.query("recommendation_id", recommendation_id, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RecommendationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_rule_details_by_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}'} # type: ignore + + async def disable_recommendation_for_site( + self, + resource_group_name: str, + site_name: str, + name: str, + **kwargs + ) -> None: + """Disables the specific rule for a web site permanently. + + Description for Disables the specific rule for a web site permanently. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site name. + :type site_name: str + :param name: Rule name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.disable_recommendation_for_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_recommendation_for_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}/disable'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_resource_health_metadata_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_resource_health_metadata_operations.py new file mode 100644 index 000000000000..d932503b923f --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_resource_health_metadata_operations.py @@ -0,0 +1,471 @@ +# 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, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ResourceHealthMetadataOperations: + """ResourceHealthMetadataOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.ResourceHealthMetadataCollection"]: + """List all ResourceHealthMetadata for all sites in the subscription. + + Description for List all ResourceHealthMetadata for all sites in the subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/resourceHealthMetadata'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.ResourceHealthMetadataCollection"]: + """List all ResourceHealthMetadata for all sites in the resource group in the subscription. + + Description for List all ResourceHealthMetadata for all sites in the resource group in the + subscription. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.Web/resourceHealthMetadata'} # type: ignore + + def list_by_site( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.ResourceHealthMetadataCollection"]: + """Gets the category of ResourceHealthMetadata to use for the given site as a collection. + + Description for Gets the category of ResourceHealthMetadata to use for the given site as a + collection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata'} # type: ignore + + async def get_by_site( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.ResourceHealthMetadata": + """Gets the category of ResourceHealthMetadata to use for the given site. + + Description for Gets the category of ResourceHealthMetadata to use for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceHealthMetadata, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ResourceHealthMetadata + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadata"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_by_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceHealthMetadata', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata/default'} # type: ignore + + def list_by_site_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.ResourceHealthMetadataCollection"]: + """Gets the category of ResourceHealthMetadata to use for the given site as a collection. + + Description for Gets the category of ResourceHealthMetadata to use for the given site as a + collection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_site_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_site_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata'} # type: ignore + + async def get_by_site_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.ResourceHealthMetadata": + """Gets the category of ResourceHealthMetadata to use for the given site. + + Description for Gets the category of ResourceHealthMetadata to use for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceHealthMetadata, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ResourceHealthMetadata + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadata"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_by_site_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceHealthMetadata', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_site_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata/default'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_static_sites_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_static_sites_operations.py new file mode 100644 index 000000000000..3ced26168c40 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_static_sites_operations.py @@ -0,0 +1,1913 @@ +# 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, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class StaticSitesOperations: + """StaticSitesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def preview_workflow( + self, + location: str, + static_sites_workflow_preview_request: "_models.StaticSitesWorkflowPreviewRequest", + **kwargs + ) -> "_models.StaticSitesWorkflowPreview": + """Generates a preview workflow file for the static site. + + Description for Generates a preview workflow file for the static site. + + :param location: Location where you plan to create the static site. + :type location: str + :param static_sites_workflow_preview_request: A JSON representation of the + StaticSitesWorkflowPreviewRequest properties. See example. + :type static_sites_workflow_preview_request: ~azure.mgmt.web.v2020_06_01.models.StaticSitesWorkflowPreviewRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSitesWorkflowPreview, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StaticSitesWorkflowPreview + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSitesWorkflowPreview"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.preview_workflow.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_sites_workflow_preview_request, 'StaticSitesWorkflowPreviewRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSitesWorkflowPreview', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + preview_workflow.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/previewStaticSiteWorkflowFile'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.StaticSiteCollection"]: + """Get all Static Sites for a subscription. + + Description for Get all Static Sites for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.StaticSiteCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/staticSites'} # type: ignore + + def get_static_sites_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.StaticSiteCollection"]: + """Gets all static sites in the specified resource group. + + Description for Gets all static sites in the specified resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 StaticSiteCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.StaticSiteCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_static_sites_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_static_sites_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites'} # type: ignore + + async def get_static_site( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.StaticSiteARMResource": + """Gets the details of a static site. + + Description for Gets the details of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StaticSiteARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + async def create_or_update_static_site( + self, + resource_group_name: str, + name: str, + static_site_envelope: "_models.StaticSiteARMResource", + **kwargs + ) -> "_models.StaticSiteARMResource": + """Creates a new static site in an existing resource group, or updates an existing static site. + + Description for Creates a new static site in an existing resource group, or updates an existing + static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to create or update. + :type name: str + :param static_site_envelope: A JSON representation of the staticsite properties. See example. + :type static_site_envelope: ~azure.mgmt.web.v2020_06_01.models.StaticSiteARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StaticSiteARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_envelope, 'StaticSiteARMResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + async def delete_static_site( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Deletes a static site. + + Description for Deletes a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to delete. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + async def update_static_site( + self, + resource_group_name: str, + name: str, + static_site_envelope: "_models.StaticSitePatchResource", + **kwargs + ) -> "_models.StaticSiteARMResource": + """Creates a new static site in an existing resource group, or updates an existing static site. + + Description for Creates a new static site in an existing resource group, or updates an existing + static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to create or update. + :type name: str + :param static_site_envelope: A JSON representation of the staticsite properties. See example. + :type static_site_envelope: ~azure.mgmt.web.v2020_06_01.models.StaticSitePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StaticSiteARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_envelope, 'StaticSitePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + def list_static_site_users( + self, + resource_group_name: str, + name: str, + authprovider: str, + **kwargs + ) -> AsyncIterable["_models.StaticSiteUserCollection"]: + """Gets the list of users of a static site. + + Description for Gets the list of users of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param authprovider: The auth provider for the users. + :type authprovider: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteUserCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.StaticSiteUserCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_users.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'authprovider': self._serialize.url("authprovider", authprovider, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteUserCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_static_site_users.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/listUsers'} # type: ignore + + async def delete_static_site_user( + self, + resource_group_name: str, + name: str, + authprovider: str, + userid: str, + **kwargs + ) -> None: + """Deletes the user entry from the static site. + + Description for Deletes the user entry from the static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the staticsite. + :type name: str + :param authprovider: The auth provider for this user. + :type authprovider: str + :param userid: The user id of the user. + :type userid: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_static_site_user.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'authprovider': self._serialize.url("authprovider", authprovider, 'str'), + 'userid': self._serialize.url("userid", userid, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_static_site_user.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}'} # type: ignore + + async def update_static_site_user( + self, + resource_group_name: str, + name: str, + authprovider: str, + userid: str, + static_site_user_envelope: "_models.StaticSiteUserARMResource", + **kwargs + ) -> "_models.StaticSiteUserARMResource": + """Updates a user entry with the listed roles. + + Description for Updates a user entry with the listed roles. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param authprovider: The auth provider for this user. + :type authprovider: str + :param userid: The user id of the user. + :type userid: str + :param static_site_user_envelope: A JSON representation of the StaticSiteUser properties. See + example. + :type static_site_user_envelope: ~azure.mgmt.web.v2020_06_01.models.StaticSiteUserARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteUserARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StaticSiteUserARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_static_site_user.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'authprovider': self._serialize.url("authprovider", authprovider, 'str'), + 'userid': self._serialize.url("userid", userid, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_user_envelope, 'StaticSiteUserARMResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteUserARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_static_site_user.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}'} # type: ignore + + def get_static_site_builds( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.StaticSiteBuildCollection"]: + """Gets all static site builds for a particular static site. + + Description for Gets all static site builds for a particular static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteBuildCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.StaticSiteBuildCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteBuildCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_static_site_builds.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteBuildCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_static_site_builds.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds'} # type: ignore + + async def get_static_site_build( + self, + resource_group_name: str, + name: str, + pr_id: str, + **kwargs + ) -> "_models.StaticSiteBuildARMResource": + """Gets the details of a static site build. + + Description for Gets the details of a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteBuildARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StaticSiteBuildARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteBuildARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_static_site_build.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteBuildARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}'} # type: ignore + + async def delete_static_site_build( + self, + resource_group_name: str, + name: str, + pr_id: str, + **kwargs + ) -> None: + """Deletes a static site build. + + Description for Deletes a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_static_site_build.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}'} # type: ignore + + async def create_or_update_static_site_build_function_app_settings( + self, + resource_group_name: str, + name: str, + pr_id: str, + app_settings: "_models.StringDictionary", + **kwargs + ) -> "_models.StringDictionary": + """Creates or updates the function app settings of a static site build. + + Description for Creates or updates the function app settings of a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_id: str + :param app_settings: + :type app_settings: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site_build_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site_build_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/config/functionappsettings'} # type: ignore + + def list_static_site_build_functions( + self, + resource_group_name: str, + name: str, + pr_id: str, + **kwargs + ) -> AsyncIterable["_models.StaticSiteFunctionOverviewCollection"]: + """Gets the functions of a particular static site build. + + Description for Gets the functions of a particular static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteFunctionOverviewCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.StaticSiteFunctionOverviewCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteFunctionOverviewCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_build_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteFunctionOverviewCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_static_site_build_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/functions'} # type: ignore + + async def list_static_site_build_function_app_settings( + self, + resource_group_name: str, + name: str, + pr_id: str, + **kwargs + ) -> "_models.StringDictionary": + """Gets the application settings of a static site. + + Description for Gets the application settings of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_build_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_build_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/listFunctionAppSettings'} # type: ignore + + async def create_or_update_static_site_function_app_settings( + self, + resource_group_name: str, + name: str, + app_settings: "_models.StringDictionary", + **kwargs + ) -> "_models.StringDictionary": + """Creates or updates the function app settings of a static site. + + Description for Creates or updates the function app settings of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param app_settings: + :type app_settings: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/functionappsettings'} # type: ignore + + async def create_user_roles_invitation_link( + self, + resource_group_name: str, + name: str, + static_site_user_roles_invitation_envelope: "_models.StaticSiteUserInvitationRequestResource", + **kwargs + ) -> "_models.StaticSiteUserInvitationResponseResource": + """Creates an invitation link for a user with the role. + + Description for Creates an invitation link for a user with the role. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param static_site_user_roles_invitation_envelope: + :type static_site_user_roles_invitation_envelope: ~azure.mgmt.web.v2020_06_01.models.StaticSiteUserInvitationRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteUserInvitationResponseResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StaticSiteUserInvitationResponseResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserInvitationResponseResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_user_roles_invitation_link.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_user_roles_invitation_envelope, 'StaticSiteUserInvitationRequestResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteUserInvitationResponseResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_user_roles_invitation_link.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/createUserInvitation'} # type: ignore + + def list_static_site_custom_domains( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.StaticSiteCustomDomainOverviewCollection"]: + """Gets all static site custom domains for a particular static site. + + Description for Gets all static site custom domains for a particular static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site resource to search in. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteCustomDomainOverviewCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.StaticSiteCustomDomainOverviewCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCustomDomainOverviewCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_custom_domains.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteCustomDomainOverviewCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_static_site_custom_domains.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains'} # type: ignore + + async def create_or_update_static_site_custom_domain( + self, + resource_group_name: str, + name: str, + domain_name: str, + **kwargs + ) -> "_models.StaticSiteCustomDomainOverviewARMResource": + """Creates a new static site custom domain in an existing resource group and static site. + + Description for Creates a new static site custom domain in an existing resource group and + static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param domain_name: The custom domain to create. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteCustomDomainOverviewARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StaticSiteCustomDomainOverviewARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCustomDomainOverviewARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site_custom_domain.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteCustomDomainOverviewARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteCustomDomainOverviewARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site_custom_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}'} # type: ignore + + async def delete_static_site_custom_domain( + self, + resource_group_name: str, + name: str, + domain_name: str, + **kwargs + ) -> None: + """Deletes a custom domain. + + Description for Deletes a custom domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param domain_name: The custom domain to delete. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_static_site_custom_domain.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_static_site_custom_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}'} # type: ignore + + async def validate_custom_domain_can_be_added_to_static_site( + self, + resource_group_name: str, + name: str, + domain_name: str, + **kwargs + ) -> None: + """Validates a particular custom domain can be added to a static site. + + Description for Validates a particular custom domain can be added to a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param domain_name: The custom domain to validate. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.validate_custom_domain_can_be_added_to_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + validate_custom_domain_can_be_added_to_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}/validate'} # type: ignore + + async def detach_static_site( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Detaches a static site. + + Description for Detaches a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to detach. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.detach_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + detach_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/detach'} # type: ignore + + def list_static_site_functions( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.StaticSiteFunctionOverviewCollection"]: + """Gets the functions of a static site. + + Description for Gets the functions of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteFunctionOverviewCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.StaticSiteFunctionOverviewCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteFunctionOverviewCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteFunctionOverviewCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_static_site_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/functions'} # type: ignore + + async def list_static_site_function_app_settings( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.StringDictionary": + """Gets the application settings of a static site. + + Description for Gets the application settings of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listFunctionAppSettings'} # type: ignore + + async def list_static_site_secrets( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.StringDictionary": + """Lists the secrets for an existing static site. + + Description for Lists the secrets for an existing static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listSecrets'} # type: ignore + + async def reset_static_site_api_key( + self, + resource_group_name: str, + name: str, + reset_properties_envelope: "_models.StaticSiteResetPropertiesARMResource", + **kwargs + ) -> None: + """Resets the api key for an existing static site. + + Description for Resets the api key for an existing static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param reset_properties_envelope: + :type reset_properties_envelope: ~azure.mgmt.web.v2020_06_01.models.StaticSiteResetPropertiesARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.reset_static_site_api_key.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(reset_properties_envelope, 'StaticSiteResetPropertiesARMResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_static_site_api_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/resetapikey'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_top_level_domains_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_top_level_domains_operations.py new file mode 100644 index 000000000000..260d00029530 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_top_level_domains_operations.py @@ -0,0 +1,252 @@ +# 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, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class TopLevelDomainsOperations: + """TopLevelDomainsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.TopLevelDomainCollection"]: + """Get all top-level domains supported for registration. + + Description for Get all top-level domains supported for registration. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TopLevelDomainCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.TopLevelDomainCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TopLevelDomainCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TopLevelDomainCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains'} # type: ignore + + async def get( + self, + name: str, + **kwargs + ) -> "_models.TopLevelDomain": + """Get details of a top-level domain. + + Description for Get details of a top-level domain. + + :param name: Name of the top-level domain. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TopLevelDomain, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.TopLevelDomain + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TopLevelDomain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TopLevelDomain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}'} # type: ignore + + def list_agreements( + self, + name: str, + agreement_option: "_models.TopLevelDomainAgreementOption", + **kwargs + ) -> AsyncIterable["_models.TldLegalAgreementCollection"]: + """Gets all legal agreements that user needs to accept before purchasing a domain. + + Description for Gets all legal agreements that user needs to accept before purchasing a domain. + + :param name: Name of the top-level domain. + :type name: str + :param agreement_option: Domain agreement options. + :type agreement_option: ~azure.mgmt.web.v2020_06_01.models.TopLevelDomainAgreementOption + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TldLegalAgreementCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.TldLegalAgreementCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TldLegalAgreementCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_agreements.metadata['url'] # type: ignore + path_format_arguments = { + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(agreement_option, 'TopLevelDomainAgreementOption') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(agreement_option, 'TopLevelDomainAgreementOption') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TldLegalAgreementCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_agreements.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}/listAgreements'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_web_apps_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_web_apps_operations.py new file mode 100644 index 000000000000..4adb40f2092d --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_web_apps_operations.py @@ -0,0 +1,28546 @@ +# 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, Generic, IO, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WebAppsOperations: + """WebAppsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.WebAppCollection"]: + """Get all apps for a subscription. + + Description for Get all apps for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/sites'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + include_slots: Optional[bool] = None, + **kwargs + ) -> AsyncIterable["_models.WebAppCollection"]: + """Gets all web, mobile, and API apps in the specified resource group. + + Description for Gets all web, mobile, and API apps in the specified resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param include_slots: Specify :code:`true` to include deployment slots in + results. The default is false, which only gives you the production slot of all apps. + :type include_slots: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if include_slots is not None: + query_parameters['includeSlots'] = self._serialize.query("include_slots", include_slots, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.Web/sites'} # type: ignore + + async def get( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> Optional["_models.Site"]: + """Gets the details of a web, mobile, or API app. + + Description for Gets the details of a web, mobile, or API app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Site or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Site"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + name: str, + site_envelope: "_models.Site", + **kwargs + ) -> "_models.Site": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'Site') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + name: str, + site_envelope: "_models.Site", + **kwargs + ) -> AsyncLROPoller["_models.Site"]: + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2020_06_01.models.Site + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 Site or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + site_envelope=site_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + name: str, + delete_metrics: Optional[bool] = None, + delete_empty_server_farm: Optional[bool] = None, + **kwargs + ) -> None: + """Deletes a web, mobile, or API app, or one of the deployment slots. + + Description for Deletes a web, mobile, or API app, or one of the deployment slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app to delete. + :type name: str + :param delete_metrics: If true, web app metrics are also deleted. + :type delete_metrics: bool + :param delete_empty_server_farm: Specify false if you want to keep empty App Service plan. By + default, empty App Service plan is deleted. + :type delete_empty_server_farm: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if delete_metrics is not None: + query_parameters['deleteMetrics'] = self._serialize.query("delete_metrics", delete_metrics, 'bool') + if delete_empty_server_farm is not None: + query_parameters['deleteEmptyServerFarm'] = self._serialize.query("delete_empty_server_farm", delete_empty_server_farm, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + async def update( + self, + resource_group_name: str, + name: str, + site_envelope: "_models.SitePatchResource", + **kwargs + ) -> "_models.Site": + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2020_06_01.models.SitePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Site + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'SitePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + async def analyze_custom_hostname( + self, + resource_group_name: str, + name: str, + host_name: Optional[str] = None, + **kwargs + ) -> "_models.CustomHostnameAnalysisResult": + """Analyze a custom hostname. + + Description for Analyze a custom hostname. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param host_name: Custom hostname. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CustomHostnameAnalysisResult, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.CustomHostnameAnalysisResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomHostnameAnalysisResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.analyze_custom_hostname.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if host_name is not None: + query_parameters['hostName'] = self._serialize.query("host_name", host_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CustomHostnameAnalysisResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + analyze_custom_hostname.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/analyzeCustomHostname'} # type: ignore + + async def apply_slot_config_to_production( + self, + resource_group_name: str, + name: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs + ) -> None: + """Applies the configuration settings from the target slot onto the current slot. + + Description for Applies the configuration settings from the target slot onto the current slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_06_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.apply_slot_config_to_production.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + apply_slot_config_to_production.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/applySlotConfig'} # type: ignore + + async def backup( + self, + resource_group_name: str, + name: str, + request: "_models.BackupRequest", + **kwargs + ) -> "_models.BackupItem": + """Creates a backup of an app. + + Description for Creates a backup of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: Backup configuration. You can use the JSON response from the POST action as + input here. + :type request: ~azure.mgmt.web.v2020_06_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.backup.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backup'} # type: ignore + + def list_backups( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.BackupItemCollection"]: + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_backups.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_backups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups'} # type: ignore + + async def get_backup_status( + self, + resource_group_name: str, + name: str, + backup_id: str, + **kwargs + ) -> "_models.BackupItem": + """Gets a backup of an app by its ID. + + Description for Gets a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}'} # type: ignore + + async def delete_backup( + self, + resource_group_name: str, + name: str, + backup_id: str, + **kwargs + ) -> None: + """Deletes a backup of an app by its ID. + + Description for Deletes a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}'} # type: ignore + + async def list_backup_status_secrets( + self, + resource_group_name: str, + name: str, + backup_id: str, + request: "_models.BackupRequest", + **kwargs + ) -> "_models.BackupItem": + """Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + + Description for Gets status of a web app backup that may be in progress, including secrets + associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the + SAS URL for the backup if a new URL is passed in the request body. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param backup_id: ID of backup. + :type backup_id: str + :param request: Information on backup request. + :type request: ~azure.mgmt.web.v2020_06_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_backup_status_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_backup_status_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/list'} # type: ignore + + async def _restore_initial( + self, + resource_group_name: str, + name: str, + backup_id: str, + request: "_models.RestoreRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore'} # type: ignore + + async def begin_restore( + self, + resource_group_name: str, + name: str, + backup_id: str, + request: "_models.RestoreRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Restores a specific backup to another app (or deployment slot, if specified). + + Description for Restores a specific backup to another app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2020_06_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_initial( + resource_group_name=resource_group_name, + name=name, + backup_id=backup_id, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore'} # type: ignore + + async def get_basic_publishing_credentials_policies( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.CsmPublishingCredentialsPoliciesCollection": + """Returns whether Scm basic auth is allowed and whether Ftp is allowed for a given site. + + Description for Returns whether Scm basic auth is allowed and whether Ftp is allowed for a + given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesCollection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingCredentialsPoliciesCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_basic_publishing_credentials_policies.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_basic_publishing_credentials_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies'} # type: ignore + + async def get_ftp_allowed( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.CsmPublishingCredentialsPoliciesEntity": + """Returns whether FTP is allowed on the site or not. + + Description for Returns whether FTP is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_ftp_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ftp_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/ftp'} # type: ignore + + async def update_ftp_allowed( + self, + resource_group_name: str, + name: str, + csm_publishing_access_policies_entity: "_models.CsmPublishingCredentialsPoliciesEntity", + **kwargs + ) -> "_models.CsmPublishingCredentialsPoliciesEntity": + """Updates whether FTP is allowed on the site or not. + + Description for Updates whether FTP is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param csm_publishing_access_policies_entity: + :type csm_publishing_access_policies_entity: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingCredentialsPoliciesEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_ftp_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(csm_publishing_access_policies_entity, 'CsmPublishingCredentialsPoliciesEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_ftp_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/ftp'} # type: ignore + + async def get_scm_allowed( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.CsmPublishingCredentialsPoliciesEntity": + """Returns whether Scm basic auth is allowed on the site or not. + + Description for Returns whether Scm basic auth is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_scm_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_scm_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/scm'} # type: ignore + + async def update_scm_allowed( + self, + resource_group_name: str, + name: str, + csm_publishing_access_policies_entity: "_models.CsmPublishingCredentialsPoliciesEntity", + **kwargs + ) -> "_models.CsmPublishingCredentialsPoliciesEntity": + """Updates whether user publishing credentials are allowed on the site or not. + + Description for Updates whether user publishing credentials are allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param csm_publishing_access_policies_entity: + :type csm_publishing_access_policies_entity: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingCredentialsPoliciesEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_scm_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(csm_publishing_access_policies_entity, 'CsmPublishingCredentialsPoliciesEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_scm_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/scm'} # type: ignore + + def list_configurations( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.SiteConfigResourceCollection"]: + """List the configurations of an app. + + Description for List the configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigResourceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.SiteConfigResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configurations.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_configurations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config'} # type: ignore + + async def update_application_settings( + self, + resource_group_name: str, + name: str, + app_settings: "_models.StringDictionary", + **kwargs + ) -> "_models.StringDictionary": + """Replaces the application settings of an app. + + Description for Replaces the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param app_settings: Application settings of the app. + :type app_settings: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_application_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_application_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings'} # type: ignore + + async def list_application_settings( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.StringDictionary": + """Gets the application settings of an app. + + Description for Gets the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_application_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_application_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings/list'} # type: ignore + + async def update_auth_settings( + self, + resource_group_name: str, + name: str, + site_auth_settings: "_models.SiteAuthSettings", + **kwargs + ) -> "_models.SiteAuthSettings": + """Updates the Authentication / Authorization settings associated with web app. + + Description for Updates the Authentication / Authorization settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param site_auth_settings: Auth settings associated with web app. + :type site_auth_settings: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings, 'SiteAuthSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings'} # type: ignore + + async def get_auth_settings( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.SiteAuthSettings": + """Gets the Authentication/Authorization settings of an app. + + Description for Gets the Authentication/Authorization settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings/list'} # type: ignore + + async def update_auth_settings_v2( + self, + resource_group_name: str, + name: str, + site_auth_settings_v2: "_models.SiteAuthSettingsV2", + **kwargs + ) -> "_models.SiteAuthSettingsV2": + """Updates site's Authentication / Authorization settings for apps via the V2 format. + + Description for Updates site's Authentication / Authorization settings for apps via the V2 + format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param site_auth_settings_v2: Auth settings associated with web app. + :type site_auth_settings_v2: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettingsV2 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings_v2, 'SiteAuthSettingsV2') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2'} # type: ignore + + async def get_auth_settings_v2( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.SiteAuthSettingsV2": + """Gets site's Authentication / Authorization settings for apps via the V2 format. + + Description for Gets site's Authentication / Authorization settings for apps via the V2 format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2/list'} # type: ignore + + async def update_azure_storage_accounts( + self, + resource_group_name: str, + name: str, + azure_storage_accounts: "_models.AzureStoragePropertyDictionaryResource", + **kwargs + ) -> "_models.AzureStoragePropertyDictionaryResource": + """Updates the Azure storage account configurations of an app. + + Description for Updates the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param azure_storage_accounts: Azure storage accounts of the app. + :type azure_storage_accounts: ~azure.mgmt.web.v2020_06_01.models.AzureStoragePropertyDictionaryResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_azure_storage_accounts.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(azure_storage_accounts, 'AzureStoragePropertyDictionaryResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_azure_storage_accounts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts'} # type: ignore + + async def list_azure_storage_accounts( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.AzureStoragePropertyDictionaryResource": + """Gets the Azure storage account configurations of an app. + + Description for Gets the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_azure_storage_accounts.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_azure_storage_accounts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts/list'} # type: ignore + + async def update_backup_configuration( + self, + resource_group_name: str, + name: str, + request: "_models.BackupRequest", + **kwargs + ) -> "_models.BackupRequest": + """Updates the backup configuration of an app. + + Description for Updates the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: Edited backup configuration. + :type request: ~azure.mgmt.web.v2020_06_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_backup_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_backup_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup'} # type: ignore + + async def delete_backup_configuration( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Deletes the backup configuration of an app. + + Description for Deletes the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup'} # type: ignore + + async def get_backup_configuration( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.BackupRequest": + """Gets the backup configuration of an app. + + Description for Gets the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup/list'} # type: ignore + + async def update_connection_strings( + self, + resource_group_name: str, + name: str, + connection_strings: "_models.ConnectionStringDictionary", + **kwargs + ) -> "_models.ConnectionStringDictionary": + """Replaces the connection strings of an app. + + Description for Replaces the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_strings: Connection strings of the app or deployment slot. See example. + :type connection_strings: ~azure.mgmt.web.v2020_06_01.models.ConnectionStringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_connection_strings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_strings, 'ConnectionStringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_connection_strings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings'} # type: ignore + + async def list_connection_strings( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.ConnectionStringDictionary": + """Gets the connection strings of an app. + + Description for Gets the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_connection_strings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_connection_strings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings/list'} # type: ignore + + async def get_diagnostic_logs_configuration( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.SiteLogsConfig": + """Gets the logging configuration of an app. + + Description for Gets the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostic_logs_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostic_logs_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs'} # type: ignore + + async def update_diagnostic_logs_config( + self, + resource_group_name: str, + name: str, + site_logs_config: "_models.SiteLogsConfig", + **kwargs + ) -> "_models.SiteLogsConfig": + """Updates the logging configuration of an app. + + Description for Updates the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_logs_config: A SiteLogsConfig JSON object that contains the logging configuration + to change in the "properties" property. + :type site_logs_config: ~azure.mgmt.web.v2020_06_01.models.SiteLogsConfig + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_diagnostic_logs_config.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_logs_config, 'SiteLogsConfig') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_diagnostic_logs_config.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs'} # type: ignore + + async def update_metadata( + self, + resource_group_name: str, + name: str, + metadata: "_models.StringDictionary", + **kwargs + ) -> "_models.StringDictionary": + """Replaces the metadata of an app. + + Description for Replaces the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param metadata: Edited metadata of the app or deployment slot. See example. + :type metadata: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_metadata.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(metadata, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_metadata.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata'} # type: ignore + + async def list_metadata( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.StringDictionary": + """Gets the metadata of an app. + + Description for Gets the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_metadata.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_metadata.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata/list'} # type: ignore + + async def _list_publishing_credentials_initial( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.User": + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._list_publishing_credentials_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_publishing_credentials_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list'} # type: ignore + + async def begin_list_publishing_credentials( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncLROPoller["_models.User"]: + """Gets the Git/FTP publishing credentials of an app. + + Description for Gets the Git/FTP publishing credentials of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type 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: True for ARMPolling, False for no polling, or a + polling object for 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 User or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._list_publishing_credentials_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_publishing_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list'} # type: ignore + + async def update_site_push_settings( + self, + resource_group_name: str, + name: str, + push_settings: "_models.PushSettings", + **kwargs + ) -> "_models.PushSettings": + """Updates the Push settings associated with web app. + + Description for Updates the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param push_settings: Push settings associated with web app. + :type push_settings: ~azure.mgmt.web.v2020_06_01.models.PushSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_site_push_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(push_settings, 'PushSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_site_push_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings'} # type: ignore + + async def list_site_push_settings( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.PushSettings": + """Gets the Push settings associated with web app. + + Description for Gets the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_site_push_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_site_push_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings/list'} # type: ignore + + async def list_slot_configuration_names( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.SlotConfigNamesResource": + """Gets the names of app settings and connection strings that stick to the slot (not swapped). + + Description for Gets the names of app settings and connection strings that stick to the slot + (not swapped). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SlotConfigNamesResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SlotConfigNamesResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotConfigNamesResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_slot_configuration_names.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SlotConfigNamesResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_slot_configuration_names.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames'} # type: ignore + + async def update_slot_configuration_names( + self, + resource_group_name: str, + name: str, + slot_config_names: "_models.SlotConfigNamesResource", + **kwargs + ) -> "_models.SlotConfigNamesResource": + """Updates the names of application settings and connection string that remain with the slot during swap operation. + + Description for Updates the names of application settings and connection string that remain + with the slot during swap operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_config_names: Names of application settings and connection strings. See example. + :type slot_config_names: ~azure.mgmt.web.v2020_06_01.models.SlotConfigNamesResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SlotConfigNamesResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SlotConfigNamesResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotConfigNamesResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_slot_configuration_names.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_config_names, 'SlotConfigNamesResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SlotConfigNamesResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_slot_configuration_names.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames'} # type: ignore + + async def get_configuration( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.SiteConfigResource": + """Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, Always On, etc. + + Description for Gets the configuration of an app, such as platform version and bitness, default + documents, virtual applications, Always On, etc. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} # type: ignore + + async def create_or_update_configuration( + self, + resource_group_name: str, + name: str, + site_config: "_models.SiteConfigResource", + **kwargs + ) -> "_models.SiteConfigResource": + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} # type: ignore + + async def update_configuration( + self, + resource_group_name: str, + name: str, + site_config: "_models.SiteConfigResource", + **kwargs + ) -> "_models.SiteConfigResource": + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} # type: ignore + + def list_configuration_snapshot_info( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.SiteConfigurationSnapshotInfoCollection"]: + """Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. + + Description for Gets a list of web app configuration snapshots identifiers. Each element of the + list contains a timestamp and the ID of the snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigurationSnapshotInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.SiteConfigurationSnapshotInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigurationSnapshotInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configuration_snapshot_info.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigurationSnapshotInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_configuration_snapshot_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots'} # type: ignore + + async def get_configuration_snapshot( + self, + resource_group_name: str, + name: str, + snapshot_id: str, + **kwargs + ) -> "_models.SiteConfigResource": + """Gets a snapshot of the configuration of an app at a previous point in time. + + Description for Gets a snapshot of the configuration of an app at a previous point in time. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration_snapshot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}'} # type: ignore + + async def recover_site_configuration_snapshot( + self, + resource_group_name: str, + name: str, + snapshot_id: str, + **kwargs + ) -> None: + """Reverts the configuration of an app to a previous snapshot. + + Description for Reverts the configuration of an app to a previous snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.recover_site_configuration_snapshot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + recover_site_configuration_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}/recover'} # type: ignore + + async def get_web_site_container_logs( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> Optional[IO]: + """Gets the last lines of docker logs for the given site. + + Description for Gets the last lines of docker logs for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/octet-stream" + + # Construct URL + url = self.get_web_site_container_logs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_site_container_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs'} # type: ignore + + async def get_container_logs_zip( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> Optional[IO]: + """Gets the ZIP archived docker log files for the given site. + + Description for Gets the ZIP archived docker log files for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/zip" + + # Construct URL + url = self.get_container_logs_zip.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_container_logs_zip.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download'} # type: ignore + + def list_continuous_web_jobs( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.ContinuousWebJobCollection"]: + """List continuous web jobs for an app, or a deployment slot. + + Description for List continuous web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ContinuousWebJobCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ContinuousWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContinuousWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_continuous_web_jobs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ContinuousWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_continuous_web_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs'} # type: ignore + + async def get_continuous_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs + ) -> Optional["_models.ContinuousWebJob"]: + """Gets a continuous web job by its ID for an app, or a deployment slot. + + Description for Gets a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ContinuousWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ContinuousWebJob or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ContinuousWebJob"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ContinuousWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'} # type: ignore + + async def delete_continuous_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs + ) -> None: + """Delete a continuous web job by its ID for an app, or a deployment slot. + + Description for Delete a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'} # type: ignore + + async def start_continuous_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs + ) -> None: + """Start a continuous web job for an app, or a deployment slot. + + Description for Start a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.start_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start'} # type: ignore + + async def stop_continuous_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs + ) -> None: + """Stop a continuous web job for an app, or a deployment slot. + + Description for Stop a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.stop_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop'} # type: ignore + + def list_deployments( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.DeploymentCollection"]: + """List deployments for an app, or a deployment slot. + + Description for List deployments for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeploymentCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.DeploymentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_deployments.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DeploymentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_deployments.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments'} # type: ignore + + async def get_deployment( + self, + resource_group_name: str, + name: str, + id: str, + **kwargs + ) -> "_models.Deployment": + """Get a deployment by its ID for an app, or a deployment slot. + + Description for Get a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_deployment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} # type: ignore + + async def create_deployment( + self, + resource_group_name: str, + name: str, + id: str, + deployment: "_models.Deployment", + **kwargs + ) -> "_models.Deployment": + """Create a deployment for an app, or a deployment slot. + + Description for Create a deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: ID of an existing deployment. + :type id: str + :param deployment: Deployment details. + :type deployment: ~azure.mgmt.web.v2020_06_01.models.Deployment + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_deployment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(deployment, 'Deployment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} # type: ignore + + async def delete_deployment( + self, + resource_group_name: str, + name: str, + id: str, + **kwargs + ) -> None: + """Delete a deployment by its ID for an app, or a deployment slot. + + Description for Delete a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_deployment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} # type: ignore + + async def list_deployment_log( + self, + resource_group_name: str, + name: str, + id: str, + **kwargs + ) -> "_models.Deployment": + """List deployment log for specific deployment for an app, or a deployment slot. + + Description for List deployment log for specific deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: The ID of a specific deployment. This is the value of the name property in the JSON + response from "GET /api/sites/{siteName}/deployments". + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_deployment_log.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_deployment_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log'} # type: ignore + + async def discover_backup( + self, + resource_group_name: str, + name: str, + request: "_models.RestoreRequest", + **kwargs + ) -> "_models.RestoreRequest": + """Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information about the databases stored in a backup. + + Description for Discovers an existing app backup that can be restored from a blob in Azure + storage. Use this to get information about the databases stored in a backup. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: A RestoreRequest object that includes Azure storage URL and blog name for + discovery of backup. + :type request: ~azure.mgmt.web.v2020_06_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RestoreRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RestoreRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestoreRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.discover_backup.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RestoreRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + discover_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup'} # type: ignore + + def list_domain_ownership_identifiers( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.IdentifierCollection"]: + """Lists ownership identifiers for domain associated with web app. + + Description for Lists ownership identifiers for domain associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IdentifierCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.IdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_domain_ownership_identifiers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_domain_ownership_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers'} # type: ignore + + async def get_domain_ownership_identifier( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + **kwargs + ) -> "_models.Identifier": + """Get domain ownership identifier for web app. + + Description for Get domain ownership identifier for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def create_or_update_domain_ownership_identifier( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + domain_ownership_identifier: "_models.Identifier", + **kwargs + ) -> "_models.Identifier": + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_06_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def delete_domain_ownership_identifier( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + **kwargs + ) -> None: + """Deletes a domain ownership identifier for a web app. + + Description for Deletes a domain ownership identifier for a web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def update_domain_ownership_identifier( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + domain_ownership_identifier: "_models.Identifier", + **kwargs + ) -> "_models.Identifier": + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_06_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def get_ms_deploy_status( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.MSDeployStatus": + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} # type: ignore + + async def _create_ms_deploy_operation_initial( + self, + resource_group_name: str, + name: str, + ms_deploy: "_models.MSDeploy", + **kwargs + ) -> Optional["_models.MSDeployStatus"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployStatus"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_ms_deploy_operation_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201, 409]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_ms_deploy_operation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} # type: ignore + + async def begin_create_ms_deploy_operation( + self, + resource_group_name: str, + name: str, + ms_deploy: "_models.MSDeploy", + **kwargs + ) -> AsyncLROPoller["_models.MSDeployStatus"]: + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2020_06_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_ms_deploy_operation_initial( + resource_group_name=resource_group_name, + name=name, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_ms_deploy_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} # type: ignore + + async def get_ms_deploy_log( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> Optional["_models.MSDeployLog"]: + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.MSDeployLog or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployLog"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_log.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log'} # type: ignore + + def list_functions( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.FunctionEnvelopeCollection"]: + """List the functions for a web site, or a deployment slot. + + Description for List the functions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FunctionEnvelopeCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.FunctionEnvelopeCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelopeCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('FunctionEnvelopeCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions'} # type: ignore + + async def get_functions_admin_token( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> str: + """Fetch a short lived token that can be exchanged for a master key. + + Description for Fetch a short lived token that can be exchanged for a master key. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_functions_admin_token.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_functions_admin_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token'} # type: ignore + + async def get_function( + self, + resource_group_name: str, + name: str, + function_name: str, + **kwargs + ) -> Optional["_models.FunctionEnvelope"]: + """Get function information by its ID for web site, or a deployment slot. + + Description for Get function information by its ID for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionEnvelope, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.FunctionEnvelope or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FunctionEnvelope"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_function.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + async def _create_function_initial( + self, + resource_group_name: str, + name: str, + function_name: str, + function_envelope: "_models.FunctionEnvelope", + **kwargs + ) -> "_models.FunctionEnvelope": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_function_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(function_envelope, 'FunctionEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_function_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + async def begin_create_function( + self, + resource_group_name: str, + name: str, + function_name: str, + function_envelope: "_models.FunctionEnvelope", + **kwargs + ) -> AsyncLROPoller["_models.FunctionEnvelope"]: + """Create function for web site, or a deployment slot. + + Description for Create function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param function_envelope: Function details. + :type function_envelope: ~azure.mgmt.web.v2020_06_01.models.FunctionEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 FunctionEnvelope or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.FunctionEnvelope] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_function_initial( + resource_group_name=resource_group_name, + name=name, + function_name=function_name, + function_envelope=function_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + async def delete_function( + self, + resource_group_name: str, + name: str, + function_name: str, + **kwargs + ) -> None: + """Delete a function for web site, or a deployment slot. + + Description for Delete a function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_function.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + async def create_or_update_function_secret( + self, + resource_group_name: str, + name: str, + function_name: str, + key_name: str, + key: "_models.KeyInfo", + **kwargs + ) -> "_models.KeyInfo": + """Add or update a function secret. + + Description for Add or update a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2020_06_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_function_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_function_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}'} # type: ignore + + async def delete_function_secret( + self, + resource_group_name: str, + name: str, + function_name: str, + key_name: str, + **kwargs + ) -> None: + """Delete a function secret. + + Description for Delete a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_function_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_function_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}'} # type: ignore + + async def list_function_keys( + self, + resource_group_name: str, + name: str, + function_name: str, + **kwargs + ) -> "_models.StringDictionary": + """Get function keys for a function in a web site, or a deployment slot. + + Description for Get function keys for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_function_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listkeys'} # type: ignore + + async def list_function_secrets( + self, + resource_group_name: str, + name: str, + function_name: str, + **kwargs + ) -> "_models.FunctionSecrets": + """Get function secrets for a function in a web site, or a deployment slot. + + Description for Get function secrets for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_function_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets'} # type: ignore + + async def list_host_keys( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.HostKeys": + """Get host secrets for a function app. + + Description for Get host secrets for a function app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostKeys, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HostKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_host_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_host_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listkeys'} # type: ignore + + async def list_sync_status( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + list_sync_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listsyncstatus'} # type: ignore + + async def sync_functions( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.sync_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/sync'} # type: ignore + + async def create_or_update_host_secret( + self, + resource_group_name: str, + name: str, + key_type: str, + key_name: str, + key: "_models.KeyInfo", + **kwargs + ) -> "_models.KeyInfo": + """Add or update a host level secret. + + Description for Add or update a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2020_06_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}'} # type: ignore + + async def delete_host_secret( + self, + resource_group_name: str, + name: str, + key_type: str, + key_name: str, + **kwargs + ) -> None: + """Delete a host level secret. + + Description for Delete a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}'} # type: ignore + + def list_host_name_bindings( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.HostNameBindingCollection"]: + """Get hostname bindings for an app or a deployment slot. + + Description for Get hostname bindings for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HostNameBindingCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.HostNameBindingCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBindingCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_host_name_bindings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('HostNameBindingCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_host_name_bindings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings'} # type: ignore + + async def get_host_name_binding( + self, + resource_group_name: str, + name: str, + host_name: str, + **kwargs + ) -> "_models.HostNameBinding": + """Get the named hostname binding for an app (or deployment slot, if specified). + + Description for Get the named hostname binding for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_host_name_binding.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} # type: ignore + + async def create_or_update_host_name_binding( + self, + resource_group_name: str, + name: str, + host_name: str, + host_name_binding: "_models.HostNameBinding", + **kwargs + ) -> "_models.HostNameBinding": + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :param host_name_binding: Binding details. This is the JSON representation of a HostNameBinding + object. + :type host_name_binding: ~azure.mgmt.web.v2020_06_01.models.HostNameBinding + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_name_binding.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(host_name_binding, 'HostNameBinding') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} # type: ignore + + async def delete_host_name_binding( + self, + resource_group_name: str, + name: str, + host_name: str, + **kwargs + ) -> None: + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_name_binding.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} # type: ignore + + async def get_hybrid_connection( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + **kwargs + ) -> "_models.HybridConnection": + """Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def create_or_update_hybrid_connection( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + connection_envelope: "_models.HybridConnection", + **kwargs + ) -> "_models.HybridConnection": + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def delete_hybrid_connection( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + **kwargs + ) -> None: + """Removes a Hybrid Connection from this site. + + Description for Removes a Hybrid Connection from this site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def update_hybrid_connection( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + connection_envelope: "_models.HybridConnection", + **kwargs + ) -> "_models.HybridConnection": + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def list_hybrid_connections( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.HybridConnection": + """Retrieves all Service Bus Hybrid Connections used by this Web App. + + Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_hybrid_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_hybrid_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays'} # type: ignore + + async def list_relay_service_connections( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.RelayServiceConnectionEntity": + """Gets hybrid connections configured for an app (or deployment slot, if specified). + + Description for Gets hybrid connections configured for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_relay_service_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_relay_service_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection'} # type: ignore + + async def get_relay_service_connection( + self, + resource_group_name: str, + name: str, + entity_name: str, + **kwargs + ) -> "_models.RelayServiceConnectionEntity": + """Gets a hybrid connection configuration by its name. + + Description for Gets a hybrid connection configuration by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection. + :type entity_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + async def create_or_update_relay_service_connection( + self, + resource_group_name: str, + name: str, + entity_name: str, + connection_envelope: "_models.RelayServiceConnectionEntity", + **kwargs + ) -> "_models.RelayServiceConnectionEntity": + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + async def delete_relay_service_connection( + self, + resource_group_name: str, + name: str, + entity_name: str, + **kwargs + ) -> None: + """Deletes a relay service connection by its name. + + Description for Deletes a relay service connection by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + async def update_relay_service_connection( + self, + resource_group_name: str, + name: str, + entity_name: str, + connection_envelope: "_models.RelayServiceConnectionEntity", + **kwargs + ) -> "_models.RelayServiceConnectionEntity": + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + def list_instance_identifiers( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.WebAppInstanceStatusCollection"]: + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppInstanceStatusCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.WebAppInstanceStatusCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppInstanceStatusCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_identifiers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppInstanceStatusCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances'} # type: ignore + + async def get_instance_info( + self, + resource_group_name: str, + name: str, + instance_id: str, + **kwargs + ) -> "_models.WebSiteInstanceStatus": + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param instance_id: + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebSiteInstanceStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.WebSiteInstanceStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebSiteInstanceStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_info.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebSiteInstanceStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}'} # type: ignore + + async def get_instance_ms_deploy_status( + self, + resource_group_name: str, + name: str, + instance_id: str, + **kwargs + ) -> "_models.MSDeployStatus": + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + async def _create_instance_ms_deploy_operation_initial( + self, + resource_group_name: str, + name: str, + instance_id: str, + ms_deploy: "_models.MSDeploy", + **kwargs + ) -> Optional["_models.MSDeployStatus"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployStatus"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_instance_ms_deploy_operation_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201, 409]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_instance_ms_deploy_operation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + async def begin_create_instance_ms_deploy_operation( + self, + resource_group_name: str, + name: str, + instance_id: str, + ms_deploy: "_models.MSDeploy", + **kwargs + ) -> AsyncLROPoller["_models.MSDeployStatus"]: + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param instance_id: ID of web app instance. + :type instance_id: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2020_06_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_instance_ms_deploy_operation_initial( + resource_group_name=resource_group_name, + name=name, + instance_id=instance_id, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_instance_ms_deploy_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + async def get_instance_ms_deploy_log( + self, + resource_group_name: str, + name: str, + instance_id: str, + **kwargs + ) -> Optional["_models.MSDeployLog"]: + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.MSDeployLog or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployLog"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_log.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log'} # type: ignore + + def list_instance_processes( + self, + resource_group_name: str, + name: str, + instance_id: str, + **kwargs + ) -> AsyncIterable["_models.ProcessInfoCollection"]: + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_processes.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_processes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes'} # type: ignore + + async def get_instance_process( + self, + resource_group_name: str, + name: str, + process_id: str, + instance_id: str, + **kwargs + ) -> Optional["_models.ProcessInfo"]: + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ProcessInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'} # type: ignore + + async def delete_instance_process( + self, + resource_group_name: str, + name: str, + process_id: str, + instance_id: str, + **kwargs + ) -> None: + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_instance_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_instance_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'} # type: ignore + + async def get_instance_process_dump( + self, + resource_group_name: str, + name: str, + process_id: str, + instance_id: str, + **kwargs + ) -> Optional[IO]: + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_dump.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_dump.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump'} # type: ignore + + def list_instance_process_modules( + self, + resource_group_name: str, + name: str, + process_id: str, + instance_id: str, + **kwargs + ) -> AsyncIterable["_models.ProcessModuleInfoCollection"]: + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessModuleInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_modules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_process_modules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules'} # type: ignore + + async def get_instance_process_module( + self, + resource_group_name: str, + name: str, + process_id: str, + base_address: str, + instance_id: str, + **kwargs + ) -> Optional["_models.ProcessModuleInfo"]: + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ProcessModuleInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessModuleInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_module.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_module.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_instance_process_threads( + self, + resource_group_name: str, + name: str, + process_id: str, + instance_id: str, + **kwargs + ) -> AsyncIterable["_models.ProcessThreadInfoCollection"]: + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessThreadInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_threads.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_process_threads.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads'} # type: ignore + + async def is_cloneable( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.SiteCloneability": + """Shows whether an app can be cloned to another resource group or subscription. + + Description for Shows whether an app can be cloned to another resource group or subscription. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteCloneability, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteCloneability + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteCloneability"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.is_cloneable.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteCloneability', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + is_cloneable.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable'} # type: ignore + + def list_site_backups( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.BackupItemCollection"]: + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_backups.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_backups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listbackups'} # type: ignore + + async def list_sync_function_triggers( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.FunctionSecrets": + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_function_triggers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_sync_function_triggers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus'} # type: ignore + + async def _migrate_storage_initial( + self, + subscription_name: str, + resource_group_name: str, + name: str, + migration_options: "_models.StorageMigrationOptions", + **kwargs + ) -> "_models.StorageMigrationResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageMigrationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._migrate_storage_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['subscriptionName'] = self._serialize.query("subscription_name", subscription_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(migration_options, 'StorageMigrationOptions') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageMigrationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _migrate_storage_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate'} # type: ignore + + async def begin_migrate_storage( + self, + subscription_name: str, + resource_group_name: str, + name: str, + migration_options: "_models.StorageMigrationOptions", + **kwargs + ) -> AsyncLROPoller["_models.StorageMigrationResponse"]: + """Restores a web app. + + Description for Restores a web app. + + :param subscription_name: Azure subscription. + :type subscription_name: str + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param migration_options: Migration migrationOptions. + :type migration_options: ~azure.mgmt.web.v2020_06_01.models.StorageMigrationOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 StorageMigrationResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.StorageMigrationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageMigrationResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._migrate_storage_initial( + subscription_name=subscription_name, + resource_group_name=resource_group_name, + name=name, + migration_options=migration_options, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageMigrationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_migrate_storage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate'} # type: ignore + + async def _migrate_my_sql_initial( + self, + resource_group_name: str, + name: str, + migration_request_envelope: "_models.MigrateMySqlRequest", + **kwargs + ) -> "_models.Operation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Operation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._migrate_my_sql_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(migration_request_envelope, 'MigrateMySqlRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Operation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _migrate_my_sql_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql'} # type: ignore + + async def begin_migrate_my_sql( + self, + resource_group_name: str, + name: str, + migration_request_envelope: "_models.MigrateMySqlRequest", + **kwargs + ) -> AsyncLROPoller["_models.Operation"]: + """Migrates a local (in-app) MySql database to a remote MySql database. + + Description for Migrates a local (in-app) MySql database to a remote MySql database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param migration_request_envelope: MySql migration options. + :type migration_request_envelope: ~azure.mgmt.web.v2020_06_01.models.MigrateMySqlRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 Operation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Operation"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._migrate_my_sql_initial( + resource_group_name=resource_group_name, + name=name, + migration_request_envelope=migration_request_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Operation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_migrate_my_sql.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql'} # type: ignore + + async def get_migrate_my_sql_status( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.MigrateMySqlStatus": + """Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. + + Description for Returns the status of MySql in app migration, if one is active, and whether or + not MySql in app is enabled. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MigrateMySqlStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.MigrateMySqlStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrateMySqlStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_migrate_my_sql_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MigrateMySqlStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_migrate_my_sql_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status'} # type: ignore + + async def get_swift_virtual_network_connection( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.SwiftVirtualNetwork": + """Gets a Swift Virtual Network connection. + + Description for Gets a Swift Virtual Network connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_swift_virtual_network_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + async def create_or_update_swift_virtual_network_connection( + self, + resource_group_name: str, + name: str, + connection_envelope: "_models.SwiftVirtualNetwork", + **kwargs + ) -> "_models.SwiftVirtualNetwork": + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_swift_virtual_network_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + async def delete_swift_virtual_network( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Deletes a Swift Virtual Network connection from an app (or deployment slot). + + Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_swift_virtual_network.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_swift_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + async def update_swift_virtual_network_connection( + self, + resource_group_name: str, + name: str, + connection_envelope: "_models.SwiftVirtualNetwork", + **kwargs + ) -> "_models.SwiftVirtualNetwork": + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_swift_virtual_network_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + async def list_network_features( + self, + resource_group_name: str, + name: str, + view: str, + **kwargs + ) -> Optional["_models.NetworkFeatures"]: + """Gets all network features used by the app (or deployment slot, if specified). + + Description for Gets all network features used by the app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param view: The type of view. This can either be "summary" or "detailed". + :type view: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFeatures, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.NetworkFeatures or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NetworkFeatures"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_network_features.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'view': self._serialize.url("view", view, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('NetworkFeatures', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_network_features.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}'} # type: ignore + + async def get_network_trace_operation( + self, + resource_group_name: str, + name: str, + operation_id: str, + **kwargs + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}'} # type: ignore + + async def start_web_site_network_trace( + self, + resource_group_name: str, + name: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs + ) -> str: + """Start capturing network packets for the site (To be deprecated). + + Description for Start capturing network packets for the site (To be deprecated). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.start_web_site_network_trace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + start_web_site_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start'} # type: ignore + + async def _start_web_site_network_trace_operation_initial( + self, + resource_group_name: str, + name: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs + ) -> List["_models.NetworkTrace"]: + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._start_web_site_network_trace_operation_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_web_site_network_trace_operation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation'} # type: ignore + + async def begin_start_web_site_network_trace_operation( + self, + resource_group_name: str, + name: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller[List["_models.NetworkTrace"]]: + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_web_site_network_trace_operation_initial( + resource_group_name=resource_group_name, + name=name, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_web_site_network_trace_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation'} # type: ignore + + async def stop_web_site_network_trace( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.stop_web_site_network_trace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_web_site_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop'} # type: ignore + + async def get_network_traces( + self, + resource_group_name: str, + name: str, + operation_id: str, + **kwargs + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}'} # type: ignore + + async def get_network_trace_operation_v2( + self, + resource_group_name: str, + name: str, + operation_id: str, + **kwargs + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}'} # type: ignore + + async def get_network_traces_v2( + self, + resource_group_name: str, + name: str, + operation_id: str, + **kwargs + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}'} # type: ignore + + async def generate_new_site_publishing_password( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Generates a new publishing password for an app (or deployment slot, if specified). + + Description for Generates a new publishing password for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.generate_new_site_publishing_password.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + generate_new_site_publishing_password.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword'} # type: ignore + + def list_perf_mon_counters( + self, + resource_group_name: str, + name: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.PerfMonCounterCollection"]: + """Gets perfmon counters for web app. + + Description for Gets perfmon counters for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z + and timeGrain eq duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PerfMonCounterCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.PerfMonCounterCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PerfMonCounterCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_perf_mon_counters.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PerfMonCounterCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_perf_mon_counters.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters'} # type: ignore + + async def get_site_php_error_log_flag( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.SitePhpErrorLogFlag": + """Gets web app's event logs. + + Description for Gets web app's event logs. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SitePhpErrorLogFlag, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SitePhpErrorLogFlag + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SitePhpErrorLogFlag"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_php_error_log_flag.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SitePhpErrorLogFlag', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_php_error_log_flag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging'} # type: ignore + + async def list_premier_add_ons( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.PremierAddOn": + """Gets the premier add-ons of an app. + + Description for Gets the premier add-ons of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_premier_add_ons.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_premier_add_ons.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons'} # type: ignore + + async def get_premier_add_on( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + **kwargs + ) -> "_models.PremierAddOn": + """Gets a named add-on of an app. + + Description for Gets a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + async def add_premier_add_on( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + premier_add_on: "_models.PremierAddOn", + **kwargs + ) -> "_models.PremierAddOn": + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2020_06_01.models.PremierAddOn + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.add_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOn') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + add_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + async def delete_premier_add_on( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + **kwargs + ) -> None: + """Delete a premier add-on from an app. + + Description for Delete a premier add-on from an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + async def update_premier_add_on( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + premier_add_on: "_models.PremierAddOnPatchResource", + **kwargs + ) -> "_models.PremierAddOn": + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2020_06_01.models.PremierAddOnPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOnPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + async def get_private_access( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.PrivateAccess": + """Gets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Gets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_private_access.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'} # type: ignore + + async def put_private_access_vnet( + self, + resource_group_name: str, + name: str, + access: "_models.PrivateAccess", + **kwargs + ) -> "_models.PrivateAccess": + """Sets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Sets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param access: The information for the private access. + :type access: ~azure.mgmt.web.v2020_06_01.models.PrivateAccess + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put_private_access_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(access, 'PrivateAccess') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_private_access_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'} # type: ignore + + def list_processes( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.ProcessInfoCollection"]: + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_processes.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_processes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes'} # type: ignore + + async def get_process( + self, + resource_group_name: str, + name: str, + process_id: str, + **kwargs + ) -> Optional["_models.ProcessInfo"]: + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ProcessInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'} # type: ignore + + async def delete_process( + self, + resource_group_name: str, + name: str, + process_id: str, + **kwargs + ) -> None: + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'} # type: ignore + + async def get_process_dump( + self, + resource_group_name: str, + name: str, + process_id: str, + **kwargs + ) -> Optional[IO]: + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_process_dump.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_dump.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump'} # type: ignore + + def list_process_modules( + self, + resource_group_name: str, + name: str, + process_id: str, + **kwargs + ) -> AsyncIterable["_models.ProcessModuleInfoCollection"]: + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessModuleInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_modules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_process_modules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules'} # type: ignore + + async def get_process_module( + self, + resource_group_name: str, + name: str, + process_id: str, + base_address: str, + **kwargs + ) -> Optional["_models.ProcessModuleInfo"]: + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ProcessModuleInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessModuleInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_process_module.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_module.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_process_threads( + self, + resource_group_name: str, + name: str, + process_id: str, + **kwargs + ) -> AsyncIterable["_models.ProcessThreadInfoCollection"]: + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessThreadInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_threads.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_process_threads.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads'} # type: ignore + + def list_public_certificates( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.PublicCertificateCollection"]: + """Get public certificates for an app or a deployment slot. + + Description for Get public certificates for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicCertificateCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.PublicCertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_public_certificates.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PublicCertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_public_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates'} # type: ignore + + async def get_public_certificate( + self, + resource_group_name: str, + name: str, + public_certificate_name: str, + **kwargs + ) -> "_models.PublicCertificate": + """Get the named public certificate for an app (or deployment slot, if specified). + + Description for Get the named public certificate for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_public_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} # type: ignore + + async def create_or_update_public_certificate( + self, + resource_group_name: str, + name: str, + public_certificate_name: str, + public_certificate: "_models.PublicCertificate", + **kwargs + ) -> "_models.PublicCertificate": + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :param public_certificate: Public certificate details. This is the JSON representation of a + PublicCertificate object. + :type public_certificate: ~azure.mgmt.web.v2020_06_01.models.PublicCertificate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_public_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(public_certificate, 'PublicCertificate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} # type: ignore + + async def delete_public_certificate( + self, + resource_group_name: str, + name: str, + public_certificate_name: str, + **kwargs + ) -> None: + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_public_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} # type: ignore + + async def list_publishing_profile_xml_with_secrets( + self, + resource_group_name: str, + name: str, + publishing_profile_options: "_models.CsmPublishingProfileOptions", + **kwargs + ) -> IO: + """Gets the publishing profile for an app (or deployment slot, if specified). + + Description for Gets the publishing profile for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param publishing_profile_options: Specifies publishingProfileOptions for publishing profile. + For example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + :type publishing_profile_options: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingProfileOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/xml" + + # Construct URL + url = self.list_publishing_profile_xml_with_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(publishing_profile_options, 'CsmPublishingProfileOptions') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_publishing_profile_xml_with_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml'} # type: ignore + + async def reset_production_slot_config( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Resets the configuration settings of the current slot if they were previously modified by calling the API with POST. + + Description for Resets the configuration settings of the current slot if they were previously + modified by calling the API with POST. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.reset_production_slot_config.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_production_slot_config.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig'} # type: ignore + + async def restart( + self, + resource_group_name: str, + name: str, + soft_restart: Optional[bool] = None, + synchronous: Optional[bool] = None, + **kwargs + ) -> None: + """Restarts an app (or deployment slot, if specified). + + Description for Restarts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param soft_restart: Specify true to apply the configuration settings and restarts the app only + if necessary. By default, the API always restarts and reprovisions the app. + :type soft_restart: bool + :param synchronous: Specify true to block until the app is restarted. By default, it is set to + false, and the API responds immediately (asynchronous). + :type synchronous: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.restart.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if soft_restart is not None: + query_parameters['softRestart'] = self._serialize.query("soft_restart", soft_restart, 'bool') + if synchronous is not None: + query_parameters['synchronous'] = self._serialize.query("synchronous", synchronous, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart'} # type: ignore + + async def _restore_from_backup_blob_initial( + self, + resource_group_name: str, + name: str, + request: "_models.RestoreRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_backup_blob_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_backup_blob_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob'} # type: ignore + + async def begin_restore_from_backup_blob( + self, + resource_group_name: str, + name: str, + request: "_models.RestoreRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Restores an app from a backup blob in Azure Storage. + + Description for Restores an app from a backup blob in Azure Storage. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2020_06_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_from_backup_blob_initial( + resource_group_name=resource_group_name, + name=name, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_backup_blob.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob'} # type: ignore + + async def _restore_from_deleted_app_initial( + self, + resource_group_name: str, + name: str, + restore_request: "_models.DeletedAppRestoreRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_deleted_app_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'DeletedAppRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_deleted_app_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp'} # type: ignore + + async def begin_restore_from_deleted_app( + self, + resource_group_name: str, + name: str, + restore_request: "_models.DeletedAppRestoreRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Restores a deleted web app to this web app. + + Description for Restores a deleted web app to this web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param restore_request: Deleted web app restore information. + :type restore_request: ~azure.mgmt.web.v2020_06_01.models.DeletedAppRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_from_deleted_app_initial( + resource_group_name=resource_group_name, + name=name, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_deleted_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp'} # type: ignore + + async def _restore_snapshot_initial( + self, + resource_group_name: str, + name: str, + restore_request: "_models.SnapshotRestoreRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_snapshot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'SnapshotRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_snapshot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot'} # type: ignore + + async def begin_restore_snapshot( + self, + resource_group_name: str, + name: str, + restore_request: "_models.SnapshotRestoreRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Restores a web app from a snapshot. + + Description for Restores a web app from a snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param restore_request: Snapshot restore settings. Snapshot information can be obtained by + calling GetDeletedSites or GetSiteSnapshots API. + :type restore_request: ~azure.mgmt.web.v2020_06_01.models.SnapshotRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_snapshot_initial( + resource_group_name=resource_group_name, + name=name, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot'} # type: ignore + + def list_site_extensions( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.SiteExtensionInfoCollection"]: + """Get list of siteextensions for a web site, or a deployment slot. + + Description for Get list of siteextensions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteExtensionInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.SiteExtensionInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_extensions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_extensions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions'} # type: ignore + + async def get_site_extension( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + **kwargs + ) -> Optional["_models.SiteExtensionInfo"]: + """Get site extension information by its ID for a web site, or a deployment slot. + + Description for Get site extension information by its ID for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteExtensionInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteExtensionInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SiteExtensionInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_extension.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + async def _install_site_extension_initial( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + **kwargs + ) -> Optional["_models.SiteExtensionInfo"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SiteExtensionInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._install_site_extension_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 429]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _install_site_extension_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + async def begin_install_site_extension( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + **kwargs + ) -> AsyncLROPoller["_models.SiteExtensionInfo"]: + """Install site extension on a web site, or a deployment slot. + + Description for Install site extension on a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 SiteExtensionInfo or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.SiteExtensionInfo] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfo"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._install_site_extension_initial( + resource_group_name=resource_group_name, + name=name, + site_extension_id=site_extension_id, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + async def delete_site_extension( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + **kwargs + ) -> None: + """Remove a site extension from a web site, or a deployment slot. + + Description for Remove a site extension from a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_site_extension.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + async def _copy_production_slot_initial( + self, + resource_group_name: str, + name: str, + copy_slot_entity: "_models.CsmCopySlotEntity", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._copy_production_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(copy_slot_entity, 'CsmCopySlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _copy_production_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotcopy'} # type: ignore + + async def begin_copy_production_slot( + self, + resource_group_name: str, + name: str, + copy_slot_entity: "_models.CsmCopySlotEntity", + **kwargs + ) -> AsyncLROPoller[None]: + """Copies a deployment slot to another deployment slot of an app. + + Description for Copies a deployment slot to another deployment slot of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param copy_slot_entity: JSON object that contains the target slot name and site config + properties to override the source slot config. See example. + :type copy_slot_entity: ~azure.mgmt.web.v2020_06_01.models.CsmCopySlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._copy_production_slot_initial( + resource_group_name=resource_group_name, + name=name, + copy_slot_entity=copy_slot_entity, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_copy_production_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotcopy'} # type: ignore + + def list_slots( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.WebAppCollection"]: + """Gets an app's deployment slots. + + Description for Gets an app's deployment slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_slots.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_slots.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots'} # type: ignore + + async def get_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> Optional["_models.Site"]: + """Gets the details of a web, mobile, or API app. + + Description for Gets the details of a web, mobile, or API app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. By default, this API returns the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Site or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Site"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + async def _create_or_update_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + site_envelope: "_models.Site", + **kwargs + ) -> "_models.Site": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'Site') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + async def begin_create_or_update_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_envelope: "_models.Site", + **kwargs + ) -> AsyncLROPoller["_models.Site"]: + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param slot: Name of the deployment slot to create or update. By default, this API attempts to + create or modify the production slot. + :type slot: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2020_06_01.models.Site + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 Site or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + site_envelope=site_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + async def delete_slot( + self, + resource_group_name: str, + name: str, + slot: str, + delete_metrics: Optional[bool] = None, + delete_empty_server_farm: Optional[bool] = None, + **kwargs + ) -> None: + """Deletes a web, mobile, or API app, or one of the deployment slots. + + Description for Deletes a web, mobile, or API app, or one of the deployment slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app to delete. + :type name: str + :param slot: Name of the deployment slot to delete. By default, the API deletes the production + slot. + :type slot: str + :param delete_metrics: If true, web app metrics are also deleted. + :type delete_metrics: bool + :param delete_empty_server_farm: Specify true if the App Service plan will be empty after app + deletion and you want to delete the empty App Service plan. By default, the empty App Service + plan is not deleted. + :type delete_empty_server_farm: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if delete_metrics is not None: + query_parameters['deleteMetrics'] = self._serialize.query("delete_metrics", delete_metrics, 'bool') + if delete_empty_server_farm is not None: + query_parameters['deleteEmptyServerFarm'] = self._serialize.query("delete_empty_server_farm", delete_empty_server_farm, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + async def update_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_envelope: "_models.SitePatchResource", + **kwargs + ) -> "_models.Site": + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param slot: Name of the deployment slot to create or update. By default, this API attempts to + create or modify the production slot. + :type slot: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2020_06_01.models.SitePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Site + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'SitePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + async def analyze_custom_hostname_slot( + self, + resource_group_name: str, + name: str, + slot: str, + host_name: Optional[str] = None, + **kwargs + ) -> "_models.CustomHostnameAnalysisResult": + """Analyze a custom hostname. + + Description for Analyze a custom hostname. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param host_name: Custom hostname. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CustomHostnameAnalysisResult, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.CustomHostnameAnalysisResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomHostnameAnalysisResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.analyze_custom_hostname_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if host_name is not None: + query_parameters['hostName'] = self._serialize.query("host_name", host_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CustomHostnameAnalysisResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + analyze_custom_hostname_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/analyzeCustomHostname'} # type: ignore + + async def apply_slot_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs + ) -> None: + """Applies the configuration settings from the target slot onto the current slot. + + Description for Applies the configuration settings from the target slot onto the current slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_06_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.apply_slot_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + apply_slot_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig'} # type: ignore + + async def backup_slot( + self, + resource_group_name: str, + name: str, + slot: str, + request: "_models.BackupRequest", + **kwargs + ) -> "_models.BackupItem": + """Creates a backup of an app. + + Description for Creates a backup of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create a + backup for the production slot. + :type slot: str + :param request: Backup configuration. You can use the JSON response from the POST action as + input here. + :type request: ~azure.mgmt.web.v2020_06_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.backup_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup'} # type: ignore + + def list_backups_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.BackupItemCollection"]: + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get backups + of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_backups_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_backups_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups'} # type: ignore + + async def get_backup_status_slot( + self, + resource_group_name: str, + name: str, + backup_id: str, + slot: str, + **kwargs + ) -> "_models.BackupItem": + """Gets a backup of an app by its ID. + + Description for Gets a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a backup + of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}'} # type: ignore + + async def delete_backup_slot( + self, + resource_group_name: str, + name: str, + backup_id: str, + slot: str, + **kwargs + ) -> None: + """Deletes a backup of an app by its ID. + + Description for Deletes a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete a + backup of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}'} # type: ignore + + async def list_backup_status_secrets_slot( + self, + resource_group_name: str, + name: str, + backup_id: str, + slot: str, + request: "_models.BackupRequest", + **kwargs + ) -> "_models.BackupItem": + """Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + + Description for Gets status of a web app backup that may be in progress, including secrets + associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the + SAS URL for the backup if a new URL is passed in the request body. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param backup_id: ID of backup. + :type backup_id: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param request: Information on backup request. + :type request: ~azure.mgmt.web.v2020_06_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_backup_status_secrets_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_backup_status_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list'} # type: ignore + + async def _restore_slot_initial( + self, + resource_group_name: str, + name: str, + backup_id: str, + slot: str, + request: "_models.RestoreRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore'} # type: ignore + + async def begin_restore_slot( + self, + resource_group_name: str, + name: str, + backup_id: str, + slot: str, + request: "_models.RestoreRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Restores a specific backup to another app (or deployment slot, if specified). + + Description for Restores a specific backup to another app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will restore a + backup of the production slot. + :type slot: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2020_06_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_slot_initial( + resource_group_name=resource_group_name, + name=name, + backup_id=backup_id, + slot=slot, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore'} # type: ignore + + def list_configurations_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.SiteConfigResourceCollection"]: + """List the configurations of an app. + + Description for List the configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigResourceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.SiteConfigResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configurations_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_configurations_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config'} # type: ignore + + async def update_application_settings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + app_settings: "_models.StringDictionary", + **kwargs + ) -> "_models.StringDictionary": + """Replaces the application settings of an app. + + Description for Replaces the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + application settings for the production slot. + :type slot: str + :param app_settings: Application settings of the app. + :type app_settings: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_application_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_application_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings'} # type: ignore + + async def list_application_settings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.StringDictionary": + """Gets the application settings of an app. + + Description for Gets the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + application settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_application_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_application_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list'} # type: ignore + + async def update_auth_settings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_auth_settings: "_models.SiteAuthSettings", + **kwargs + ) -> "_models.SiteAuthSettings": + """Updates the Authentication / Authorization settings associated with web app. + + Description for Updates the Authentication / Authorization settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param site_auth_settings: Auth settings associated with web app. + :type site_auth_settings: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings, 'SiteAuthSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings'} # type: ignore + + async def get_auth_settings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.SiteAuthSettings": + """Gets the Authentication/Authorization settings of an app. + + Description for Gets the Authentication/Authorization settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list'} # type: ignore + + async def update_auth_settings_v2_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_auth_settings_v2: "_models.SiteAuthSettingsV2", + **kwargs + ) -> "_models.SiteAuthSettingsV2": + """Updates site's Authentication / Authorization settings for apps via the V2 format. + + Description for Updates site's Authentication / Authorization settings for apps via the V2 + format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param site_auth_settings_v2: Auth settings associated with web app. + :type site_auth_settings_v2: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettingsV2 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings_v2_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings_v2, 'SiteAuthSettingsV2') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings_v2_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2'} # type: ignore + + async def get_auth_settings_v2_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.SiteAuthSettingsV2": + """Gets site's Authentication / Authorization settings for apps via the V2 format. + + Description for Gets site's Authentication / Authorization settings for apps via the V2 format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings_v2_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings_v2_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2/list'} # type: ignore + + async def update_azure_storage_accounts_slot( + self, + resource_group_name: str, + name: str, + slot: str, + azure_storage_accounts: "_models.AzureStoragePropertyDictionaryResource", + **kwargs + ) -> "_models.AzureStoragePropertyDictionaryResource": + """Updates the Azure storage account configurations of an app. + + Description for Updates the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + Azure storage account configurations for the production slot. + :type slot: str + :param azure_storage_accounts: Azure storage accounts of the app. + :type azure_storage_accounts: ~azure.mgmt.web.v2020_06_01.models.AzureStoragePropertyDictionaryResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_azure_storage_accounts_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(azure_storage_accounts, 'AzureStoragePropertyDictionaryResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_azure_storage_accounts_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts'} # type: ignore + + async def list_azure_storage_accounts_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.AzureStoragePropertyDictionaryResource": + """Gets the Azure storage account configurations of an app. + + Description for Gets the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + Azure storage account configurations for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_azure_storage_accounts_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_azure_storage_accounts_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts/list'} # type: ignore + + async def update_backup_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + request: "_models.BackupRequest", + **kwargs + ) -> "_models.BackupRequest": + """Updates the backup configuration of an app. + + Description for Updates the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + backup configuration for the production slot. + :type slot: str + :param request: Edited backup configuration. + :type request: ~azure.mgmt.web.v2020_06_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_backup_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup'} # type: ignore + + async def delete_backup_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Deletes the backup configuration of an app. + + Description for Deletes the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + backup configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup'} # type: ignore + + async def get_backup_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.BackupRequest": + """Gets the backup configuration of an app. + + Description for Gets the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + backup configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list'} # type: ignore + + async def update_connection_strings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + connection_strings: "_models.ConnectionStringDictionary", + **kwargs + ) -> "_models.ConnectionStringDictionary": + """Replaces the connection strings of an app. + + Description for Replaces the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + connection settings for the production slot. + :type slot: str + :param connection_strings: Connection strings of the app or deployment slot. See example. + :type connection_strings: ~azure.mgmt.web.v2020_06_01.models.ConnectionStringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_connection_strings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_strings, 'ConnectionStringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_connection_strings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings'} # type: ignore + + async def list_connection_strings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.ConnectionStringDictionary": + """Gets the connection strings of an app. + + Description for Gets the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + connection settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_connection_strings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_connection_strings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list'} # type: ignore + + async def get_diagnostic_logs_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.SiteLogsConfig": + """Gets the logging configuration of an app. + + Description for Gets the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + logging configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostic_logs_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostic_logs_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs'} # type: ignore + + async def update_diagnostic_logs_config_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_logs_config: "_models.SiteLogsConfig", + **kwargs + ) -> "_models.SiteLogsConfig": + """Updates the logging configuration of an app. + + Description for Updates the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + logging configuration for the production slot. + :type slot: str + :param site_logs_config: A SiteLogsConfig JSON object that contains the logging configuration + to change in the "properties" property. + :type site_logs_config: ~azure.mgmt.web.v2020_06_01.models.SiteLogsConfig + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_diagnostic_logs_config_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_logs_config, 'SiteLogsConfig') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_diagnostic_logs_config_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs'} # type: ignore + + async def update_metadata_slot( + self, + resource_group_name: str, + name: str, + slot: str, + metadata: "_models.StringDictionary", + **kwargs + ) -> "_models.StringDictionary": + """Replaces the metadata of an app. + + Description for Replaces the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + metadata for the production slot. + :type slot: str + :param metadata: Edited metadata of the app or deployment slot. See example. + :type metadata: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_metadata_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(metadata, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_metadata_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata'} # type: ignore + + async def list_metadata_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.StringDictionary": + """Gets the metadata of an app. + + Description for Gets the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + metadata for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_metadata_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_metadata_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list'} # type: ignore + + async def _list_publishing_credentials_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.User": + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._list_publishing_credentials_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_publishing_credentials_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list'} # type: ignore + + async def begin_list_publishing_credentials_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncLROPoller["_models.User"]: + """Gets the Git/FTP publishing credentials of an app. + + Description for Gets the Git/FTP publishing credentials of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + publishing credentials for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 User or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._list_publishing_credentials_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_publishing_credentials_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list'} # type: ignore + + async def update_site_push_settings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + push_settings: "_models.PushSettings", + **kwargs + ) -> "_models.PushSettings": + """Updates the Push settings associated with web app. + + Description for Updates the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param push_settings: Push settings associated with web app. + :type push_settings: ~azure.mgmt.web.v2020_06_01.models.PushSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_site_push_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(push_settings, 'PushSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_site_push_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings'} # type: ignore + + async def list_site_push_settings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.PushSettings": + """Gets the Push settings associated with web app. + + Description for Gets the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_site_push_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_site_push_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings/list'} # type: ignore + + async def get_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.SiteConfigResource": + """Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, Always On, etc. + + Description for Gets the configuration of an app, such as platform version and bitness, default + documents, virtual applications, Always On, etc. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} # type: ignore + + async def create_or_update_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_config: "_models.SiteConfigResource", + **kwargs + ) -> "_models.SiteConfigResource": + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update + configuration for the production slot. + :type slot: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} # type: ignore + + async def update_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_config: "_models.SiteConfigResource", + **kwargs + ) -> "_models.SiteConfigResource": + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update + configuration for the production slot. + :type slot: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} # type: ignore + + def list_configuration_snapshot_info_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.SiteConfigurationSnapshotInfoCollection"]: + """Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. + + Description for Gets a list of web app configuration snapshots identifiers. Each element of the + list contains a timestamp and the ID of the snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigurationSnapshotInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.SiteConfigurationSnapshotInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigurationSnapshotInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configuration_snapshot_info_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigurationSnapshotInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_configuration_snapshot_info_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots'} # type: ignore + + async def get_configuration_snapshot_slot( + self, + resource_group_name: str, + name: str, + snapshot_id: str, + slot: str, + **kwargs + ) -> "_models.SiteConfigResource": + """Gets a snapshot of the configuration of an app at a previous point in time. + + Description for Gets a snapshot of the configuration of an app at a previous point in time. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration_snapshot_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}'} # type: ignore + + async def recover_site_configuration_snapshot_slot( + self, + resource_group_name: str, + name: str, + snapshot_id: str, + slot: str, + **kwargs + ) -> None: + """Reverts the configuration of an app to a previous snapshot. + + Description for Reverts the configuration of an app to a previous snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.recover_site_configuration_snapshot_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + recover_site_configuration_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}/recover'} # type: ignore + + async def get_web_site_container_logs_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> Optional[IO]: + """Gets the last lines of docker logs for the given site. + + Description for Gets the last lines of docker logs for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/octet-stream" + + # Construct URL + url = self.get_web_site_container_logs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_site_container_logs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs'} # type: ignore + + async def get_container_logs_zip_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> Optional[IO]: + """Gets the ZIP archived docker log files for the given site. + + Description for Gets the ZIP archived docker log files for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/zip" + + # Construct URL + url = self.get_container_logs_zip_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_container_logs_zip_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download'} # type: ignore + + def list_continuous_web_jobs_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.ContinuousWebJobCollection"]: + """List continuous web jobs for an app, or a deployment slot. + + Description for List continuous web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ContinuousWebJobCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ContinuousWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContinuousWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_continuous_web_jobs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ContinuousWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_continuous_web_jobs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs'} # type: ignore + + async def get_continuous_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs + ) -> Optional["_models.ContinuousWebJob"]: + """Gets a continuous web job by its ID for an app, or a deployment slot. + + Description for Gets a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ContinuousWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ContinuousWebJob or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ContinuousWebJob"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ContinuousWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}'} # type: ignore + + async def delete_continuous_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs + ) -> None: + """Delete a continuous web job by its ID for an app, or a deployment slot. + + Description for Delete a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}'} # type: ignore + + async def start_continuous_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs + ) -> None: + """Start a continuous web job for an app, or a deployment slot. + + Description for Start a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.start_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/start'} # type: ignore + + async def stop_continuous_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs + ) -> None: + """Stop a continuous web job for an app, or a deployment slot. + + Description for Stop a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.stop_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/stop'} # type: ignore + + def list_deployments_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.DeploymentCollection"]: + """List deployments for an app, or a deployment slot. + + Description for List deployments for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeploymentCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.DeploymentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_deployments_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DeploymentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_deployments_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments'} # type: ignore + + async def get_deployment_slot( + self, + resource_group_name: str, + name: str, + id: str, + slot: str, + **kwargs + ) -> "_models.Deployment": + """Get a deployment by its ID for an app, or a deployment slot. + + Description for Get a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets a deployment + for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_deployment_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} # type: ignore + + async def create_deployment_slot( + self, + resource_group_name: str, + name: str, + id: str, + slot: str, + deployment: "_models.Deployment", + **kwargs + ) -> "_models.Deployment": + """Create a deployment for an app, or a deployment slot. + + Description for Create a deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: ID of an existing deployment. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API creates a + deployment for the production slot. + :type slot: str + :param deployment: Deployment details. + :type deployment: ~azure.mgmt.web.v2020_06_01.models.Deployment + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_deployment_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(deployment, 'Deployment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} # type: ignore + + async def delete_deployment_slot( + self, + resource_group_name: str, + name: str, + id: str, + slot: str, + **kwargs + ) -> None: + """Delete a deployment by its ID for an app, or a deployment slot. + + Description for Delete a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_deployment_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} # type: ignore + + async def list_deployment_log_slot( + self, + resource_group_name: str, + name: str, + id: str, + slot: str, + **kwargs + ) -> "_models.Deployment": + """List deployment log for specific deployment for an app, or a deployment slot. + + Description for List deployment log for specific deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: The ID of a specific deployment. This is the value of the name property in the JSON + response from "GET /api/sites/{siteName}/deployments". + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_deployment_log_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_deployment_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log'} # type: ignore + + async def discover_backup_slot( + self, + resource_group_name: str, + name: str, + slot: str, + request: "_models.RestoreRequest", + **kwargs + ) -> "_models.RestoreRequest": + """Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information about the databases stored in a backup. + + Description for Discovers an existing app backup that can be restored from a blob in Azure + storage. Use this to get information about the databases stored in a backup. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will perform + discovery for the production slot. + :type slot: str + :param request: A RestoreRequest object that includes Azure storage URL and blog name for + discovery of backup. + :type request: ~azure.mgmt.web.v2020_06_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RestoreRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RestoreRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestoreRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.discover_backup_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RestoreRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + discover_backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/discoverbackup'} # type: ignore + + def list_domain_ownership_identifiers_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.IdentifierCollection"]: + """Lists ownership identifiers for domain associated with web app. + + Description for Lists ownership identifiers for domain associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IdentifierCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.IdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_domain_ownership_identifiers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_domain_ownership_identifiers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers'} # type: ignore + + async def get_domain_ownership_identifier_slot( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + slot: str, + **kwargs + ) -> "_models.Identifier": + """Get domain ownership identifier for web app. + + Description for Get domain ownership identifier for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def create_or_update_domain_ownership_identifier_slot( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + slot: str, + domain_ownership_identifier: "_models.Identifier", + **kwargs + ) -> "_models.Identifier": + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_06_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def delete_domain_ownership_identifier_slot( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + slot: str, + **kwargs + ) -> None: + """Deletes a domain ownership identifier for a web app. + + Description for Deletes a domain ownership identifier for a web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def update_domain_ownership_identifier_slot( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + slot: str, + domain_ownership_identifier: "_models.Identifier", + **kwargs + ) -> "_models.Identifier": + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_06_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def get_ms_deploy_status_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.MSDeployStatus": + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} # type: ignore + + async def _create_ms_deploy_operation_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + ms_deploy: "_models.MSDeploy", + **kwargs + ) -> Optional["_models.MSDeployStatus"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployStatus"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_ms_deploy_operation_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201, 409]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_ms_deploy_operation_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} # type: ignore + + async def begin_create_ms_deploy_operation_slot( + self, + resource_group_name: str, + name: str, + slot: str, + ms_deploy: "_models.MSDeploy", + **kwargs + ) -> AsyncLROPoller["_models.MSDeployStatus"]: + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2020_06_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_ms_deploy_operation_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_ms_deploy_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} # type: ignore + + async def get_ms_deploy_log_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> Optional["_models.MSDeployLog"]: + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.MSDeployLog or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployLog"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_log_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log'} # type: ignore + + def list_instance_functions_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.FunctionEnvelopeCollection"]: + """List the functions for a web site, or a deployment slot. + + Description for List the functions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FunctionEnvelopeCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.FunctionEnvelopeCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelopeCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_functions_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('FunctionEnvelopeCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_functions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions'} # type: ignore + + async def get_functions_admin_token_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> str: + """Fetch a short lived token that can be exchanged for a master key. + + Description for Fetch a short lived token that can be exchanged for a master key. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_functions_admin_token_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_functions_admin_token_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/admin/token'} # type: ignore + + async def get_instance_function_slot( + self, + resource_group_name: str, + name: str, + function_name: str, + slot: str, + **kwargs + ) -> Optional["_models.FunctionEnvelope"]: + """Get function information by its ID for web site, or a deployment slot. + + Description for Get function information by its ID for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionEnvelope, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.FunctionEnvelope or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FunctionEnvelope"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_function_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + async def _create_instance_function_slot_initial( + self, + resource_group_name: str, + name: str, + function_name: str, + slot: str, + function_envelope: "_models.FunctionEnvelope", + **kwargs + ) -> "_models.FunctionEnvelope": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_instance_function_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(function_envelope, 'FunctionEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_instance_function_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + async def begin_create_instance_function_slot( + self, + resource_group_name: str, + name: str, + function_name: str, + slot: str, + function_envelope: "_models.FunctionEnvelope", + **kwargs + ) -> AsyncLROPoller["_models.FunctionEnvelope"]: + """Create function for web site, or a deployment slot. + + Description for Create function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :param function_envelope: Function details. + :type function_envelope: ~azure.mgmt.web.v2020_06_01.models.FunctionEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 FunctionEnvelope or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.FunctionEnvelope] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_instance_function_slot_initial( + resource_group_name=resource_group_name, + name=name, + function_name=function_name, + slot=slot, + function_envelope=function_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + async def delete_instance_function_slot( + self, + resource_group_name: str, + name: str, + function_name: str, + slot: str, + **kwargs + ) -> None: + """Delete a function for web site, or a deployment slot. + + Description for Delete a function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_instance_function_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + async def create_or_update_function_secret_slot( + self, + resource_group_name: str, + name: str, + function_name: str, + key_name: str, + slot: str, + key: "_models.KeyInfo", + **kwargs + ) -> "_models.KeyInfo": + """Add or update a function secret. + + Description for Add or update a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2020_06_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_function_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_function_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}'} # type: ignore + + async def delete_function_secret_slot( + self, + resource_group_name: str, + name: str, + function_name: str, + key_name: str, + slot: str, + **kwargs + ) -> None: + """Delete a function secret. + + Description for Delete a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_function_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_function_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}'} # type: ignore + + async def list_function_keys_slot( + self, + resource_group_name: str, + name: str, + function_name: str, + slot: str, + **kwargs + ) -> "_models.StringDictionary": + """Get function keys for a function in a web site, or a deployment slot. + + Description for Get function keys for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_function_keys_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_keys_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listkeys'} # type: ignore + + async def list_function_secrets_slot( + self, + resource_group_name: str, + name: str, + function_name: str, + slot: str, + **kwargs + ) -> "_models.FunctionSecrets": + """Get function secrets for a function in a web site, or a deployment slot. + + Description for Get function secrets for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_function_secrets_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets'} # type: ignore + + async def list_host_keys_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.HostKeys": + """Get host secrets for a function app. + + Description for Get host secrets for a function app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostKeys, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HostKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_host_keys_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_host_keys_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listkeys'} # type: ignore + + async def list_sync_status_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + list_sync_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listsyncstatus'} # type: ignore + + async def sync_functions_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.sync_functions_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_functions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/sync'} # type: ignore + + async def create_or_update_host_secret_slot( + self, + resource_group_name: str, + name: str, + key_type: str, + key_name: str, + slot: str, + key: "_models.KeyInfo", + **kwargs + ) -> "_models.KeyInfo": + """Add or update a host level secret. + + Description for Add or update a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2020_06_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}'} # type: ignore + + async def delete_host_secret_slot( + self, + resource_group_name: str, + name: str, + key_type: str, + key_name: str, + slot: str, + **kwargs + ) -> None: + """Delete a host level secret. + + Description for Delete a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}'} # type: ignore + + def list_host_name_bindings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.HostNameBindingCollection"]: + """Get hostname bindings for an app or a deployment slot. + + Description for Get hostname bindings for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets hostname + bindings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HostNameBindingCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.HostNameBindingCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBindingCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_host_name_bindings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('HostNameBindingCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_host_name_bindings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings'} # type: ignore + + async def get_host_name_binding_slot( + self, + resource_group_name: str, + name: str, + slot: str, + host_name: str, + **kwargs + ) -> "_models.HostNameBinding": + """Get the named hostname binding for an app (or deployment slot, if specified). + + Description for Get the named hostname binding for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API the named binding + for the production slot. + :type slot: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_host_name_binding_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} # type: ignore + + async def create_or_update_host_name_binding_slot( + self, + resource_group_name: str, + name: str, + host_name: str, + slot: str, + host_name_binding: "_models.HostNameBinding", + **kwargs + ) -> "_models.HostNameBinding": + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create a + binding for the production slot. + :type slot: str + :param host_name_binding: Binding details. This is the JSON representation of a HostNameBinding + object. + :type host_name_binding: ~azure.mgmt.web.v2020_06_01.models.HostNameBinding + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_name_binding_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(host_name_binding, 'HostNameBinding') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} # type: ignore + + async def delete_host_name_binding_slot( + self, + resource_group_name: str, + name: str, + slot: str, + host_name: str, + **kwargs + ) -> None: + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_name_binding_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} # type: ignore + + async def get_hybrid_connection_slot( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + slot: str, + **kwargs + ) -> "_models.HybridConnection": + """Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def create_or_update_hybrid_connection_slot( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + slot: str, + connection_envelope: "_models.HybridConnection", + **kwargs + ) -> "_models.HybridConnection": + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def delete_hybrid_connection_slot( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + slot: str, + **kwargs + ) -> None: + """Removes a Hybrid Connection from this site. + + Description for Removes a Hybrid Connection from this site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def update_hybrid_connection_slot( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + slot: str, + connection_envelope: "_models.HybridConnection", + **kwargs + ) -> "_models.HybridConnection": + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def list_hybrid_connections_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.HybridConnection": + """Retrieves all Service Bus Hybrid Connections used by this Web App. + + Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_hybrid_connections_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_hybrid_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays'} # type: ignore + + async def list_relay_service_connections_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.RelayServiceConnectionEntity": + """Gets hybrid connections configured for an app (or deployment slot, if specified). + + Description for Gets hybrid connections configured for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get hybrid + connections for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_relay_service_connections_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_relay_service_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection'} # type: ignore + + async def get_relay_service_connection_slot( + self, + resource_group_name: str, + name: str, + entity_name: str, + slot: str, + **kwargs + ) -> "_models.RelayServiceConnectionEntity": + """Gets a hybrid connection configuration by its name. + + Description for Gets a hybrid connection configuration by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a hybrid + connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + async def create_or_update_relay_service_connection_slot( + self, + resource_group_name: str, + name: str, + entity_name: str, + slot: str, + connection_envelope: "_models.RelayServiceConnectionEntity", + **kwargs + ) -> "_models.RelayServiceConnectionEntity": + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create or + update a hybrid connection for the production slot. + :type slot: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + async def delete_relay_service_connection_slot( + self, + resource_group_name: str, + name: str, + entity_name: str, + slot: str, + **kwargs + ) -> None: + """Deletes a relay service connection by its name. + + Description for Deletes a relay service connection by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete a + hybrid connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + async def update_relay_service_connection_slot( + self, + resource_group_name: str, + name: str, + entity_name: str, + slot: str, + connection_envelope: "_models.RelayServiceConnectionEntity", + **kwargs + ) -> "_models.RelayServiceConnectionEntity": + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create or + update a hybrid connection for the production slot. + :type slot: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + def list_instance_identifiers_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.WebAppInstanceStatusCollection"]: + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets the + production slot instances. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppInstanceStatusCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.WebAppInstanceStatusCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppInstanceStatusCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_identifiers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppInstanceStatusCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_identifiers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances'} # type: ignore + + async def get_instance_info_slot( + self, + resource_group_name: str, + name: str, + instance_id: str, + slot: str, + **kwargs + ) -> "_models.WebSiteInstanceStatus": + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param instance_id: + :type instance_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets the + production slot instances. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebSiteInstanceStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.WebSiteInstanceStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebSiteInstanceStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_info_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebSiteInstanceStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_info_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}'} # type: ignore + + async def get_instance_ms_deploy_status_slot( + self, + resource_group_name: str, + name: str, + slot: str, + instance_id: str, + **kwargs + ) -> "_models.MSDeployStatus": + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + async def _create_instance_ms_deploy_operation_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + instance_id: str, + ms_deploy: "_models.MSDeploy", + **kwargs + ) -> Optional["_models.MSDeployStatus"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployStatus"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_instance_ms_deploy_operation_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201, 409]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_instance_ms_deploy_operation_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + async def begin_create_instance_ms_deploy_operation_slot( + self, + resource_group_name: str, + name: str, + slot: str, + instance_id: str, + ms_deploy: "_models.MSDeploy", + **kwargs + ) -> AsyncLROPoller["_models.MSDeployStatus"]: + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param instance_id: ID of web app instance. + :type instance_id: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2020_06_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_instance_ms_deploy_operation_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + instance_id=instance_id, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_instance_ms_deploy_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + async def get_instance_ms_deploy_log_slot( + self, + resource_group_name: str, + name: str, + slot: str, + instance_id: str, + **kwargs + ) -> Optional["_models.MSDeployLog"]: + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.MSDeployLog or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployLog"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_log_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log'} # type: ignore + + def list_instance_processes_slot( + self, + resource_group_name: str, + name: str, + slot: str, + instance_id: str, + **kwargs + ) -> AsyncIterable["_models.ProcessInfoCollection"]: + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_processes_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_processes_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes'} # type: ignore + + async def get_instance_process_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + instance_id: str, + **kwargs + ) -> Optional["_models.ProcessInfo"]: + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ProcessInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'} # type: ignore + + async def delete_instance_process_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + instance_id: str, + **kwargs + ) -> None: + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_instance_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_instance_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'} # type: ignore + + async def get_instance_process_dump_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + instance_id: str, + **kwargs + ) -> Optional[IO]: + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_dump_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_dump_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump'} # type: ignore + + def list_instance_process_modules_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + instance_id: str, + **kwargs + ) -> AsyncIterable["_models.ProcessModuleInfoCollection"]: + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessModuleInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_modules_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_process_modules_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules'} # type: ignore + + async def get_instance_process_module_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + base_address: str, + slot: str, + instance_id: str, + **kwargs + ) -> Optional["_models.ProcessModuleInfo"]: + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ProcessModuleInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessModuleInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_module_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_module_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_instance_process_threads_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + instance_id: str, + **kwargs + ) -> AsyncIterable["_models.ProcessThreadInfoCollection"]: + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessThreadInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_threads_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_process_threads_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads'} # type: ignore + + async def is_cloneable_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.SiteCloneability": + """Shows whether an app can be cloned to another resource group or subscription. + + Description for Shows whether an app can be cloned to another resource group or subscription. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. By default, this API returns information on the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteCloneability, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteCloneability + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteCloneability"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.is_cloneable_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteCloneability', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + is_cloneable_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable'} # type: ignore + + def list_site_backups_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.BackupItemCollection"]: + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get backups + of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_backups_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_backups_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listbackups'} # type: ignore + + async def list_sync_function_triggers_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.FunctionSecrets": + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_function_triggers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_sync_function_triggers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus'} # type: ignore + + async def get_migrate_my_sql_status_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.MigrateMySqlStatus": + """Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. + + Description for Returns the status of MySql in app migration, if one is active, and whether or + not MySql in app is enabled. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MigrateMySqlStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.MigrateMySqlStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrateMySqlStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_migrate_my_sql_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MigrateMySqlStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_migrate_my_sql_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status'} # type: ignore + + async def get_swift_virtual_network_connection_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.SwiftVirtualNetwork": + """Gets a Swift Virtual Network connection. + + Description for Gets a Swift Virtual Network connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a + gateway for the production slot's Virtual Network. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_swift_virtual_network_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_swift_virtual_network_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + async def create_or_update_swift_virtual_network_connection_slot( + self, + resource_group_name: str, + name: str, + slot: str, + connection_envelope: "_models.SwiftVirtualNetwork", + **kwargs + ) -> "_models.SwiftVirtualNetwork": + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_swift_virtual_network_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_swift_virtual_network_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + async def delete_swift_virtual_network_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Deletes a Swift Virtual Network connection from an app (or deployment slot). + + Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_swift_virtual_network_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_swift_virtual_network_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + async def update_swift_virtual_network_connection_slot( + self, + resource_group_name: str, + name: str, + slot: str, + connection_envelope: "_models.SwiftVirtualNetwork", + **kwargs + ) -> "_models.SwiftVirtualNetwork": + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_swift_virtual_network_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_swift_virtual_network_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + async def list_network_features_slot( + self, + resource_group_name: str, + name: str, + view: str, + slot: str, + **kwargs + ) -> Optional["_models.NetworkFeatures"]: + """Gets all network features used by the app (or deployment slot, if specified). + + Description for Gets all network features used by the app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param view: The type of view. This can either be "summary" or "detailed". + :type view: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get network + features for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFeatures, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.NetworkFeatures or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NetworkFeatures"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_network_features_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'view': self._serialize.url("view", view, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('NetworkFeatures', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_network_features_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkFeatures/{view}'} # type: ignore + + async def get_network_trace_operation_slot( + self, + resource_group_name: str, + name: str, + operation_id: str, + slot: str, + **kwargs + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/operationresults/{operationId}'} # type: ignore + + async def start_web_site_network_trace_slot( + self, + resource_group_name: str, + name: str, + slot: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs + ) -> str: + """Start capturing network packets for the site (To be deprecated). + + Description for Start capturing network packets for the site (To be deprecated). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.start_web_site_network_trace_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + start_web_site_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/start'} # type: ignore + + async def _start_web_site_network_trace_operation_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs + ) -> List["_models.NetworkTrace"]: + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._start_web_site_network_trace_operation_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_web_site_network_trace_operation_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation'} # type: ignore + + async def begin_start_web_site_network_trace_operation_slot( + self, + resource_group_name: str, + name: str, + slot: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller[List["_models.NetworkTrace"]]: + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_web_site_network_trace_operation_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_web_site_network_trace_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation'} # type: ignore + + async def stop_web_site_network_trace_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.stop_web_site_network_trace_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_web_site_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/stop'} # type: ignore + + async def get_network_traces_slot( + self, + resource_group_name: str, + name: str, + operation_id: str, + slot: str, + **kwargs + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/{operationId}'} # type: ignore + + async def get_network_trace_operation_slot_v2( + self, + resource_group_name: str, + name: str, + operation_id: str, + slot: str, + **kwargs + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation_slot_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation_slot_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/current/operationresults/{operationId}'} # type: ignore + + async def get_network_traces_slot_v2( + self, + resource_group_name: str, + name: str, + operation_id: str, + slot: str, + **kwargs + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces_slot_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces_slot_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/{operationId}'} # type: ignore + + async def generate_new_site_publishing_password_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Generates a new publishing password for an app (or deployment slot, if specified). + + Description for Generates a new publishing password for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API generate a new + publishing password for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.generate_new_site_publishing_password_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + generate_new_site_publishing_password_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword'} # type: ignore + + def list_perf_mon_counters_slot( + self, + resource_group_name: str, + name: str, + slot: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.PerfMonCounterCollection"]: + """Gets perfmon counters for web app. + + Description for Gets perfmon counters for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z + and timeGrain eq duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PerfMonCounterCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.PerfMonCounterCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PerfMonCounterCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_perf_mon_counters_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PerfMonCounterCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_perf_mon_counters_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/perfcounters'} # type: ignore + + async def get_site_php_error_log_flag_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.SitePhpErrorLogFlag": + """Gets web app's event logs. + + Description for Gets web app's event logs. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SitePhpErrorLogFlag, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SitePhpErrorLogFlag + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SitePhpErrorLogFlag"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_php_error_log_flag_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SitePhpErrorLogFlag', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_php_error_log_flag_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging'} # type: ignore + + async def list_premier_add_ons_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.PremierAddOn": + """Gets the premier add-ons of an app. + + Description for Gets the premier add-ons of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + premier add-ons for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_premier_add_ons_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_premier_add_ons_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons'} # type: ignore + + async def get_premier_add_on_slot( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + slot: str, + **kwargs + ) -> "_models.PremierAddOn": + """Gets a named add-on of an app. + + Description for Gets a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + named add-on for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + async def add_premier_add_on_slot( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + slot: str, + premier_add_on: "_models.PremierAddOn", + **kwargs + ) -> "_models.PremierAddOn": + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + named add-on for the production slot. + :type slot: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2020_06_01.models.PremierAddOn + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.add_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOn') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + add_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + async def delete_premier_add_on_slot( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + slot: str, + **kwargs + ) -> None: + """Delete a premier add-on from an app. + + Description for Delete a premier add-on from an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + named add-on for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + async def update_premier_add_on_slot( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + slot: str, + premier_add_on: "_models.PremierAddOnPatchResource", + **kwargs + ) -> "_models.PremierAddOn": + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + named add-on for the production slot. + :type slot: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2020_06_01.models.PremierAddOnPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOnPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + async def get_private_access_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.PrivateAccess": + """Gets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Gets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_private_access_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_access_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks'} # type: ignore + + async def put_private_access_vnet_slot( + self, + resource_group_name: str, + name: str, + slot: str, + access: "_models.PrivateAccess", + **kwargs + ) -> "_models.PrivateAccess": + """Sets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Sets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for the web app. + :type slot: str + :param access: The information for the private access. + :type access: ~azure.mgmt.web.v2020_06_01.models.PrivateAccess + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put_private_access_vnet_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(access, 'PrivateAccess') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_private_access_vnet_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks'} # type: ignore + + async def get_private_endpoint_connection( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> "_models.PrivateEndpointConnectionResource": + """Gets a private endpoint connection. + + Description for Gets a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PrivateEndpointConnectionResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_private_endpoint_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _approve_or_reject_private_endpoint_connection_initial( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + private_endpoint_wrapper: "_models.PrivateLinkConnectionApprovalRequestResource", + **kwargs + ) -> "_models.PrivateEndpointConnectionResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._approve_or_reject_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_wrapper, 'PrivateLinkConnectionApprovalRequestResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _approve_or_reject_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_approve_or_reject_private_endpoint_connection( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + private_endpoint_wrapper: "_models.PrivateLinkConnectionApprovalRequestResource", + **kwargs + ) -> AsyncLROPoller["_models.PrivateEndpointConnectionResource"]: + """Approves or rejects a private endpoint connection. + + Description for Approves or rejects a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :param private_endpoint_wrapper: + :type private_endpoint_wrapper: ~azure.mgmt.web.v2020_06_01.models.PrivateLinkConnectionApprovalRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 PrivateEndpointConnectionResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.PrivateEndpointConnectionResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._approve_or_reject_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + private_endpoint_wrapper=private_endpoint_wrapper, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_approve_or_reject_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _delete_private_endpoint_connection_initial( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> object: + cls = kwargs.pop('cls', None) # type: ClsType[object] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._delete_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 204: + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_delete_private_endpoint_connection( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> AsyncLROPoller[object]: + """Deletes a private endpoint connection. + + Description for Deletes a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_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: True for ARMPolling, False for no polling, or a + polling object for 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 object or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[object] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[object] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def get_private_link_resources( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.PrivateLinkResourcesWrapper": + """Gets the private link resources. + + Description for Gets the private link resources. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesWrapper, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PrivateLinkResourcesWrapper + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourcesWrapper"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_private_link_resources.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourcesWrapper', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_link_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateLinkResources'} # type: ignore + + def list_processes_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.ProcessInfoCollection"]: + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_processes_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_processes_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes'} # type: ignore + + async def get_process_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + **kwargs + ) -> Optional["_models.ProcessInfo"]: + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ProcessInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}'} # type: ignore + + async def delete_process_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + **kwargs + ) -> None: + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}'} # type: ignore + + async def get_process_dump_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + **kwargs + ) -> Optional[IO]: + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_process_dump_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_dump_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/dump'} # type: ignore + + def list_process_modules_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.ProcessModuleInfoCollection"]: + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessModuleInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_modules_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_process_modules_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules'} # type: ignore + + async def get_process_module_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + base_address: str, + slot: str, + **kwargs + ) -> Optional["_models.ProcessModuleInfo"]: + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ProcessModuleInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessModuleInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_process_module_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_module_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_process_threads_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.ProcessThreadInfoCollection"]: + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessThreadInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_threads_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_process_threads_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads'} # type: ignore + + def list_public_certificates_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.PublicCertificateCollection"]: + """Get public certificates for an app or a deployment slot. + + Description for Get public certificates for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets hostname + bindings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicCertificateCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.PublicCertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_public_certificates_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PublicCertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_public_certificates_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates'} # type: ignore + + async def get_public_certificate_slot( + self, + resource_group_name: str, + name: str, + slot: str, + public_certificate_name: str, + **kwargs + ) -> "_models.PublicCertificate": + """Get the named public certificate for an app (or deployment slot, if specified). + + Description for Get the named public certificate for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API the named binding + for the production slot. + :type slot: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_public_certificate_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_public_certificate_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'} # type: ignore + + async def create_or_update_public_certificate_slot( + self, + resource_group_name: str, + name: str, + public_certificate_name: str, + slot: str, + public_certificate: "_models.PublicCertificate", + **kwargs + ) -> "_models.PublicCertificate": + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create a + binding for the production slot. + :type slot: str + :param public_certificate: Public certificate details. This is the JSON representation of a + PublicCertificate object. + :type public_certificate: ~azure.mgmt.web.v2020_06_01.models.PublicCertificate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_public_certificate_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(public_certificate, 'PublicCertificate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_public_certificate_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'} # type: ignore + + async def delete_public_certificate_slot( + self, + resource_group_name: str, + name: str, + slot: str, + public_certificate_name: str, + **kwargs + ) -> None: + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_public_certificate_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_public_certificate_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'} # type: ignore + + async def list_publishing_profile_xml_with_secrets_slot( + self, + resource_group_name: str, + name: str, + slot: str, + publishing_profile_options: "_models.CsmPublishingProfileOptions", + **kwargs + ) -> IO: + """Gets the publishing profile for an app (or deployment slot, if specified). + + Description for Gets the publishing profile for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + publishing profile for the production slot. + :type slot: str + :param publishing_profile_options: Specifies publishingProfileOptions for publishing profile. + For example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + :type publishing_profile_options: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingProfileOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/xml" + + # Construct URL + url = self.list_publishing_profile_xml_with_secrets_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(publishing_profile_options, 'CsmPublishingProfileOptions') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_publishing_profile_xml_with_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml'} # type: ignore + + async def reset_slot_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Resets the configuration settings of the current slot if they were previously modified by calling the API with POST. + + Description for Resets the configuration settings of the current slot if they were previously + modified by calling the API with POST. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API resets + configuration settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.reset_slot_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_slot_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig'} # type: ignore + + async def restart_slot( + self, + resource_group_name: str, + name: str, + slot: str, + soft_restart: Optional[bool] = None, + synchronous: Optional[bool] = None, + **kwargs + ) -> None: + """Restarts an app (or deployment slot, if specified). + + Description for Restarts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will restart the + production slot. + :type slot: str + :param soft_restart: Specify true to apply the configuration settings and restarts the app only + if necessary. By default, the API always restarts and reprovisions the app. + :type soft_restart: bool + :param synchronous: Specify true to block until the app is restarted. By default, it is set to + false, and the API responds immediately (asynchronous). + :type synchronous: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.restart_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if soft_restart is not None: + query_parameters['softRestart'] = self._serialize.query("soft_restart", soft_restart, 'bool') + if synchronous is not None: + query_parameters['synchronous'] = self._serialize.query("synchronous", synchronous, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restart_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restart'} # type: ignore + + async def _restore_from_backup_blob_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + request: "_models.RestoreRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_backup_blob_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_backup_blob_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob'} # type: ignore + + async def begin_restore_from_backup_blob_slot( + self, + resource_group_name: str, + name: str, + slot: str, + request: "_models.RestoreRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Restores an app from a backup blob in Azure Storage. + + Description for Restores an app from a backup blob in Azure Storage. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will restore a + backup of the production slot. + :type slot: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2020_06_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_from_backup_blob_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_backup_blob_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob'} # type: ignore + + async def _restore_from_deleted_app_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + restore_request: "_models.DeletedAppRestoreRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_deleted_app_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'DeletedAppRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_deleted_app_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp'} # type: ignore + + async def begin_restore_from_deleted_app_slot( + self, + resource_group_name: str, + name: str, + slot: str, + restore_request: "_models.DeletedAppRestoreRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Restores a deleted web app to this web app. + + Description for Restores a deleted web app to this web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param restore_request: Deleted web app restore information. + :type restore_request: ~azure.mgmt.web.v2020_06_01.models.DeletedAppRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_from_deleted_app_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_deleted_app_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp'} # type: ignore + + async def _restore_snapshot_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + restore_request: "_models.SnapshotRestoreRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_snapshot_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'SnapshotRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_snapshot_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot'} # type: ignore + + async def begin_restore_snapshot_slot( + self, + resource_group_name: str, + name: str, + slot: str, + restore_request: "_models.SnapshotRestoreRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Restores a web app from a snapshot. + + Description for Restores a web app from a snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param restore_request: Snapshot restore settings. Snapshot information can be obtained by + calling GetDeletedSites or GetSiteSnapshots API. + :type restore_request: ~azure.mgmt.web.v2020_06_01.models.SnapshotRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_snapshot_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot'} # type: ignore + + def list_site_extensions_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.SiteExtensionInfoCollection"]: + """Get list of siteextensions for a web site, or a deployment slot. + + Description for Get list of siteextensions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteExtensionInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.SiteExtensionInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_extensions_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_extensions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions'} # type: ignore + + async def get_site_extension_slot( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + slot: str, + **kwargs + ) -> Optional["_models.SiteExtensionInfo"]: + """Get site extension information by its ID for a web site, or a deployment slot. + + Description for Get site extension information by its ID for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteExtensionInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteExtensionInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SiteExtensionInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_extension_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_extension_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + async def _install_site_extension_slot_initial( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + slot: str, + **kwargs + ) -> Optional["_models.SiteExtensionInfo"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SiteExtensionInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._install_site_extension_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 429]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _install_site_extension_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + async def begin_install_site_extension_slot( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + slot: str, + **kwargs + ) -> AsyncLROPoller["_models.SiteExtensionInfo"]: + """Install site extension on a web site, or a deployment slot. + + Description for Install site extension on a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 SiteExtensionInfo or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.SiteExtensionInfo] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfo"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._install_site_extension_slot_initial( + resource_group_name=resource_group_name, + name=name, + site_extension_id=site_extension_id, + slot=slot, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_site_extension_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + async def delete_site_extension_slot( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + slot: str, + **kwargs + ) -> None: + """Remove a site extension from a web site, or a deployment slot. + + Description for Remove a site extension from a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_site_extension_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_site_extension_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + async def _copy_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + copy_slot_entity: "_models.CsmCopySlotEntity", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._copy_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(copy_slot_entity, 'CsmCopySlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _copy_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotcopy'} # type: ignore + + async def begin_copy_slot( + self, + resource_group_name: str, + name: str, + slot: str, + copy_slot_entity: "_models.CsmCopySlotEntity", + **kwargs + ) -> AsyncLROPoller[None]: + """Copies a deployment slot to another deployment slot of an app. + + Description for Copies a deployment slot to another deployment slot of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param copy_slot_entity: JSON object that contains the target slot name and site config + properties to override the source slot config. See example. + :type copy_slot_entity: ~azure.mgmt.web.v2020_06_01.models.CsmCopySlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._copy_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + copy_slot_entity=copy_slot_entity, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_copy_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotcopy'} # type: ignore + + def list_slot_differences_slot( + self, + resource_group_name: str, + name: str, + slot: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs + ) -> AsyncIterable["_models.SlotDifferenceCollection"]: + """Get the difference in configuration settings between two web app slots. + + Description for Get the difference in configuration settings between two web app slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_06_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SlotDifferenceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.SlotDifferenceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotDifferenceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_slot_differences_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SlotDifferenceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_slot_differences_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs'} # type: ignore + + async def _swap_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._swap_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _swap_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap'} # type: ignore + + async def begin_swap_slot( + self, + resource_group_name: str, + name: str, + slot: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs + ) -> AsyncLROPoller[None]: + """Swaps two deployment slots of an app. + + Description for Swaps two deployment slots of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_06_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._swap_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + slot_swap_entity=slot_swap_entity, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_swap_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap'} # type: ignore + + def list_snapshots_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.SnapshotCollection"]: + """Returns all Snapshots to the user. + + Description for Returns all Snapshots to the user. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :param slot: Website Slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_snapshots_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots'} # type: ignore + + def list_snapshots_from_dr_secondary_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.SnapshotCollection"]: + """Returns all Snapshots to the user from DRSecondary endpoint. + + Description for Returns all Snapshots to the user from DRSecondary endpoint. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :param slot: Website Slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots_from_dr_secondary_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_snapshots_from_dr_secondary_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshotsdr'} # type: ignore + + async def get_source_control_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.SiteSourceControl": + """Gets the source control configuration of an app. + + Description for Gets the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + source control configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_source_control_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + async def _create_or_update_source_control_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + site_source_control: "_models.SiteSourceControl", + **kwargs + ) -> "_models.SiteSourceControl": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_source_control_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_source_control_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + async def begin_create_or_update_source_control_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_source_control: "_models.SiteSourceControl", + **kwargs + ) -> AsyncLROPoller["_models.SiteSourceControl"]: + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + source control configuration for the production slot. + :type slot: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2020_06_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 SiteSourceControl or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.SiteSourceControl] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_source_control_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + site_source_control=site_source_control, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + async def delete_source_control_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Deletes the source control configuration of an app. + + Description for Deletes the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + source control configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_source_control_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + async def update_source_control_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_source_control: "_models.SiteSourceControl", + **kwargs + ) -> "_models.SiteSourceControl": + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + source control configuration for the production slot. + :type slot: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2020_06_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_source_control_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + async def start_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Starts an app (or deployment slot, if specified). + + Description for Starts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will start the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.start_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start'} # type: ignore + + async def _start_network_trace_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs + ) -> List["_models.NetworkTrace"]: + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._start_network_trace_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_network_trace_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace'} # type: ignore + + async def begin_start_network_trace_slot( + self, + resource_group_name: str, + name: str, + slot: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller[List["_models.NetworkTrace"]]: + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_network_trace_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace'} # type: ignore + + async def stop_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Stops an app (or deployment slot, if specified). + + Description for Stops an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will stop the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.stop_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop'} # type: ignore + + async def stop_network_trace_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.stop_network_trace_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stopNetworkTrace'} # type: ignore + + async def sync_repository_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Sync web app repository. + + Description for Sync web app repository. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.sync_repository_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_repository_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync'} # type: ignore + + async def sync_function_triggers_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.sync_function_triggers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_function_triggers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/syncfunctiontriggers'} # type: ignore + + def list_triggered_web_jobs_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.TriggeredWebJobCollection"]: + """List triggered web jobs for an app, or a deployment slot. + + Description for List triggered web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredWebJobCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.TriggeredWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_jobs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_triggered_web_jobs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs'} # type: ignore + + async def get_triggered_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs + ) -> Optional["_models.TriggeredWebJob"]: + """Gets a triggered web job by its ID for an app, or a deployment slot. + + Description for Gets a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.TriggeredWebJob or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.TriggeredWebJob"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TriggeredWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}'} # type: ignore + + async def delete_triggered_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs + ) -> None: + """Delete a triggered web job by its ID for an app, or a deployment slot. + + Description for Delete a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes web job + for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_triggered_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_triggered_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}'} # type: ignore + + def list_triggered_web_job_history_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.TriggeredJobHistoryCollection"]: + """List a triggered web job's history for an app, or a deployment slot. + + Description for List a triggered web job's history for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredJobHistoryCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.TriggeredJobHistoryCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredJobHistoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_job_history_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredJobHistoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_triggered_web_job_history_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history'} # type: ignore + + async def get_triggered_web_job_history_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + id: str, + slot: str, + **kwargs + ) -> Optional["_models.TriggeredJobHistory"]: + """Gets a triggered web job's history by its ID for an app, , or a deployment slot. + + Description for Gets a triggered web job's history by its ID for an app, , or a deployment + slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param id: History ID. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredJobHistory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.TriggeredJobHistory or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.TriggeredJobHistory"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job_history_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TriggeredJobHistory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job_history_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}'} # type: ignore + + async def run_triggered_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs + ) -> None: + """Run a triggered web job for an app, or a deployment slot. + + Description for Run a triggered web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.run_triggered_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + run_triggered_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/run'} # type: ignore + + def list_usages_slot( + self, + resource_group_name: str, + name: str, + slot: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.CsmUsageQuotaCollection"]: + """Gets the quota usage information of an app (or deployment slot, if specified). + + Description for Gets the quota usage information of an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get quota + information of the production slot. + :type slot: str + :param filter: Return only information specified in the filter (using OData syntax). For + example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq + 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_usages_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages'} # type: ignore + + async def list_vnet_connections_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> List["_models.VnetInfo"]: + """Gets the virtual networks the app (or deployment slot) is connected to. + + Description for Gets the virtual networks the app (or deployment slot) is connected to. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get virtual + network connections for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetInfo, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.VnetInfo] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_vnet_connections_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetInfo]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_vnet_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections'} # type: ignore + + async def get_vnet_connection_slot( + self, + resource_group_name: str, + name: str, + vnet_name: str, + slot: str, + **kwargs + ) -> "_models.VnetInfo": + """Gets a virtual network the app (or deployment slot) is connected to by name. + + Description for Gets a virtual network the app (or deployment slot) is connected to by name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + named virtual network for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def create_or_update_vnet_connection_slot( + self, + resource_group_name: str, + name: str, + vnet_name: str, + slot: str, + connection_envelope: "_models.VnetInfo", + **kwargs + ) -> "_models.VnetInfo": + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def delete_vnet_connection_slot( + self, + resource_group_name: str, + name: str, + vnet_name: str, + slot: str, + **kwargs + ) -> None: + """Deletes a connection from an app (or deployment slot to a named virtual network. + + Description for Deletes a connection from an app (or deployment slot to a named virtual + network. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def update_vnet_connection_slot( + self, + resource_group_name: str, + name: str, + vnet_name: str, + slot: str, + connection_envelope: "_models.VnetInfo", + **kwargs + ) -> "_models.VnetInfo": + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfo') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def get_vnet_connection_gateway_slot( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + slot: str, + **kwargs + ) -> Optional["_models.VnetGateway"]: + """Gets an app's Virtual Network gateway. + + Description for Gets an app's Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a + gateway for the production slot's Virtual Network. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetGateway or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VnetGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection_gateway_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection_gateway_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + async def create_or_update_vnet_connection_gateway_slot( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + slot: str, + connection_envelope: "_models.VnetGateway", + **kwargs + ) -> "_models.VnetGateway": + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update a gateway for the production slot's Virtual Network. + :type slot: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection_gateway_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection_gateway_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + async def update_vnet_connection_gateway_slot( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + slot: str, + connection_envelope: "_models.VnetGateway", + **kwargs + ) -> "_models.VnetGateway": + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update a gateway for the production slot's Virtual Network. + :type slot: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection_gateway_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection_gateway_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def list_web_jobs_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.WebJobCollection"]: + """List webjobs for an app, or a deployment slot. + + Description for List webjobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebJobCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.WebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_jobs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_web_jobs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs'} # type: ignore + + async def get_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs + ) -> "_models.WebJob": + """Get webjob information for an app, or a deployment slot. + + Description for Get webjob information for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of the web job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.WebJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs/{webJobName}'} # type: ignore + + def list_slot_differences_from_production( + self, + resource_group_name: str, + name: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs + ) -> AsyncIterable["_models.SlotDifferenceCollection"]: + """Get the difference in configuration settings between two web app slots. + + Description for Get the difference in configuration settings between two web app slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_06_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SlotDifferenceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.SlotDifferenceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotDifferenceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_slot_differences_from_production.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SlotDifferenceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_slot_differences_from_production.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs'} # type: ignore + + async def _swap_slot_with_production_initial( + self, + resource_group_name: str, + name: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._swap_slot_with_production_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _swap_slot_with_production_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap'} # type: ignore + + async def begin_swap_slot_with_production( + self, + resource_group_name: str, + name: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs + ) -> AsyncLROPoller[None]: + """Swaps two deployment slots of an app. + + Description for Swaps two deployment slots of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_06_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._swap_slot_with_production_initial( + resource_group_name=resource_group_name, + name=name, + slot_swap_entity=slot_swap_entity, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_swap_slot_with_production.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap'} # type: ignore + + def list_snapshots( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.SnapshotCollection"]: + """Returns all Snapshots to the user. + + Description for Returns all Snapshots to the user. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_snapshots.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots'} # type: ignore + + def list_snapshots_from_dr_secondary( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.SnapshotCollection"]: + """Returns all Snapshots to the user from DRSecondary endpoint. + + Description for Returns all Snapshots to the user from DRSecondary endpoint. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots_from_dr_secondary.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_snapshots_from_dr_secondary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshotsdr'} # type: ignore + + async def get_source_control( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.SiteSourceControl": + """Gets the source control configuration of an app. + + Description for Gets the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + async def _create_or_update_source_control_initial( + self, + resource_group_name: str, + name: str, + site_source_control: "_models.SiteSourceControl", + **kwargs + ) -> "_models.SiteSourceControl": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_source_control_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_source_control_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + async def begin_create_or_update_source_control( + self, + resource_group_name: str, + name: str, + site_source_control: "_models.SiteSourceControl", + **kwargs + ) -> AsyncLROPoller["_models.SiteSourceControl"]: + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2020_06_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 SiteSourceControl or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_06_01.models.SiteSourceControl] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_source_control_initial( + resource_group_name=resource_group_name, + name=name, + site_source_control=site_source_control, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + async def delete_source_control( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Deletes the source control configuration of an app. + + Description for Deletes the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + async def update_source_control( + self, + resource_group_name: str, + name: str, + site_source_control: "_models.SiteSourceControl", + **kwargs + ) -> "_models.SiteSourceControl": + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2020_06_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + async def start( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Starts an app (or deployment slot, if specified). + + Description for Starts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.start.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/start'} # type: ignore + + async def _start_network_trace_initial( + self, + resource_group_name: str, + name: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs + ) -> List["_models.NetworkTrace"]: + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._start_network_trace_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_network_trace_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace'} # type: ignore + + async def begin_start_network_trace( + self, + resource_group_name: str, + name: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller[List["_models.NetworkTrace"]]: + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_network_trace_initial( + resource_group_name=resource_group_name, + name=name, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace'} # type: ignore + + async def stop( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Stops an app (or deployment slot, if specified). + + Description for Stops an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.stop.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stop'} # type: ignore + + async def stop_network_trace( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.stop_network_trace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stopNetworkTrace'} # type: ignore + + async def sync_repository( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Sync web app repository. + + Description for Sync web app repository. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.sync_repository.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_repository.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sync'} # type: ignore + + async def sync_function_triggers( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.sync_function_triggers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_function_triggers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/syncfunctiontriggers'} # type: ignore + + def list_triggered_web_jobs( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.TriggeredWebJobCollection"]: + """List triggered web jobs for an app, or a deployment slot. + + Description for List triggered web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredWebJobCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.TriggeredWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_jobs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_triggered_web_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs'} # type: ignore + + async def get_triggered_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs + ) -> Optional["_models.TriggeredWebJob"]: + """Gets a triggered web job by its ID for an app, or a deployment slot. + + Description for Gets a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.TriggeredWebJob or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.TriggeredWebJob"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TriggeredWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}'} # type: ignore + + async def delete_triggered_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs + ) -> None: + """Delete a triggered web job by its ID for an app, or a deployment slot. + + Description for Delete a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_triggered_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_triggered_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}'} # type: ignore + + def list_triggered_web_job_history( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs + ) -> AsyncIterable["_models.TriggeredJobHistoryCollection"]: + """List a triggered web job's history for an app, or a deployment slot. + + Description for List a triggered web job's history for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredJobHistoryCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.TriggeredJobHistoryCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredJobHistoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_job_history.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredJobHistoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_triggered_web_job_history.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history'} # type: ignore + + async def get_triggered_web_job_history( + self, + resource_group_name: str, + name: str, + web_job_name: str, + id: str, + **kwargs + ) -> Optional["_models.TriggeredJobHistory"]: + """Gets a triggered web job's history by its ID for an app, , or a deployment slot. + + Description for Gets a triggered web job's history by its ID for an app, , or a deployment + slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param id: History ID. + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredJobHistory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.TriggeredJobHistory or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.TriggeredJobHistory"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job_history.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TriggeredJobHistory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job_history.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history/{id}'} # type: ignore + + async def run_triggered_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs + ) -> None: + """Run a triggered web job for an app, or a deployment slot. + + Description for Run a triggered web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.run_triggered_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + run_triggered_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/run'} # type: ignore + + def list_usages( + self, + resource_group_name: str, + name: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.CsmUsageQuotaCollection"]: + """Gets the quota usage information of an app (or deployment slot, if specified). + + Description for Gets the quota usage information of an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param filter: Return only information specified in the filter (using OData syntax). For + example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq + 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/usages'} # type: ignore + + async def list_vnet_connections( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> List["_models.VnetInfo"]: + """Gets the virtual networks the app (or deployment slot) is connected to. + + Description for Gets the virtual networks the app (or deployment slot) is connected to. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetInfo, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.VnetInfo] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_vnet_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetInfo]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_vnet_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections'} # type: ignore + + async def get_vnet_connection( + self, + resource_group_name: str, + name: str, + vnet_name: str, + **kwargs + ) -> "_models.VnetInfo": + """Gets a virtual network the app (or deployment slot) is connected to by name. + + Description for Gets a virtual network the app (or deployment slot) is connected to by name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def create_or_update_vnet_connection( + self, + resource_group_name: str, + name: str, + vnet_name: str, + connection_envelope: "_models.VnetInfo", + **kwargs + ) -> "_models.VnetInfo": + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def delete_vnet_connection( + self, + resource_group_name: str, + name: str, + vnet_name: str, + **kwargs + ) -> None: + """Deletes a connection from an app (or deployment slot to a named virtual network. + + Description for Deletes a connection from an app (or deployment slot to a named virtual + network. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def update_vnet_connection( + self, + resource_group_name: str, + name: str, + vnet_name: str, + connection_envelope: "_models.VnetInfo", + **kwargs + ) -> "_models.VnetInfo": + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfo') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def get_vnet_connection_gateway( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + **kwargs + ) -> Optional["_models.VnetGateway"]: + """Gets an app's Virtual Network gateway. + + Description for Gets an app's Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetGateway or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VnetGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + async def create_or_update_vnet_connection_gateway( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + connection_envelope: "_models.VnetGateway", + **kwargs + ) -> "_models.VnetGateway": + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + async def update_vnet_connection_gateway( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + connection_envelope: "_models.VnetGateway", + **kwargs + ) -> "_models.VnetGateway": + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def list_web_jobs( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.WebJobCollection"]: + """List webjobs for an app, or a deployment slot. + + Description for List webjobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebJobCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.WebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_jobs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_web_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs'} # type: ignore + + async def get_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs + ) -> "_models.WebJob": + """Get webjob information for an app, or a deployment slot. + + Description for Get webjob information for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of the web job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.WebJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs/{webJobName}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_web_site_management_client_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_web_site_management_client_operations.py new file mode 100644 index 000000000000..196b138db9f1 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_web_site_management_client_operations.py @@ -0,0 +1,1059 @@ +# 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, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WebSiteManagementClientOperationsMixin: + + async def get_publishing_user( + self, + **kwargs + ) -> "_models.User": + """Gets publishing user. + + Description for Gets publishing user. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: User, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.User + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_publishing_user.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_publishing_user.metadata = {'url': '/providers/Microsoft.Web/publishingUsers/web'} # type: ignore + + async def update_publishing_user( + self, + user_details: "_models.User", + **kwargs + ) -> "_models.User": + """Updates publishing user. + + Description for Updates publishing user. + + :param user_details: Details of publishing user. + :type user_details: ~azure.mgmt.web.v2020_06_01.models.User + :keyword callable cls: A custom type or function that will be passed the direct response + :return: User, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.User + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_publishing_user.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(user_details, 'User') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_publishing_user.metadata = {'url': '/providers/Microsoft.Web/publishingUsers/web'} # type: ignore + + def list_source_controls( + self, + **kwargs + ) -> AsyncIterable["_models.SourceControlCollection"]: + """Gets the source controls available for Azure websites. + + Description for Gets the source controls available for Azure websites. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SourceControlCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.SourceControlCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_source_controls.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SourceControlCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_source_controls.metadata = {'url': '/providers/Microsoft.Web/sourcecontrols'} # type: ignore + + async def get_source_control( + self, + source_control_type: str, + **kwargs + ) -> "_models.SourceControl": + """Gets source control token. + + Description for Gets source control token. + + :param source_control_type: Type of source control. + :type source_control_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'sourceControlType': self._serialize.url("source_control_type", source_control_type, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_source_control.metadata = {'url': '/providers/Microsoft.Web/sourcecontrols/{sourceControlType}'} # type: ignore + + async def update_source_control( + self, + source_control_type: str, + request_message: "_models.SourceControl", + **kwargs + ) -> "_models.SourceControl": + """Updates source control token. + + Description for Updates source control token. + + :param source_control_type: Type of source control. + :type source_control_type: str + :param request_message: Source control token information. + :type request_message: ~azure.mgmt.web.v2020_06_01.models.SourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'sourceControlType': self._serialize.url("source_control_type", source_control_type, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request_message, 'SourceControl') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_source_control.metadata = {'url': '/providers/Microsoft.Web/sourcecontrols/{sourceControlType}'} # type: ignore + + def list_billing_meters( + self, + billing_location: Optional[str] = None, + os_type: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.BillingMeterCollection"]: + """Gets a list of meters for a given location. + + Description for Gets a list of meters for a given location. + + :param billing_location: Azure Location of billable resource. + :type billing_location: str + :param os_type: App Service OS type meters used for. + :type os_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BillingMeterCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.BillingMeterCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BillingMeterCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_billing_meters.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if billing_location is not None: + query_parameters['billingLocation'] = self._serialize.query("billing_location", billing_location, 'str') + if os_type is not None: + query_parameters['osType'] = self._serialize.query("os_type", os_type, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BillingMeterCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_billing_meters.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters'} # type: ignore + + async def check_name_availability( + self, + name: str, + type: Union[str, "_models.CheckNameResourceTypes"], + is_fqdn: Optional[bool] = None, + **kwargs + ) -> "_models.ResourceNameAvailability": + """Check if a resource name is available. + + Description for Check if a resource name is available. + + :param name: Resource name to verify. + :type name: str + :param type: Resource type used for verification. + :type type: str or ~azure.mgmt.web.v2020_06_01.models.CheckNameResourceTypes + :param is_fqdn: Is fully qualified domain name. + :type is_fqdn: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceNameAvailability, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ResourceNameAvailability + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNameAvailability"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _request = _models.ResourceNameAvailabilityRequest(name=name, type=type, is_fqdn=is_fqdn) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_request, 'ResourceNameAvailabilityRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceNameAvailability', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability'} # type: ignore + + async def get_subscription_deployment_locations( + self, + **kwargs + ) -> "_models.DeploymentLocations": + """Gets list of available geo regions plus ministamps. + + Description for Gets list of available geo regions plus ministamps. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeploymentLocations, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DeploymentLocations + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLocations"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_subscription_deployment_locations.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeploymentLocations', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_subscription_deployment_locations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/deploymentLocations'} # type: ignore + + def list_geo_regions( + self, + sku: Optional[Union[str, "_models.SkuName"]] = None, + linux_workers_enabled: Optional[bool] = None, + xenon_workers_enabled: Optional[bool] = None, + linux_dynamic_workers_enabled: Optional[bool] = None, + **kwargs + ) -> AsyncIterable["_models.GeoRegionCollection"]: + """Get a list of available geographical regions. + + Description for Get a list of available geographical regions. + + :param sku: Name of SKU used to filter the regions. + :type sku: str or ~azure.mgmt.web.v2020_06_01.models.SkuName + :param linux_workers_enabled: Specify :code:`true` if you want to filter to only + regions that support Linux workers. + :type linux_workers_enabled: bool + :param xenon_workers_enabled: Specify :code:`true` if you want to filter to only + regions that support Xenon workers. + :type xenon_workers_enabled: bool + :param linux_dynamic_workers_enabled: Specify :code:`true` if you want to filter + to only regions that support Linux Consumption Workers. + :type linux_dynamic_workers_enabled: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GeoRegionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.GeoRegionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GeoRegionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_geo_regions.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if sku is not None: + query_parameters['sku'] = self._serialize.query("sku", sku, 'str') + if linux_workers_enabled is not None: + query_parameters['linuxWorkersEnabled'] = self._serialize.query("linux_workers_enabled", linux_workers_enabled, 'bool') + if xenon_workers_enabled is not None: + query_parameters['xenonWorkersEnabled'] = self._serialize.query("xenon_workers_enabled", xenon_workers_enabled, 'bool') + if linux_dynamic_workers_enabled is not None: + query_parameters['linuxDynamicWorkersEnabled'] = self._serialize.query("linux_dynamic_workers_enabled", linux_dynamic_workers_enabled, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('GeoRegionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_geo_regions.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/geoRegions'} # type: ignore + + def list_site_identifiers_assigned_to_host_name( + self, + name_identifier: "_models.NameIdentifier", + **kwargs + ) -> AsyncIterable["_models.IdentifierCollection"]: + """List all apps that are assigned to a hostname. + + Description for List all apps that are assigned to a hostname. + + :param name_identifier: Hostname information. + :type name_identifier: ~azure.mgmt.web.v2020_06_01.models.NameIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IdentifierCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.IdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_identifiers_assigned_to_host_name.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(name_identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(name_identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_identifiers_assigned_to_host_name.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/listSitesAssignedToHostName'} # type: ignore + + def list_premier_add_on_offers( + self, + **kwargs + ) -> AsyncIterable["_models.PremierAddOnOfferCollection"]: + """List all premier add-on offers. + + Description for List all premier add-on offers. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PremierAddOnOfferCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_06_01.models.PremierAddOnOfferCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOnOfferCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_premier_add_on_offers.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PremierAddOnOfferCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_premier_add_on_offers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/premieraddonoffers'} # type: ignore + + async def list_skus( + self, + **kwargs + ) -> "_models.SkuInfos": + """List all SKUs. + + Description for List all SKUs. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuInfos, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SkuInfos + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInfos"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuInfos', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/skus'} # type: ignore + + async def verify_hosting_environment_vnet( + self, + parameters: "_models.VnetParameters", + **kwargs + ) -> "_models.VnetValidationFailureDetails": + """Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules. + + Description for Verifies if this VNET is compatible with an App Service Environment by + analyzing the Network Security Group rules. + + :param parameters: VNET information. + :type parameters: ~azure.mgmt.web.v2020_06_01.models.VnetParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetValidationFailureDetails, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetValidationFailureDetails + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetValidationFailureDetails"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.verify_hosting_environment_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VnetParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetValidationFailureDetails', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + verify_hosting_environment_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/verifyHostingEnvironmentVnet'} # type: ignore + + async def move( + self, + resource_group_name: str, + move_resource_envelope: "_models.CsmMoveResourceEnvelope", + **kwargs + ) -> None: + """Move resources between resource groups. + + Description for Move resources between resource groups. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param move_resource_envelope: Object that represents the resource to move. + :type move_resource_envelope: ~azure.mgmt.web.v2020_06_01.models.CsmMoveResourceEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.move.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(move_resource_envelope, 'CsmMoveResourceEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources'} # type: ignore + + async def validate( + self, + resource_group_name: str, + validate_request: "_models.ValidateRequest", + **kwargs + ) -> "_models.ValidateResponse": + """Validate if a resource can be created. + + Description for Validate if a resource can be created. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param validate_request: Request with the resources to validate. + :type validate_request: ~azure.mgmt.web.v2020_06_01.models.ValidateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidateResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ValidateResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(validate_request, 'ValidateRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ValidateResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validate'} # type: ignore + + async def validate_move( + self, + resource_group_name: str, + move_resource_envelope: "_models.CsmMoveResourceEnvelope", + **kwargs + ) -> None: + """Validate whether a resource can be moved. + + Description for Validate whether a resource can be moved. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param move_resource_envelope: Object that represents the resource to move. + :type move_resource_envelope: ~azure.mgmt.web.v2020_06_01.models.CsmMoveResourceEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_move.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(move_resource_envelope, 'CsmMoveResourceEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + validate_move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/validateMoveResources'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/models/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/models/__init__.py new file mode 100644 index 000000000000..897de4ac0ea2 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/models/__init__.py @@ -0,0 +1,1199 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AbnormalTimePeriod + from ._models_py3 import Address + from ._models_py3 import AddressResponse + from ._models_py3 import AllowedAudiencesValidation + from ._models_py3 import AnalysisData + from ._models_py3 import AnalysisDefinition + from ._models_py3 import ApiDefinitionInfo + from ._models_py3 import ApiManagementConfig + from ._models_py3 import AppRegistration + from ._models_py3 import AppServiceCertificate + from ._models_py3 import AppServiceCertificateCollection + from ._models_py3 import AppServiceCertificateOrder + from ._models_py3 import AppServiceCertificateOrderCollection + from ._models_py3 import AppServiceCertificateOrderPatchResource + from ._models_py3 import AppServiceCertificatePatchResource + from ._models_py3 import AppServiceCertificateResource + from ._models_py3 import AppServiceEnvironment + from ._models_py3 import AppServiceEnvironmentCollection + from ._models_py3 import AppServiceEnvironmentPatchResource + from ._models_py3 import AppServiceEnvironmentResource + from ._models_py3 import AppServicePlan + from ._models_py3 import AppServicePlanCollection + from ._models_py3 import AppServicePlanPatchResource + from ._models_py3 import ApplicationLogsConfig + from ._models_py3 import ApplicationStack + from ._models_py3 import ApplicationStackCollection + from ._models_py3 import ApplicationStackResource + from ._models_py3 import ArmIdWrapper + from ._models_py3 import AuthPlatform + from ._models_py3 import AutoHealActions + from ._models_py3 import AutoHealCustomAction + from ._models_py3 import AutoHealRules + from ._models_py3 import AutoHealTriggers + from ._models_py3 import AzureActiveDirectory + from ._models_py3 import AzureActiveDirectoryLogin + from ._models_py3 import AzureActiveDirectoryRegistration + from ._models_py3 import AzureActiveDirectoryValidation + from ._models_py3 import AzureBlobStorageApplicationLogsConfig + from ._models_py3 import AzureBlobStorageHttpLogsConfig + from ._models_py3 import AzureStorageInfoValue + from ._models_py3 import AzureStoragePropertyDictionaryResource + from ._models_py3 import AzureTableStorageApplicationLogsConfig + from ._models_py3 import BackupItem + from ._models_py3 import BackupItemCollection + from ._models_py3 import BackupRequest + from ._models_py3 import BackupSchedule + from ._models_py3 import BillingMeter + from ._models_py3 import BillingMeterCollection + from ._models_py3 import BlobStorageTokenStore + from ._models_py3 import Capability + from ._models_py3 import Certificate + from ._models_py3 import CertificateCollection + from ._models_py3 import CertificateDetails + from ._models_py3 import CertificateEmail + from ._models_py3 import CertificateOrderAction + from ._models_py3 import CertificatePatchResource + from ._models_py3 import ClientRegistration + from ._models_py3 import CloningInfo + from ._models_py3 import Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties + from ._models_py3 import ConnStringInfo + from ._models_py3 import ConnStringValueTypePair + from ._models_py3 import ConnectionStringDictionary + from ._models_py3 import Contact + from ._models_py3 import ContainerCpuStatistics + from ._models_py3 import ContainerCpuUsage + from ._models_py3 import ContainerInfo + from ._models_py3 import ContainerMemoryStatistics + from ._models_py3 import ContainerNetworkInterfaceStatistics + from ._models_py3 import ContainerThrottlingData + from ._models_py3 import ContinuousWebJob + from ._models_py3 import ContinuousWebJobCollection + from ._models_py3 import CookieExpiration + from ._models_py3 import CorsSettings + from ._models_py3 import CsmCopySlotEntity + from ._models_py3 import CsmMoveResourceEnvelope + from ._models_py3 import CsmOperationCollection + from ._models_py3 import CsmOperationDescription + from ._models_py3 import CsmOperationDescriptionProperties + from ._models_py3 import CsmOperationDisplay + from ._models_py3 import CsmPublishingCredentialsPoliciesCollection + from ._models_py3 import CsmPublishingCredentialsPoliciesEntity + from ._models_py3 import CsmPublishingProfileOptions + from ._models_py3 import CsmSlotEntity + from ._models_py3 import CsmUsageQuota + from ._models_py3 import CsmUsageQuotaCollection + from ._models_py3 import CustomHostnameAnalysisResult + from ._models_py3 import CustomOpenIdConnectProvider + from ._models_py3 import DataSource + from ._models_py3 import DataTableResponseColumn + from ._models_py3 import DataTableResponseObject + from ._models_py3 import DatabaseBackupSetting + from ._models_py3 import DefaultErrorResponse + from ._models_py3 import DefaultErrorResponseError + from ._models_py3 import DefaultErrorResponseErrorDetailsItem + from ._models_py3 import DeletedAppRestoreRequest + from ._models_py3 import DeletedSite + from ._models_py3 import DeletedWebAppCollection + from ._models_py3 import Deployment + from ._models_py3 import DeploymentCollection + from ._models_py3 import DeploymentLocations + from ._models_py3 import DetectorAbnormalTimePeriod + from ._models_py3 import DetectorDefinition + from ._models_py3 import DetectorInfo + from ._models_py3 import DetectorResponse + from ._models_py3 import DetectorResponseCollection + from ._models_py3 import DiagnosticAnalysis + from ._models_py3 import DiagnosticAnalysisCollection + from ._models_py3 import DiagnosticCategory + from ._models_py3 import DiagnosticCategoryCollection + from ._models_py3 import DiagnosticData + from ._models_py3 import DiagnosticDetectorCollection + from ._models_py3 import DiagnosticDetectorResponse + from ._models_py3 import DiagnosticMetricSample + from ._models_py3 import DiagnosticMetricSet + from ._models_py3 import Dimension + from ._models_py3 import Domain + from ._models_py3 import DomainAvailabilityCheckResult + from ._models_py3 import DomainCollection + from ._models_py3 import DomainControlCenterSsoRequest + from ._models_py3 import DomainOwnershipIdentifier + from ._models_py3 import DomainOwnershipIdentifierCollection + from ._models_py3 import DomainPatchResource + from ._models_py3 import DomainPurchaseConsent + from ._models_py3 import DomainRecommendationSearchParameters + from ._models_py3 import EnabledConfig + from ._models_py3 import EndpointDependency + from ._models_py3 import EndpointDetail + from ._models_py3 import ErrorEntity + from ._models_py3 import Experiments + from ._models_py3 import Facebook + from ._models_py3 import FileSystemApplicationLogsConfig + from ._models_py3 import FileSystemHttpLogsConfig + from ._models_py3 import FileSystemTokenStore + from ._models_py3 import ForwardProxy + from ._models_py3 import FunctionEnvelope + from ._models_py3 import FunctionEnvelopeCollection + from ._models_py3 import FunctionSecrets + from ._models_py3 import GeoRegion + from ._models_py3 import GeoRegionCollection + from ._models_py3 import GitHub + from ._models_py3 import GlobalCsmSkuDescription + from ._models_py3 import GlobalValidation + from ._models_py3 import Google + from ._models_py3 import HandlerMapping + from ._models_py3 import HostKeys + from ._models_py3 import HostName + from ._models_py3 import HostNameBinding + from ._models_py3 import HostNameBindingCollection + from ._models_py3 import HostNameSslState + from ._models_py3 import HostingEnvironmentDeploymentInfo + from ._models_py3 import HostingEnvironmentDiagnostics + from ._models_py3 import HostingEnvironmentProfile + from ._models_py3 import HttpLogsConfig + from ._models_py3 import HttpSettings + from ._models_py3 import HttpSettingsRoutes + from ._models_py3 import HybridConnection + from ._models_py3 import HybridConnectionCollection + from ._models_py3 import HybridConnectionKey + from ._models_py3 import HybridConnectionLimits + from ._models_py3 import Identifier + from ._models_py3 import IdentifierCollection + from ._models_py3 import IdentityProviders + from ._models_py3 import InboundEnvironmentEndpoint + from ._models_py3 import InboundEnvironmentEndpointCollection + from ._models_py3 import IpSecurityRestriction + from ._models_py3 import JwtClaimChecks + from ._models_py3 import KeyInfo + from ._models_py3 import LocalizableString + from ._models_py3 import LogSpecification + from ._models_py3 import Login + from ._models_py3 import LoginRoutes + from ._models_py3 import LoginScopes + from ._models_py3 import MSDeploy + from ._models_py3 import MSDeployLog + from ._models_py3 import MSDeployLogEntry + from ._models_py3 import MSDeployStatus + from ._models_py3 import ManagedServiceIdentity + from ._models_py3 import MetricAvailability + from ._models_py3 import MetricSpecification + from ._models_py3 import MigrateMySqlRequest + from ._models_py3 import MigrateMySqlStatus + from ._models_py3 import NameIdentifier + from ._models_py3 import NameIdentifierCollection + from ._models_py3 import NameValuePair + from ._models_py3 import NetworkAccessControlEntry + from ._models_py3 import NetworkFeatures + from ._models_py3 import NetworkTrace + from ._models_py3 import Nonce + from ._models_py3 import OpenIdConnectClientCredential + from ._models_py3 import OpenIdConnectConfig + from ._models_py3 import OpenIdConnectLogin + from ._models_py3 import OpenIdConnectRegistration + from ._models_py3 import Operation + from ._models_py3 import OutboundEnvironmentEndpoint + from ._models_py3 import OutboundEnvironmentEndpointCollection + from ._models_py3 import PerfMonCounterCollection + from ._models_py3 import PerfMonResponse + from ._models_py3 import PerfMonSample + from ._models_py3 import PerfMonSet + from ._models_py3 import PremierAddOn + from ._models_py3 import PremierAddOnOffer + from ._models_py3 import PremierAddOnOfferCollection + from ._models_py3 import PremierAddOnPatchResource + from ._models_py3 import PrivateAccess + from ._models_py3 import PrivateAccessSubnet + from ._models_py3 import PrivateAccessVirtualNetwork + from ._models_py3 import PrivateEndpointConnectionResource + from ._models_py3 import PrivateLinkConnectionApprovalRequestResource + from ._models_py3 import PrivateLinkConnectionState + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourceProperties + from ._models_py3 import PrivateLinkResourcesWrapper + from ._models_py3 import ProcessInfo + from ._models_py3 import ProcessInfoCollection + from ._models_py3 import ProcessModuleInfo + from ._models_py3 import ProcessModuleInfoCollection + from ._models_py3 import ProcessThreadInfo + from ._models_py3 import ProcessThreadInfoCollection + from ._models_py3 import ProxyOnlyResource + from ._models_py3 import PublicCertificate + from ._models_py3 import PublicCertificateCollection + from ._models_py3 import PushSettings + from ._models_py3 import RampUpRule + from ._models_py3 import Recommendation + from ._models_py3 import RecommendationCollection + from ._models_py3 import RecommendationRule + from ._models_py3 import ReissueCertificateOrderRequest + from ._models_py3 import RelayServiceConnectionEntity + from ._models_py3 import Rendering + from ._models_py3 import RenewCertificateOrderRequest + from ._models_py3 import RequestsBasedTrigger + from ._models_py3 import Resource + from ._models_py3 import ResourceCollection + from ._models_py3 import ResourceHealthMetadata + from ._models_py3 import ResourceHealthMetadataCollection + from ._models_py3 import ResourceMetricAvailability + from ._models_py3 import ResourceMetricDefinition + from ._models_py3 import ResourceMetricDefinitionCollection + from ._models_py3 import ResourceNameAvailability + from ._models_py3 import ResourceNameAvailabilityRequest + from ._models_py3 import ResponseMetaData + from ._models_py3 import RestoreRequest + from ._models_py3 import ServiceSpecification + from ._models_py3 import Site + from ._models_py3 import SiteAuthSettings + from ._models_py3 import SiteAuthSettingsV2 + from ._models_py3 import SiteCloneability + from ._models_py3 import SiteCloneabilityCriterion + from ._models_py3 import SiteConfig + from ._models_py3 import SiteConfigResource + from ._models_py3 import SiteConfigResourceCollection + from ._models_py3 import SiteConfigurationSnapshotInfo + from ._models_py3 import SiteConfigurationSnapshotInfoCollection + from ._models_py3 import SiteExtensionInfo + from ._models_py3 import SiteExtensionInfoCollection + from ._models_py3 import SiteLimits + from ._models_py3 import SiteLogsConfig + from ._models_py3 import SiteMachineKey + from ._models_py3 import SitePatchResource + from ._models_py3 import SitePhpErrorLogFlag + from ._models_py3 import SiteSeal + from ._models_py3 import SiteSealRequest + from ._models_py3 import SiteSourceControl + from ._models_py3 import SkuCapacity + from ._models_py3 import SkuDescription + from ._models_py3 import SkuInfo + from ._models_py3 import SkuInfoCollection + from ._models_py3 import SkuInfos + from ._models_py3 import SlotConfigNamesResource + from ._models_py3 import SlotDifference + from ._models_py3 import SlotDifferenceCollection + from ._models_py3 import SlotSwapStatus + from ._models_py3 import SlowRequestsBasedTrigger + from ._models_py3 import Snapshot + from ._models_py3 import SnapshotCollection + from ._models_py3 import SnapshotRecoverySource + from ._models_py3 import SnapshotRestoreRequest + from ._models_py3 import Solution + from ._models_py3 import SourceControl + from ._models_py3 import SourceControlCollection + from ._models_py3 import StackMajorVersion + from ._models_py3 import StackMinorVersion + from ._models_py3 import StampCapacity + from ._models_py3 import StampCapacityCollection + from ._models_py3 import StaticSiteARMResource + from ._models_py3 import StaticSiteBuildARMResource + from ._models_py3 import StaticSiteBuildCollection + from ._models_py3 import StaticSiteBuildProperties + from ._models_py3 import StaticSiteCollection + from ._models_py3 import StaticSiteCustomDomainOverviewARMResource + from ._models_py3 import StaticSiteCustomDomainOverviewCollection + from ._models_py3 import StaticSiteFunctionOverviewARMResource + from ._models_py3 import StaticSiteFunctionOverviewCollection + from ._models_py3 import StaticSitePatchResource + from ._models_py3 import StaticSiteResetPropertiesARMResource + from ._models_py3 import StaticSiteUserARMResource + from ._models_py3 import StaticSiteUserCollection + from ._models_py3 import StaticSiteUserInvitationRequestResource + from ._models_py3 import StaticSiteUserInvitationResponseResource + from ._models_py3 import StaticSitesWorkflowPreview + from ._models_py3 import StaticSitesWorkflowPreviewRequest + from ._models_py3 import StatusCodesBasedTrigger + from ._models_py3 import StorageMigrationOptions + from ._models_py3 import StorageMigrationResponse + from ._models_py3 import StringDictionary + from ._models_py3 import SwiftVirtualNetwork + from ._models_py3 import TldLegalAgreement + from ._models_py3 import TldLegalAgreementCollection + from ._models_py3 import TokenStore + from ._models_py3 import TopLevelDomain + from ._models_py3 import TopLevelDomainAgreementOption + from ._models_py3 import TopLevelDomainCollection + from ._models_py3 import TriggeredJobHistory + from ._models_py3 import TriggeredJobHistoryCollection + from ._models_py3 import TriggeredJobRun + from ._models_py3 import TriggeredWebJob + from ._models_py3 import TriggeredWebJobCollection + from ._models_py3 import Twitter + from ._models_py3 import TwitterRegistration + from ._models_py3 import Usage + from ._models_py3 import UsageCollection + from ._models_py3 import User + from ._models_py3 import ValidateRequest + from ._models_py3 import ValidateResponse + from ._models_py3 import ValidateResponseError + from ._models_py3 import VirtualApplication + from ._models_py3 import VirtualDirectory + from ._models_py3 import VirtualIPMapping + from ._models_py3 import VirtualNetworkProfile + from ._models_py3 import VnetGateway + from ._models_py3 import VnetInfo + from ._models_py3 import VnetParameters + from ._models_py3 import VnetRoute + from ._models_py3 import VnetValidationFailureDetails + from ._models_py3 import VnetValidationTestFailure + from ._models_py3 import WebAppCollection + from ._models_py3 import WebAppInstanceStatusCollection + from ._models_py3 import WebJob + from ._models_py3 import WebJobCollection + from ._models_py3 import WebSiteInstanceStatus + from ._models_py3 import WorkerPool + from ._models_py3 import WorkerPoolCollection + from ._models_py3 import WorkerPoolResource +except (SyntaxError, ImportError): + from ._models import AbnormalTimePeriod # type: ignore + from ._models import Address # type: ignore + from ._models import AddressResponse # type: ignore + from ._models import AllowedAudiencesValidation # type: ignore + from ._models import AnalysisData # type: ignore + from ._models import AnalysisDefinition # type: ignore + from ._models import ApiDefinitionInfo # type: ignore + from ._models import ApiManagementConfig # type: ignore + from ._models import AppRegistration # type: ignore + from ._models import AppServiceCertificate # type: ignore + from ._models import AppServiceCertificateCollection # type: ignore + from ._models import AppServiceCertificateOrder # type: ignore + from ._models import AppServiceCertificateOrderCollection # type: ignore + from ._models import AppServiceCertificateOrderPatchResource # type: ignore + from ._models import AppServiceCertificatePatchResource # type: ignore + from ._models import AppServiceCertificateResource # type: ignore + from ._models import AppServiceEnvironment # type: ignore + from ._models import AppServiceEnvironmentCollection # type: ignore + from ._models import AppServiceEnvironmentPatchResource # type: ignore + from ._models import AppServiceEnvironmentResource # type: ignore + from ._models import AppServicePlan # type: ignore + from ._models import AppServicePlanCollection # type: ignore + from ._models import AppServicePlanPatchResource # type: ignore + from ._models import ApplicationLogsConfig # type: ignore + from ._models import ApplicationStack # type: ignore + from ._models import ApplicationStackCollection # type: ignore + from ._models import ApplicationStackResource # type: ignore + from ._models import ArmIdWrapper # type: ignore + from ._models import AuthPlatform # type: ignore + from ._models import AutoHealActions # type: ignore + from ._models import AutoHealCustomAction # type: ignore + from ._models import AutoHealRules # type: ignore + from ._models import AutoHealTriggers # type: ignore + from ._models import AzureActiveDirectory # type: ignore + from ._models import AzureActiveDirectoryLogin # type: ignore + from ._models import AzureActiveDirectoryRegistration # type: ignore + from ._models import AzureActiveDirectoryValidation # type: ignore + from ._models import AzureBlobStorageApplicationLogsConfig # type: ignore + from ._models import AzureBlobStorageHttpLogsConfig # type: ignore + from ._models import AzureStorageInfoValue # type: ignore + from ._models import AzureStoragePropertyDictionaryResource # type: ignore + from ._models import AzureTableStorageApplicationLogsConfig # type: ignore + from ._models import BackupItem # type: ignore + from ._models import BackupItemCollection # type: ignore + from ._models import BackupRequest # type: ignore + from ._models import BackupSchedule # type: ignore + from ._models import BillingMeter # type: ignore + from ._models import BillingMeterCollection # type: ignore + from ._models import BlobStorageTokenStore # type: ignore + from ._models import Capability # type: ignore + from ._models import Certificate # type: ignore + from ._models import CertificateCollection # type: ignore + from ._models import CertificateDetails # type: ignore + from ._models import CertificateEmail # type: ignore + from ._models import CertificateOrderAction # type: ignore + from ._models import CertificatePatchResource # type: ignore + from ._models import ClientRegistration # type: ignore + from ._models import CloningInfo # type: ignore + from ._models import Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore + from ._models import ConnStringInfo # type: ignore + from ._models import ConnStringValueTypePair # type: ignore + from ._models import ConnectionStringDictionary # type: ignore + from ._models import Contact # type: ignore + from ._models import ContainerCpuStatistics # type: ignore + from ._models import ContainerCpuUsage # type: ignore + from ._models import ContainerInfo # type: ignore + from ._models import ContainerMemoryStatistics # type: ignore + from ._models import ContainerNetworkInterfaceStatistics # type: ignore + from ._models import ContainerThrottlingData # type: ignore + from ._models import ContinuousWebJob # type: ignore + from ._models import ContinuousWebJobCollection # type: ignore + from ._models import CookieExpiration # type: ignore + from ._models import CorsSettings # type: ignore + from ._models import CsmCopySlotEntity # type: ignore + from ._models import CsmMoveResourceEnvelope # type: ignore + from ._models import CsmOperationCollection # type: ignore + from ._models import CsmOperationDescription # type: ignore + from ._models import CsmOperationDescriptionProperties # type: ignore + from ._models import CsmOperationDisplay # type: ignore + from ._models import CsmPublishingCredentialsPoliciesCollection # type: ignore + from ._models import CsmPublishingCredentialsPoliciesEntity # type: ignore + from ._models import CsmPublishingProfileOptions # type: ignore + from ._models import CsmSlotEntity # type: ignore + from ._models import CsmUsageQuota # type: ignore + from ._models import CsmUsageQuotaCollection # type: ignore + from ._models import CustomHostnameAnalysisResult # type: ignore + from ._models import CustomOpenIdConnectProvider # type: ignore + from ._models import DataSource # type: ignore + from ._models import DataTableResponseColumn # type: ignore + from ._models import DataTableResponseObject # type: ignore + from ._models import DatabaseBackupSetting # type: ignore + from ._models import DefaultErrorResponse # type: ignore + from ._models import DefaultErrorResponseError # type: ignore + from ._models import DefaultErrorResponseErrorDetailsItem # type: ignore + from ._models import DeletedAppRestoreRequest # type: ignore + from ._models import DeletedSite # type: ignore + from ._models import DeletedWebAppCollection # type: ignore + from ._models import Deployment # type: ignore + from ._models import DeploymentCollection # type: ignore + from ._models import DeploymentLocations # type: ignore + from ._models import DetectorAbnormalTimePeriod # type: ignore + from ._models import DetectorDefinition # type: ignore + from ._models import DetectorInfo # type: ignore + from ._models import DetectorResponse # type: ignore + from ._models import DetectorResponseCollection # type: ignore + from ._models import DiagnosticAnalysis # type: ignore + from ._models import DiagnosticAnalysisCollection # type: ignore + from ._models import DiagnosticCategory # type: ignore + from ._models import DiagnosticCategoryCollection # type: ignore + from ._models import DiagnosticData # type: ignore + from ._models import DiagnosticDetectorCollection # type: ignore + from ._models import DiagnosticDetectorResponse # type: ignore + from ._models import DiagnosticMetricSample # type: ignore + from ._models import DiagnosticMetricSet # type: ignore + from ._models import Dimension # type: ignore + from ._models import Domain # type: ignore + from ._models import DomainAvailabilityCheckResult # type: ignore + from ._models import DomainCollection # type: ignore + from ._models import DomainControlCenterSsoRequest # type: ignore + from ._models import DomainOwnershipIdentifier # type: ignore + from ._models import DomainOwnershipIdentifierCollection # type: ignore + from ._models import DomainPatchResource # type: ignore + from ._models import DomainPurchaseConsent # type: ignore + from ._models import DomainRecommendationSearchParameters # type: ignore + from ._models import EnabledConfig # type: ignore + from ._models import EndpointDependency # type: ignore + from ._models import EndpointDetail # type: ignore + from ._models import ErrorEntity # type: ignore + from ._models import Experiments # type: ignore + from ._models import Facebook # type: ignore + from ._models import FileSystemApplicationLogsConfig # type: ignore + from ._models import FileSystemHttpLogsConfig # type: ignore + from ._models import FileSystemTokenStore # type: ignore + from ._models import ForwardProxy # type: ignore + from ._models import FunctionEnvelope # type: ignore + from ._models import FunctionEnvelopeCollection # type: ignore + from ._models import FunctionSecrets # type: ignore + from ._models import GeoRegion # type: ignore + from ._models import GeoRegionCollection # type: ignore + from ._models import GitHub # type: ignore + from ._models import GlobalCsmSkuDescription # type: ignore + from ._models import GlobalValidation # type: ignore + from ._models import Google # type: ignore + from ._models import HandlerMapping # type: ignore + from ._models import HostKeys # type: ignore + from ._models import HostName # type: ignore + from ._models import HostNameBinding # type: ignore + from ._models import HostNameBindingCollection # type: ignore + from ._models import HostNameSslState # type: ignore + from ._models import HostingEnvironmentDeploymentInfo # type: ignore + from ._models import HostingEnvironmentDiagnostics # type: ignore + from ._models import HostingEnvironmentProfile # type: ignore + from ._models import HttpLogsConfig # type: ignore + from ._models import HttpSettings # type: ignore + from ._models import HttpSettingsRoutes # type: ignore + from ._models import HybridConnection # type: ignore + from ._models import HybridConnectionCollection # type: ignore + from ._models import HybridConnectionKey # type: ignore + from ._models import HybridConnectionLimits # type: ignore + from ._models import Identifier # type: ignore + from ._models import IdentifierCollection # type: ignore + from ._models import IdentityProviders # type: ignore + from ._models import InboundEnvironmentEndpoint # type: ignore + from ._models import InboundEnvironmentEndpointCollection # type: ignore + from ._models import IpSecurityRestriction # type: ignore + from ._models import JwtClaimChecks # type: ignore + from ._models import KeyInfo # type: ignore + from ._models import LocalizableString # type: ignore + from ._models import LogSpecification # type: ignore + from ._models import Login # type: ignore + from ._models import LoginRoutes # type: ignore + from ._models import LoginScopes # type: ignore + from ._models import MSDeploy # type: ignore + from ._models import MSDeployLog # type: ignore + from ._models import MSDeployLogEntry # type: ignore + from ._models import MSDeployStatus # type: ignore + from ._models import ManagedServiceIdentity # type: ignore + from ._models import MetricAvailability # type: ignore + from ._models import MetricSpecification # type: ignore + from ._models import MigrateMySqlRequest # type: ignore + from ._models import MigrateMySqlStatus # type: ignore + from ._models import NameIdentifier # type: ignore + from ._models import NameIdentifierCollection # type: ignore + from ._models import NameValuePair # type: ignore + from ._models import NetworkAccessControlEntry # type: ignore + from ._models import NetworkFeatures # type: ignore + from ._models import NetworkTrace # type: ignore + from ._models import Nonce # type: ignore + from ._models import OpenIdConnectClientCredential # type: ignore + from ._models import OpenIdConnectConfig # type: ignore + from ._models import OpenIdConnectLogin # type: ignore + from ._models import OpenIdConnectRegistration # type: ignore + from ._models import Operation # type: ignore + from ._models import OutboundEnvironmentEndpoint # type: ignore + from ._models import OutboundEnvironmentEndpointCollection # type: ignore + from ._models import PerfMonCounterCollection # type: ignore + from ._models import PerfMonResponse # type: ignore + from ._models import PerfMonSample # type: ignore + from ._models import PerfMonSet # type: ignore + from ._models import PremierAddOn # type: ignore + from ._models import PremierAddOnOffer # type: ignore + from ._models import PremierAddOnOfferCollection # type: ignore + from ._models import PremierAddOnPatchResource # type: ignore + from ._models import PrivateAccess # type: ignore + from ._models import PrivateAccessSubnet # type: ignore + from ._models import PrivateAccessVirtualNetwork # type: ignore + from ._models import PrivateEndpointConnectionResource # type: ignore + from ._models import PrivateLinkConnectionApprovalRequestResource # type: ignore + from ._models import PrivateLinkConnectionState # type: ignore + from ._models import PrivateLinkResource # type: ignore + from ._models import PrivateLinkResourceProperties # type: ignore + from ._models import PrivateLinkResourcesWrapper # type: ignore + from ._models import ProcessInfo # type: ignore + from ._models import ProcessInfoCollection # type: ignore + from ._models import ProcessModuleInfo # type: ignore + from ._models import ProcessModuleInfoCollection # type: ignore + from ._models import ProcessThreadInfo # type: ignore + from ._models import ProcessThreadInfoCollection # type: ignore + from ._models import ProxyOnlyResource # type: ignore + from ._models import PublicCertificate # type: ignore + from ._models import PublicCertificateCollection # type: ignore + from ._models import PushSettings # type: ignore + from ._models import RampUpRule # type: ignore + from ._models import Recommendation # type: ignore + from ._models import RecommendationCollection # type: ignore + from ._models import RecommendationRule # type: ignore + from ._models import ReissueCertificateOrderRequest # type: ignore + from ._models import RelayServiceConnectionEntity # type: ignore + from ._models import Rendering # type: ignore + from ._models import RenewCertificateOrderRequest # type: ignore + from ._models import RequestsBasedTrigger # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceCollection # type: ignore + from ._models import ResourceHealthMetadata # type: ignore + from ._models import ResourceHealthMetadataCollection # type: ignore + from ._models import ResourceMetricAvailability # type: ignore + from ._models import ResourceMetricDefinition # type: ignore + from ._models import ResourceMetricDefinitionCollection # type: ignore + from ._models import ResourceNameAvailability # type: ignore + from ._models import ResourceNameAvailabilityRequest # type: ignore + from ._models import ResponseMetaData # type: ignore + from ._models import RestoreRequest # type: ignore + from ._models import ServiceSpecification # type: ignore + from ._models import Site # type: ignore + from ._models import SiteAuthSettings # type: ignore + from ._models import SiteAuthSettingsV2 # type: ignore + from ._models import SiteCloneability # type: ignore + from ._models import SiteCloneabilityCriterion # type: ignore + from ._models import SiteConfig # type: ignore + from ._models import SiteConfigResource # type: ignore + from ._models import SiteConfigResourceCollection # type: ignore + from ._models import SiteConfigurationSnapshotInfo # type: ignore + from ._models import SiteConfigurationSnapshotInfoCollection # type: ignore + from ._models import SiteExtensionInfo # type: ignore + from ._models import SiteExtensionInfoCollection # type: ignore + from ._models import SiteLimits # type: ignore + from ._models import SiteLogsConfig # type: ignore + from ._models import SiteMachineKey # type: ignore + from ._models import SitePatchResource # type: ignore + from ._models import SitePhpErrorLogFlag # type: ignore + from ._models import SiteSeal # type: ignore + from ._models import SiteSealRequest # type: ignore + from ._models import SiteSourceControl # type: ignore + from ._models import SkuCapacity # type: ignore + from ._models import SkuDescription # type: ignore + from ._models import SkuInfo # type: ignore + from ._models import SkuInfoCollection # type: ignore + from ._models import SkuInfos # type: ignore + from ._models import SlotConfigNamesResource # type: ignore + from ._models import SlotDifference # type: ignore + from ._models import SlotDifferenceCollection # type: ignore + from ._models import SlotSwapStatus # type: ignore + from ._models import SlowRequestsBasedTrigger # type: ignore + from ._models import Snapshot # type: ignore + from ._models import SnapshotCollection # type: ignore + from ._models import SnapshotRecoverySource # type: ignore + from ._models import SnapshotRestoreRequest # type: ignore + from ._models import Solution # type: ignore + from ._models import SourceControl # type: ignore + from ._models import SourceControlCollection # type: ignore + from ._models import StackMajorVersion # type: ignore + from ._models import StackMinorVersion # type: ignore + from ._models import StampCapacity # type: ignore + from ._models import StampCapacityCollection # type: ignore + from ._models import StaticSiteARMResource # type: ignore + from ._models import StaticSiteBuildARMResource # type: ignore + from ._models import StaticSiteBuildCollection # type: ignore + from ._models import StaticSiteBuildProperties # type: ignore + from ._models import StaticSiteCollection # type: ignore + from ._models import StaticSiteCustomDomainOverviewARMResource # type: ignore + from ._models import StaticSiteCustomDomainOverviewCollection # type: ignore + from ._models import StaticSiteFunctionOverviewARMResource # type: ignore + from ._models import StaticSiteFunctionOverviewCollection # type: ignore + from ._models import StaticSitePatchResource # type: ignore + from ._models import StaticSiteResetPropertiesARMResource # type: ignore + from ._models import StaticSiteUserARMResource # type: ignore + from ._models import StaticSiteUserCollection # type: ignore + from ._models import StaticSiteUserInvitationRequestResource # type: ignore + from ._models import StaticSiteUserInvitationResponseResource # type: ignore + from ._models import StaticSitesWorkflowPreview # type: ignore + from ._models import StaticSitesWorkflowPreviewRequest # type: ignore + from ._models import StatusCodesBasedTrigger # type: ignore + from ._models import StorageMigrationOptions # type: ignore + from ._models import StorageMigrationResponse # type: ignore + from ._models import StringDictionary # type: ignore + from ._models import SwiftVirtualNetwork # type: ignore + from ._models import TldLegalAgreement # type: ignore + from ._models import TldLegalAgreementCollection # type: ignore + from ._models import TokenStore # type: ignore + from ._models import TopLevelDomain # type: ignore + from ._models import TopLevelDomainAgreementOption # type: ignore + from ._models import TopLevelDomainCollection # type: ignore + from ._models import TriggeredJobHistory # type: ignore + from ._models import TriggeredJobHistoryCollection # type: ignore + from ._models import TriggeredJobRun # type: ignore + from ._models import TriggeredWebJob # type: ignore + from ._models import TriggeredWebJobCollection # type: ignore + from ._models import Twitter # type: ignore + from ._models import TwitterRegistration # type: ignore + from ._models import Usage # type: ignore + from ._models import UsageCollection # type: ignore + from ._models import User # type: ignore + from ._models import ValidateRequest # type: ignore + from ._models import ValidateResponse # type: ignore + from ._models import ValidateResponseError # type: ignore + from ._models import VirtualApplication # type: ignore + from ._models import VirtualDirectory # type: ignore + from ._models import VirtualIPMapping # type: ignore + from ._models import VirtualNetworkProfile # type: ignore + from ._models import VnetGateway # type: ignore + from ._models import VnetInfo # type: ignore + from ._models import VnetParameters # type: ignore + from ._models import VnetRoute # type: ignore + from ._models import VnetValidationFailureDetails # type: ignore + from ._models import VnetValidationTestFailure # type: ignore + from ._models import WebAppCollection # type: ignore + from ._models import WebAppInstanceStatusCollection # type: ignore + from ._models import WebJob # type: ignore + from ._models import WebJobCollection # type: ignore + from ._models import WebSiteInstanceStatus # type: ignore + from ._models import WorkerPool # type: ignore + from ._models import WorkerPoolCollection # type: ignore + from ._models import WorkerPoolResource # type: ignore + +from ._web_site_management_client_enums import ( + AccessControlEntryAction, + AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem, + AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem, + AppServicePlanRestrictions, + AutoHealActionType, + AzureResourceType, + AzureStorageState, + AzureStorageType, + BackupItemStatus, + BackupRestoreOperationType, + BuildStatus, + BuiltInAuthenticationProvider, + CertificateOrderActionType, + CertificateOrderStatus, + CertificateProductType, + Channels, + CheckNameResourceTypes, + ClientCertMode, + CloneAbilityResult, + ComputeModeOptions, + ConnectionStringType, + ContinuousWebJobStatus, + CookieExpirationConvention, + CustomHostNameDnsRecordType, + DatabaseType, + DnsType, + DnsVerificationTestResult, + DomainPatchResourcePropertiesDomainNotRenewableReasonsItem, + DomainPropertiesDomainNotRenewableReasonsItem, + DomainStatus, + DomainType, + Enum4, + Enum5, + ForwardProxyConvention, + FrequencyUnit, + FtpsState, + HostNameType, + HostType, + HostingEnvironmentStatus, + InAvailabilityReasonType, + IpFilterTag, + IssueType, + KeyVaultSecretStatus, + LoadBalancingMode, + LogLevel, + MSDeployLogEntryType, + MSDeployProvisioningState, + ManagedPipelineMode, + ManagedServiceIdentityType, + MySqlMigrationType, + NotificationLevel, + OperationStatus, + ProvisioningState, + PublicCertificateLocation, + PublishingProfileFormat, + RedundancyMode, + RenderingType, + ResourceScopeType, + RouteType, + ScmType, + SiteAvailabilityState, + SiteExtensionType, + SiteLoadBalancing, + SiteRuntimeState, + SkuName, + SolutionType, + SslState, + StatusOptions, + SupportedTlsVersions, + TriggerTypes, + TriggeredWebJobStatus, + UnauthenticatedClientAction, + UnauthenticatedClientActionV2, + UsageState, + ValidateResourceTypes, + WebJobType, + WorkerSizeOptions, +) + +__all__ = [ + 'AbnormalTimePeriod', + 'Address', + 'AddressResponse', + 'AllowedAudiencesValidation', + 'AnalysisData', + 'AnalysisDefinition', + 'ApiDefinitionInfo', + 'ApiManagementConfig', + 'AppRegistration', + 'AppServiceCertificate', + 'AppServiceCertificateCollection', + 'AppServiceCertificateOrder', + 'AppServiceCertificateOrderCollection', + 'AppServiceCertificateOrderPatchResource', + 'AppServiceCertificatePatchResource', + 'AppServiceCertificateResource', + 'AppServiceEnvironment', + 'AppServiceEnvironmentCollection', + 'AppServiceEnvironmentPatchResource', + 'AppServiceEnvironmentResource', + 'AppServicePlan', + 'AppServicePlanCollection', + 'AppServicePlanPatchResource', + 'ApplicationLogsConfig', + 'ApplicationStack', + 'ApplicationStackCollection', + 'ApplicationStackResource', + 'ArmIdWrapper', + 'AuthPlatform', + 'AutoHealActions', + 'AutoHealCustomAction', + 'AutoHealRules', + 'AutoHealTriggers', + 'AzureActiveDirectory', + 'AzureActiveDirectoryLogin', + 'AzureActiveDirectoryRegistration', + 'AzureActiveDirectoryValidation', + 'AzureBlobStorageApplicationLogsConfig', + 'AzureBlobStorageHttpLogsConfig', + 'AzureStorageInfoValue', + 'AzureStoragePropertyDictionaryResource', + 'AzureTableStorageApplicationLogsConfig', + 'BackupItem', + 'BackupItemCollection', + 'BackupRequest', + 'BackupSchedule', + 'BillingMeter', + 'BillingMeterCollection', + 'BlobStorageTokenStore', + 'Capability', + 'Certificate', + 'CertificateCollection', + 'CertificateDetails', + 'CertificateEmail', + 'CertificateOrderAction', + 'CertificatePatchResource', + 'ClientRegistration', + 'CloningInfo', + 'Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties', + 'ConnStringInfo', + 'ConnStringValueTypePair', + 'ConnectionStringDictionary', + 'Contact', + 'ContainerCpuStatistics', + 'ContainerCpuUsage', + 'ContainerInfo', + 'ContainerMemoryStatistics', + 'ContainerNetworkInterfaceStatistics', + 'ContainerThrottlingData', + 'ContinuousWebJob', + 'ContinuousWebJobCollection', + 'CookieExpiration', + 'CorsSettings', + 'CsmCopySlotEntity', + 'CsmMoveResourceEnvelope', + 'CsmOperationCollection', + 'CsmOperationDescription', + 'CsmOperationDescriptionProperties', + 'CsmOperationDisplay', + 'CsmPublishingCredentialsPoliciesCollection', + 'CsmPublishingCredentialsPoliciesEntity', + 'CsmPublishingProfileOptions', + 'CsmSlotEntity', + 'CsmUsageQuota', + 'CsmUsageQuotaCollection', + 'CustomHostnameAnalysisResult', + 'CustomOpenIdConnectProvider', + 'DataSource', + 'DataTableResponseColumn', + 'DataTableResponseObject', + 'DatabaseBackupSetting', + 'DefaultErrorResponse', + 'DefaultErrorResponseError', + 'DefaultErrorResponseErrorDetailsItem', + 'DeletedAppRestoreRequest', + 'DeletedSite', + 'DeletedWebAppCollection', + 'Deployment', + 'DeploymentCollection', + 'DeploymentLocations', + 'DetectorAbnormalTimePeriod', + 'DetectorDefinition', + 'DetectorInfo', + 'DetectorResponse', + 'DetectorResponseCollection', + 'DiagnosticAnalysis', + 'DiagnosticAnalysisCollection', + 'DiagnosticCategory', + 'DiagnosticCategoryCollection', + 'DiagnosticData', + 'DiagnosticDetectorCollection', + 'DiagnosticDetectorResponse', + 'DiagnosticMetricSample', + 'DiagnosticMetricSet', + 'Dimension', + 'Domain', + 'DomainAvailabilityCheckResult', + 'DomainCollection', + 'DomainControlCenterSsoRequest', + 'DomainOwnershipIdentifier', + 'DomainOwnershipIdentifierCollection', + 'DomainPatchResource', + 'DomainPurchaseConsent', + 'DomainRecommendationSearchParameters', + 'EnabledConfig', + 'EndpointDependency', + 'EndpointDetail', + 'ErrorEntity', + 'Experiments', + 'Facebook', + 'FileSystemApplicationLogsConfig', + 'FileSystemHttpLogsConfig', + 'FileSystemTokenStore', + 'ForwardProxy', + 'FunctionEnvelope', + 'FunctionEnvelopeCollection', + 'FunctionSecrets', + 'GeoRegion', + 'GeoRegionCollection', + 'GitHub', + 'GlobalCsmSkuDescription', + 'GlobalValidation', + 'Google', + 'HandlerMapping', + 'HostKeys', + 'HostName', + 'HostNameBinding', + 'HostNameBindingCollection', + 'HostNameSslState', + 'HostingEnvironmentDeploymentInfo', + 'HostingEnvironmentDiagnostics', + 'HostingEnvironmentProfile', + 'HttpLogsConfig', + 'HttpSettings', + 'HttpSettingsRoutes', + 'HybridConnection', + 'HybridConnectionCollection', + 'HybridConnectionKey', + 'HybridConnectionLimits', + 'Identifier', + 'IdentifierCollection', + 'IdentityProviders', + 'InboundEnvironmentEndpoint', + 'InboundEnvironmentEndpointCollection', + 'IpSecurityRestriction', + 'JwtClaimChecks', + 'KeyInfo', + 'LocalizableString', + 'LogSpecification', + 'Login', + 'LoginRoutes', + 'LoginScopes', + 'MSDeploy', + 'MSDeployLog', + 'MSDeployLogEntry', + 'MSDeployStatus', + 'ManagedServiceIdentity', + 'MetricAvailability', + 'MetricSpecification', + 'MigrateMySqlRequest', + 'MigrateMySqlStatus', + 'NameIdentifier', + 'NameIdentifierCollection', + 'NameValuePair', + 'NetworkAccessControlEntry', + 'NetworkFeatures', + 'NetworkTrace', + 'Nonce', + 'OpenIdConnectClientCredential', + 'OpenIdConnectConfig', + 'OpenIdConnectLogin', + 'OpenIdConnectRegistration', + 'Operation', + 'OutboundEnvironmentEndpoint', + 'OutboundEnvironmentEndpointCollection', + 'PerfMonCounterCollection', + 'PerfMonResponse', + 'PerfMonSample', + 'PerfMonSet', + 'PremierAddOn', + 'PremierAddOnOffer', + 'PremierAddOnOfferCollection', + 'PremierAddOnPatchResource', + 'PrivateAccess', + 'PrivateAccessSubnet', + 'PrivateAccessVirtualNetwork', + 'PrivateEndpointConnectionResource', + 'PrivateLinkConnectionApprovalRequestResource', + 'PrivateLinkConnectionState', + 'PrivateLinkResource', + 'PrivateLinkResourceProperties', + 'PrivateLinkResourcesWrapper', + 'ProcessInfo', + 'ProcessInfoCollection', + 'ProcessModuleInfo', + 'ProcessModuleInfoCollection', + 'ProcessThreadInfo', + 'ProcessThreadInfoCollection', + 'ProxyOnlyResource', + 'PublicCertificate', + 'PublicCertificateCollection', + 'PushSettings', + 'RampUpRule', + 'Recommendation', + 'RecommendationCollection', + 'RecommendationRule', + 'ReissueCertificateOrderRequest', + 'RelayServiceConnectionEntity', + 'Rendering', + 'RenewCertificateOrderRequest', + 'RequestsBasedTrigger', + 'Resource', + 'ResourceCollection', + 'ResourceHealthMetadata', + 'ResourceHealthMetadataCollection', + 'ResourceMetricAvailability', + 'ResourceMetricDefinition', + 'ResourceMetricDefinitionCollection', + 'ResourceNameAvailability', + 'ResourceNameAvailabilityRequest', + 'ResponseMetaData', + 'RestoreRequest', + 'ServiceSpecification', + 'Site', + 'SiteAuthSettings', + 'SiteAuthSettingsV2', + 'SiteCloneability', + 'SiteCloneabilityCriterion', + 'SiteConfig', + 'SiteConfigResource', + 'SiteConfigResourceCollection', + 'SiteConfigurationSnapshotInfo', + 'SiteConfigurationSnapshotInfoCollection', + 'SiteExtensionInfo', + 'SiteExtensionInfoCollection', + 'SiteLimits', + 'SiteLogsConfig', + 'SiteMachineKey', + 'SitePatchResource', + 'SitePhpErrorLogFlag', + 'SiteSeal', + 'SiteSealRequest', + 'SiteSourceControl', + 'SkuCapacity', + 'SkuDescription', + 'SkuInfo', + 'SkuInfoCollection', + 'SkuInfos', + 'SlotConfigNamesResource', + 'SlotDifference', + 'SlotDifferenceCollection', + 'SlotSwapStatus', + 'SlowRequestsBasedTrigger', + 'Snapshot', + 'SnapshotCollection', + 'SnapshotRecoverySource', + 'SnapshotRestoreRequest', + 'Solution', + 'SourceControl', + 'SourceControlCollection', + 'StackMajorVersion', + 'StackMinorVersion', + 'StampCapacity', + 'StampCapacityCollection', + 'StaticSiteARMResource', + 'StaticSiteBuildARMResource', + 'StaticSiteBuildCollection', + 'StaticSiteBuildProperties', + 'StaticSiteCollection', + 'StaticSiteCustomDomainOverviewARMResource', + 'StaticSiteCustomDomainOverviewCollection', + 'StaticSiteFunctionOverviewARMResource', + 'StaticSiteFunctionOverviewCollection', + 'StaticSitePatchResource', + 'StaticSiteResetPropertiesARMResource', + 'StaticSiteUserARMResource', + 'StaticSiteUserCollection', + 'StaticSiteUserInvitationRequestResource', + 'StaticSiteUserInvitationResponseResource', + 'StaticSitesWorkflowPreview', + 'StaticSitesWorkflowPreviewRequest', + 'StatusCodesBasedTrigger', + 'StorageMigrationOptions', + 'StorageMigrationResponse', + 'StringDictionary', + 'SwiftVirtualNetwork', + 'TldLegalAgreement', + 'TldLegalAgreementCollection', + 'TokenStore', + 'TopLevelDomain', + 'TopLevelDomainAgreementOption', + 'TopLevelDomainCollection', + 'TriggeredJobHistory', + 'TriggeredJobHistoryCollection', + 'TriggeredJobRun', + 'TriggeredWebJob', + 'TriggeredWebJobCollection', + 'Twitter', + 'TwitterRegistration', + 'Usage', + 'UsageCollection', + 'User', + 'ValidateRequest', + 'ValidateResponse', + 'ValidateResponseError', + 'VirtualApplication', + 'VirtualDirectory', + 'VirtualIPMapping', + 'VirtualNetworkProfile', + 'VnetGateway', + 'VnetInfo', + 'VnetParameters', + 'VnetRoute', + 'VnetValidationFailureDetails', + 'VnetValidationTestFailure', + 'WebAppCollection', + 'WebAppInstanceStatusCollection', + 'WebJob', + 'WebJobCollection', + 'WebSiteInstanceStatus', + 'WorkerPool', + 'WorkerPoolCollection', + 'WorkerPoolResource', + 'AccessControlEntryAction', + 'AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem', + 'AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem', + 'AppServicePlanRestrictions', + 'AutoHealActionType', + 'AzureResourceType', + 'AzureStorageState', + 'AzureStorageType', + 'BackupItemStatus', + 'BackupRestoreOperationType', + 'BuildStatus', + 'BuiltInAuthenticationProvider', + 'CertificateOrderActionType', + 'CertificateOrderStatus', + 'CertificateProductType', + 'Channels', + 'CheckNameResourceTypes', + 'ClientCertMode', + 'CloneAbilityResult', + 'ComputeModeOptions', + 'ConnectionStringType', + 'ContinuousWebJobStatus', + 'CookieExpirationConvention', + 'CustomHostNameDnsRecordType', + 'DatabaseType', + 'DnsType', + 'DnsVerificationTestResult', + 'DomainPatchResourcePropertiesDomainNotRenewableReasonsItem', + 'DomainPropertiesDomainNotRenewableReasonsItem', + 'DomainStatus', + 'DomainType', + 'Enum4', + 'Enum5', + 'ForwardProxyConvention', + 'FrequencyUnit', + 'FtpsState', + 'HostNameType', + 'HostType', + 'HostingEnvironmentStatus', + 'InAvailabilityReasonType', + 'IpFilterTag', + 'IssueType', + 'KeyVaultSecretStatus', + 'LoadBalancingMode', + 'LogLevel', + 'MSDeployLogEntryType', + 'MSDeployProvisioningState', + 'ManagedPipelineMode', + 'ManagedServiceIdentityType', + 'MySqlMigrationType', + 'NotificationLevel', + 'OperationStatus', + 'ProvisioningState', + 'PublicCertificateLocation', + 'PublishingProfileFormat', + 'RedundancyMode', + 'RenderingType', + 'ResourceScopeType', + 'RouteType', + 'ScmType', + 'SiteAvailabilityState', + 'SiteExtensionType', + 'SiteLoadBalancing', + 'SiteRuntimeState', + 'SkuName', + 'SolutionType', + 'SslState', + 'StatusOptions', + 'SupportedTlsVersions', + 'TriggerTypes', + 'TriggeredWebJobStatus', + 'UnauthenticatedClientAction', + 'UnauthenticatedClientActionV2', + 'UsageState', + 'ValidateResourceTypes', + 'WebJobType', + 'WorkerSizeOptions', +] diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/models/_models.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/models/_models.py new file mode 100644 index 000000000000..6b1ed1fdf867 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/models/_models.py @@ -0,0 +1,16943 @@ +# 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.core.exceptions import HttpResponseError +import msrest.serialization + + +class AbnormalTimePeriod(msrest.serialization.Model): + """Class representing Abnormal Time Period identified in diagnosis. + + :param start_time: Start time of the downtime. + :type start_time: ~datetime.datetime + :param end_time: End time of the downtime. + :type end_time: ~datetime.datetime + :param events: List of Possible Cause of downtime. + :type events: list[~azure.mgmt.web.v2020_06_01.models.DetectorAbnormalTimePeriod] + :param solutions: List of proposed solutions. + :type solutions: list[~azure.mgmt.web.v2020_06_01.models.Solution] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'events': {'key': 'events', 'type': '[DetectorAbnormalTimePeriod]'}, + 'solutions': {'key': 'solutions', 'type': '[Solution]'}, + } + + def __init__( + self, + **kwargs + ): + super(AbnormalTimePeriod, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.events = kwargs.get('events', None) + self.solutions = kwargs.get('solutions', None) + + +class Address(msrest.serialization.Model): + """Address information for domain registration. + + All required parameters must be populated in order to send to Azure. + + :param address1: Required. First line of an Address. + :type address1: str + :param address2: The second line of the Address. Optional. + :type address2: str + :param city: Required. The city for the address. + :type city: str + :param country: Required. The country for the address. + :type country: str + :param postal_code: Required. The postal code for the address. + :type postal_code: str + :param state: Required. The state or province for the address. + :type state: str + """ + + _validation = { + 'address1': {'required': True}, + 'city': {'required': True}, + 'country': {'required': True}, + 'postal_code': {'required': True}, + 'state': {'required': True}, + } + + _attribute_map = { + 'address1': {'key': 'address1', 'type': 'str'}, + 'address2': {'key': 'address2', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Address, self).__init__(**kwargs) + self.address1 = kwargs['address1'] + self.address2 = kwargs.get('address2', None) + self.city = kwargs['city'] + self.country = kwargs['country'] + self.postal_code = kwargs['postal_code'] + self.state = kwargs['state'] + + +class ProxyOnlyResource(msrest.serialization.Model): + """Azure proxy only resource. This resource is not tracked by Azure Resource Manager. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyOnlyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.kind = kwargs.get('kind', None) + self.type = None + + +class AddressResponse(ProxyOnlyResource): + """Describes main public IP address and any extra virtual IPs. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param service_ip_address: Main public virtual IP. + :type service_ip_address: str + :param internal_ip_address: Virtual Network internal IP address of the App Service Environment + if it is in internal load-balancing mode. + :type internal_ip_address: str + :param outbound_ip_addresses: IP addresses appearing on outbound connections. + :type outbound_ip_addresses: list[str] + :param vip_mappings: Additional virtual IPs. + :type vip_mappings: list[~azure.mgmt.web.v2020_06_01.models.VirtualIPMapping] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'service_ip_address': {'key': 'properties.serviceIpAddress', 'type': 'str'}, + 'internal_ip_address': {'key': 'properties.internalIpAddress', 'type': 'str'}, + 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': '[str]'}, + 'vip_mappings': {'key': 'properties.vipMappings', 'type': '[VirtualIPMapping]'}, + } + + def __init__( + self, + **kwargs + ): + super(AddressResponse, self).__init__(**kwargs) + self.service_ip_address = kwargs.get('service_ip_address', None) + self.internal_ip_address = kwargs.get('internal_ip_address', None) + self.outbound_ip_addresses = kwargs.get('outbound_ip_addresses', None) + self.vip_mappings = kwargs.get('vip_mappings', None) + + +class AllowedAudiencesValidation(ProxyOnlyResource): + """AllowedAudiencesValidation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param allowed_audiences: + :type allowed_audiences: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AllowedAudiencesValidation, self).__init__(**kwargs) + self.allowed_audiences = kwargs.get('allowed_audiences', None) + + +class AnalysisData(msrest.serialization.Model): + """Class Representing Detector Evidence used for analysis. + + :param source: Name of the Detector. + :type source: str + :param detector_definition: Detector Definition. + :type detector_definition: ~azure.mgmt.web.v2020_06_01.models.DetectorDefinition + :param metrics: Source Metrics. + :type metrics: list[~azure.mgmt.web.v2020_06_01.models.DiagnosticMetricSet] + :param data: Additional Source Data. + :type data: list[list[~azure.mgmt.web.v2020_06_01.models.NameValuePair]] + :param detector_meta_data: Detector Meta Data. + :type detector_meta_data: ~azure.mgmt.web.v2020_06_01.models.ResponseMetaData + """ + + _attribute_map = { + 'source': {'key': 'source', 'type': 'str'}, + 'detector_definition': {'key': 'detectorDefinition', 'type': 'DetectorDefinition'}, + 'metrics': {'key': 'metrics', 'type': '[DiagnosticMetricSet]'}, + 'data': {'key': 'data', 'type': '[[NameValuePair]]'}, + 'detector_meta_data': {'key': 'detectorMetaData', 'type': 'ResponseMetaData'}, + } + + def __init__( + self, + **kwargs + ): + super(AnalysisData, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.detector_definition = kwargs.get('detector_definition', None) + self.metrics = kwargs.get('metrics', None) + self.data = kwargs.get('data', None) + self.detector_meta_data = kwargs.get('detector_meta_data', None) + + +class AnalysisDefinition(ProxyOnlyResource): + """Definition of Analysis. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar description: Description of the Analysis. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AnalysisDefinition, self).__init__(**kwargs) + self.description = None + + +class ApiDefinitionInfo(msrest.serialization.Model): + """Information about the formal API definition for the app. + + :param url: The URL of the API definition. + :type url: str + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiDefinitionInfo, self).__init__(**kwargs) + self.url = kwargs.get('url', None) + + +class ApiManagementConfig(msrest.serialization.Model): + """Azure API management (APIM) configuration linked to the app. + + :param id: APIM-Api Identifier. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiManagementConfig, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class ApplicationLogsConfig(msrest.serialization.Model): + """Application logs configuration. + + :param file_system: Application logs to file system configuration. + :type file_system: ~azure.mgmt.web.v2020_06_01.models.FileSystemApplicationLogsConfig + :param azure_table_storage: Application logs to azure table storage configuration. + :type azure_table_storage: + ~azure.mgmt.web.v2020_06_01.models.AzureTableStorageApplicationLogsConfig + :param azure_blob_storage: Application logs to blob storage configuration. + :type azure_blob_storage: + ~azure.mgmt.web.v2020_06_01.models.AzureBlobStorageApplicationLogsConfig + """ + + _attribute_map = { + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemApplicationLogsConfig'}, + 'azure_table_storage': {'key': 'azureTableStorage', 'type': 'AzureTableStorageApplicationLogsConfig'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'AzureBlobStorageApplicationLogsConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationLogsConfig, self).__init__(**kwargs) + self.file_system = kwargs.get('file_system', None) + self.azure_table_storage = kwargs.get('azure_table_storage', None) + self.azure_blob_storage = kwargs.get('azure_blob_storage', None) + + +class ApplicationStack(msrest.serialization.Model): + """Application stack. + + :param name: Application stack name. + :type name: str + :param display: Application stack display name. + :type display: str + :param dependency: Application stack dependency. + :type dependency: str + :param major_versions: List of major versions available. + :type major_versions: list[~azure.mgmt.web.v2020_06_01.models.StackMajorVersion] + :param frameworks: List of frameworks associated with application stack. + :type frameworks: list[~azure.mgmt.web.v2020_06_01.models.ApplicationStack] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'str'}, + 'dependency': {'key': 'dependency', 'type': 'str'}, + 'major_versions': {'key': 'majorVersions', 'type': '[StackMajorVersion]'}, + 'frameworks': {'key': 'frameworks', 'type': '[ApplicationStack]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationStack, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.dependency = kwargs.get('dependency', None) + self.major_versions = kwargs.get('major_versions', None) + self.frameworks = kwargs.get('frameworks', None) + + +class ApplicationStackCollection(msrest.serialization.Model): + """Collection of Application Stacks. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.ApplicationStackResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationStackResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationStackCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class ApplicationStackResource(ProxyOnlyResource): + """ARM resource for a ApplicationStack. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param name_properties_name: Application stack name. + :type name_properties_name: str + :param display: Application stack display name. + :type display: str + :param dependency: Application stack dependency. + :type dependency: str + :param major_versions: List of major versions available. + :type major_versions: list[~azure.mgmt.web.v2020_06_01.models.StackMajorVersion] + :param frameworks: List of frameworks associated with application stack. + :type frameworks: list[~azure.mgmt.web.v2020_06_01.models.ApplicationStack] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'display': {'key': 'properties.display', 'type': 'str'}, + 'dependency': {'key': 'properties.dependency', 'type': 'str'}, + 'major_versions': {'key': 'properties.majorVersions', 'type': '[StackMajorVersion]'}, + 'frameworks': {'key': 'properties.frameworks', 'type': '[ApplicationStack]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationStackResource, self).__init__(**kwargs) + self.name_properties_name = kwargs.get('name_properties_name', None) + self.display = kwargs.get('display', None) + self.dependency = kwargs.get('dependency', None) + self.major_versions = kwargs.get('major_versions', None) + self.frameworks = kwargs.get('frameworks', None) + + +class AppRegistration(ProxyOnlyResource): + """AppRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param app_id: + :type app_id: str + :param app_secret_setting_name: + :type app_secret_setting_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'app_id': {'key': 'properties.appId', 'type': 'str'}, + 'app_secret_setting_name': {'key': 'properties.appSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppRegistration, self).__init__(**kwargs) + self.app_id = kwargs.get('app_id', None) + self.app_secret_setting_name = kwargs.get('app_secret_setting_name', None) + + +class AppServiceCertificate(msrest.serialization.Model): + """Key Vault container for a certificate that is purchased through Azure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param key_vault_id: Key Vault resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar provisioning_state: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.KeyVaultSecretStatus + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'key_vault_id': {'key': 'keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'keyVaultSecretName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceCertificate, self).__init__(**kwargs) + self.key_vault_id = kwargs.get('key_vault_id', None) + self.key_vault_secret_name = kwargs.get('key_vault_secret_name', None) + self.provisioning_state = None + + +class AppServiceCertificateCollection(msrest.serialization.Model): + """Collection of certificate order certificates. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServiceCertificateResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceCertificateCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class Resource(msrest.serialization.Model): + """Azure resource. This resource is tracked in Azure Resource Manager. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.kind = kwargs.get('kind', None) + self.location = kwargs['location'] + self.type = None + self.tags = kwargs.get('tags', None) + + +class AppServiceCertificateOrder(Resource): + """SSL certificate purchase order. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param certificates: State of the Key Vault secret. + :type certificates: dict[str, ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificate] + :param distinguished_name: Certificate distinguished name. + :type distinguished_name: str + :ivar domain_verification_token: Domain verification token. + :vartype domain_verification_token: str + :param validity_in_years: Duration in years (must be between 1 and 3). + :type validity_in_years: int + :param key_size: Certificate key size. + :type key_size: int + :param product_type: Certificate product type. Possible values include: + "StandardDomainValidatedSsl", "StandardDomainValidatedWildCardSsl". + :type product_type: str or ~azure.mgmt.web.v2020_06_01.models.CertificateProductType + :param auto_renew: :code:`true` if the certificate should be automatically renewed + when it expires; otherwise, :code:`false`. + :type auto_renew: bool + :ivar provisioning_state: Status of certificate order. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.ProvisioningState + :ivar status: Current order status. Possible values include: "Pendingissuance", "Issued", + "Revoked", "Canceled", "Denied", "Pendingrevocation", "PendingRekey", "Unused", "Expired", + "NotSubmitted". + :vartype status: str or ~azure.mgmt.web.v2020_06_01.models.CertificateOrderStatus + :ivar signed_certificate: Signed certificate. + :vartype signed_certificate: ~azure.mgmt.web.v2020_06_01.models.CertificateDetails + :param csr: Last CSR that was created for this order. + :type csr: str + :ivar intermediate: Intermediate certificate. + :vartype intermediate: ~azure.mgmt.web.v2020_06_01.models.CertificateDetails + :ivar root: Root certificate. + :vartype root: ~azure.mgmt.web.v2020_06_01.models.CertificateDetails + :ivar serial_number: Current serial number of the certificate. + :vartype serial_number: str + :ivar last_certificate_issuance_time: Certificate last issuance time. + :vartype last_certificate_issuance_time: ~datetime.datetime + :ivar expiration_time: Certificate expiration time. + :vartype expiration_time: ~datetime.datetime + :ivar is_private_key_external: :code:`true` if private key is external; otherwise, + :code:`false`. + :vartype is_private_key_external: bool + :ivar app_service_certificate_not_renewable_reasons: Reasons why App Service Certificate is not + renewable at the current moment. + :vartype app_service_certificate_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem] + :ivar next_auto_renewal_time_stamp: Time stamp when the certificate would be auto renewed next. + :vartype next_auto_renewal_time_stamp: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'domain_verification_token': {'readonly': True}, + 'validity_in_years': {'maximum': 3, 'minimum': 1}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'signed_certificate': {'readonly': True}, + 'intermediate': {'readonly': True}, + 'root': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'last_certificate_issuance_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'is_private_key_external': {'readonly': True}, + 'app_service_certificate_not_renewable_reasons': {'readonly': True}, + 'next_auto_renewal_time_stamp': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'certificates': {'key': 'properties.certificates', 'type': '{AppServiceCertificate}'}, + 'distinguished_name': {'key': 'properties.distinguishedName', 'type': 'str'}, + 'domain_verification_token': {'key': 'properties.domainVerificationToken', 'type': 'str'}, + 'validity_in_years': {'key': 'properties.validityInYears', 'type': 'int'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'signed_certificate': {'key': 'properties.signedCertificate', 'type': 'CertificateDetails'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'intermediate': {'key': 'properties.intermediate', 'type': 'CertificateDetails'}, + 'root': {'key': 'properties.root', 'type': 'CertificateDetails'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'last_certificate_issuance_time': {'key': 'properties.lastCertificateIssuanceTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + 'app_service_certificate_not_renewable_reasons': {'key': 'properties.appServiceCertificateNotRenewableReasons', 'type': '[str]'}, + 'next_auto_renewal_time_stamp': {'key': 'properties.nextAutoRenewalTimeStamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceCertificateOrder, self).__init__(**kwargs) + self.certificates = kwargs.get('certificates', None) + self.distinguished_name = kwargs.get('distinguished_name', None) + self.domain_verification_token = None + self.validity_in_years = kwargs.get('validity_in_years', 1) + self.key_size = kwargs.get('key_size', 2048) + self.product_type = kwargs.get('product_type', None) + self.auto_renew = kwargs.get('auto_renew', True) + self.provisioning_state = None + self.status = None + self.signed_certificate = None + self.csr = kwargs.get('csr', None) + self.intermediate = None + self.root = None + self.serial_number = None + self.last_certificate_issuance_time = None + self.expiration_time = None + self.is_private_key_external = None + self.app_service_certificate_not_renewable_reasons = None + self.next_auto_renewal_time_stamp = None + + +class AppServiceCertificateOrderCollection(msrest.serialization.Model): + """Collection of certificate orders. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrder] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServiceCertificateOrder]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceCertificateOrderCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class AppServiceCertificateOrderPatchResource(ProxyOnlyResource): + """ARM resource for a certificate order that is purchased through Azure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param certificates: State of the Key Vault secret. + :type certificates: dict[str, ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificate] + :param distinguished_name: Certificate distinguished name. + :type distinguished_name: str + :ivar domain_verification_token: Domain verification token. + :vartype domain_verification_token: str + :param validity_in_years: Duration in years (must be between 1 and 3). + :type validity_in_years: int + :param key_size: Certificate key size. + :type key_size: int + :param product_type: Certificate product type. Possible values include: + "StandardDomainValidatedSsl", "StandardDomainValidatedWildCardSsl". + :type product_type: str or ~azure.mgmt.web.v2020_06_01.models.CertificateProductType + :param auto_renew: :code:`true` if the certificate should be automatically renewed + when it expires; otherwise, :code:`false`. + :type auto_renew: bool + :ivar provisioning_state: Status of certificate order. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.ProvisioningState + :ivar status: Current order status. Possible values include: "Pendingissuance", "Issued", + "Revoked", "Canceled", "Denied", "Pendingrevocation", "PendingRekey", "Unused", "Expired", + "NotSubmitted". + :vartype status: str or ~azure.mgmt.web.v2020_06_01.models.CertificateOrderStatus + :ivar signed_certificate: Signed certificate. + :vartype signed_certificate: ~azure.mgmt.web.v2020_06_01.models.CertificateDetails + :param csr: Last CSR that was created for this order. + :type csr: str + :ivar intermediate: Intermediate certificate. + :vartype intermediate: ~azure.mgmt.web.v2020_06_01.models.CertificateDetails + :ivar root: Root certificate. + :vartype root: ~azure.mgmt.web.v2020_06_01.models.CertificateDetails + :ivar serial_number: Current serial number of the certificate. + :vartype serial_number: str + :ivar last_certificate_issuance_time: Certificate last issuance time. + :vartype last_certificate_issuance_time: ~datetime.datetime + :ivar expiration_time: Certificate expiration time. + :vartype expiration_time: ~datetime.datetime + :ivar is_private_key_external: :code:`true` if private key is external; otherwise, + :code:`false`. + :vartype is_private_key_external: bool + :ivar app_service_certificate_not_renewable_reasons: Reasons why App Service Certificate is not + renewable at the current moment. + :vartype app_service_certificate_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem] + :ivar next_auto_renewal_time_stamp: Time stamp when the certificate would be auto renewed next. + :vartype next_auto_renewal_time_stamp: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'domain_verification_token': {'readonly': True}, + 'validity_in_years': {'maximum': 3, 'minimum': 1}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'signed_certificate': {'readonly': True}, + 'intermediate': {'readonly': True}, + 'root': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'last_certificate_issuance_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'is_private_key_external': {'readonly': True}, + 'app_service_certificate_not_renewable_reasons': {'readonly': True}, + 'next_auto_renewal_time_stamp': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'certificates': {'key': 'properties.certificates', 'type': '{AppServiceCertificate}'}, + 'distinguished_name': {'key': 'properties.distinguishedName', 'type': 'str'}, + 'domain_verification_token': {'key': 'properties.domainVerificationToken', 'type': 'str'}, + 'validity_in_years': {'key': 'properties.validityInYears', 'type': 'int'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'signed_certificate': {'key': 'properties.signedCertificate', 'type': 'CertificateDetails'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'intermediate': {'key': 'properties.intermediate', 'type': 'CertificateDetails'}, + 'root': {'key': 'properties.root', 'type': 'CertificateDetails'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'last_certificate_issuance_time': {'key': 'properties.lastCertificateIssuanceTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + 'app_service_certificate_not_renewable_reasons': {'key': 'properties.appServiceCertificateNotRenewableReasons', 'type': '[str]'}, + 'next_auto_renewal_time_stamp': {'key': 'properties.nextAutoRenewalTimeStamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceCertificateOrderPatchResource, self).__init__(**kwargs) + self.certificates = kwargs.get('certificates', None) + self.distinguished_name = kwargs.get('distinguished_name', None) + self.domain_verification_token = None + self.validity_in_years = kwargs.get('validity_in_years', 1) + self.key_size = kwargs.get('key_size', 2048) + self.product_type = kwargs.get('product_type', None) + self.auto_renew = kwargs.get('auto_renew', True) + self.provisioning_state = None + self.status = None + self.signed_certificate = None + self.csr = kwargs.get('csr', None) + self.intermediate = None + self.root = None + self.serial_number = None + self.last_certificate_issuance_time = None + self.expiration_time = None + self.is_private_key_external = None + self.app_service_certificate_not_renewable_reasons = None + self.next_auto_renewal_time_stamp = None + + +class AppServiceCertificatePatchResource(ProxyOnlyResource): + """Key Vault container ARM resource for a certificate that is purchased through Azure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param key_vault_id: Key Vault resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar provisioning_state: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.KeyVaultSecretStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceCertificatePatchResource, self).__init__(**kwargs) + self.key_vault_id = kwargs.get('key_vault_id', None) + self.key_vault_secret_name = kwargs.get('key_vault_secret_name', None) + self.provisioning_state = None + + +class AppServiceCertificateResource(Resource): + """Key Vault container ARM resource for a certificate that is purchased through Azure. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param key_vault_id: Key Vault resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar provisioning_state: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.KeyVaultSecretStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceCertificateResource, self).__init__(**kwargs) + self.key_vault_id = kwargs.get('key_vault_id', None) + self.key_vault_secret_name = kwargs.get('key_vault_secret_name', None) + self.provisioning_state = None + + +class AppServiceEnvironment(msrest.serialization.Model): + """Description of an App Service Environment. + + 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. + + :param name: Required. Name of the App Service Environment. + :type name: str + :param location: Required. Location of the App Service Environment, e.g. "West US". + :type location: str + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.ProvisioningState + :ivar status: Current status of the App Service Environment. Possible values include: + "Preparing", "Ready", "Scaling", "Deleting". + :vartype status: str or ~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentStatus + :param vnet_name: Name of the Virtual Network for the App Service Environment. + :type vnet_name: str + :param vnet_resource_group_name: Resource group of the Virtual Network. + :type vnet_resource_group_name: str + :param vnet_subnet_name: Subnet of the Virtual Network. + :type vnet_subnet_name: str + :param virtual_network: Required. Description of the Virtual Network. + :type virtual_network: ~azure.mgmt.web.v2020_06_01.models.VirtualNetworkProfile + :param internal_load_balancing_mode: Specifies which endpoints to serve internally in the + Virtual Network for the App Service Environment. Possible values include: "None", "Web", + "Publishing", "Web,Publishing". + :type internal_load_balancing_mode: str or ~azure.mgmt.web.v2020_06_01.models.LoadBalancingMode + :param multi_size: Front-end VM size, e.g. "Medium", "Large". + :type multi_size: str + :param multi_role_count: Number of front-end instances. + :type multi_role_count: int + :param worker_pools: Required. Description of worker pools with worker size IDs, VM sizes, and + number of workers in each pool. + :type worker_pools: list[~azure.mgmt.web.v2020_06_01.models.WorkerPool] + :param ipssl_address_count: Number of IP SSL addresses reserved for the App Service + Environment. + :type ipssl_address_count: int + :ivar database_edition: Edition of the metadata database for the App Service Environment, e.g. + "Standard". + :vartype database_edition: str + :ivar database_service_objective: Service objective of the metadata database for the App + Service Environment, e.g. "S0". + :vartype database_service_objective: str + :ivar upgrade_domains: Number of upgrade domains of the App Service Environment. + :vartype upgrade_domains: int + :ivar subscription_id: Subscription of the App Service Environment. + :vartype subscription_id: str + :param dns_suffix: DNS suffix of the App Service Environment. + :type dns_suffix: str + :ivar last_action: Last deployment action on the App Service Environment. + :vartype last_action: str + :ivar last_action_result: Result of the last deployment action on the App Service Environment. + :vartype last_action_result: str + :ivar allowed_multi_sizes: List of comma separated strings describing which VM sizes are + allowed for front-ends. + :vartype allowed_multi_sizes: str + :ivar allowed_worker_sizes: List of comma separated strings describing which VM sizes are + allowed for workers. + :vartype allowed_worker_sizes: str + :ivar maximum_number_of_machines: Maximum number of VMs in the App Service Environment. + :vartype maximum_number_of_machines: int + :ivar vip_mappings: Description of IP SSL mapping for the App Service Environment. + :vartype vip_mappings: list[~azure.mgmt.web.v2020_06_01.models.VirtualIPMapping] + :ivar environment_capacities: Current total, used, and available worker capacities. + :vartype environment_capacities: list[~azure.mgmt.web.v2020_06_01.models.StampCapacity] + :param network_access_control_list: Access control list for controlling traffic to the App + Service Environment. + :type network_access_control_list: + list[~azure.mgmt.web.v2020_06_01.models.NetworkAccessControlEntry] + :ivar environment_is_healthy: True/false indicating whether the App Service Environment is + healthy. + :vartype environment_is_healthy: bool + :ivar environment_status: Detailed message about with results of the last check of the App + Service Environment. + :vartype environment_status: str + :ivar resource_group: Resource group of the App Service Environment. + :vartype resource_group: str + :param front_end_scale_factor: Scale factor for front-ends. + :type front_end_scale_factor: int + :ivar default_front_end_scale_factor: Default Scale Factor for FrontEnds. + :vartype default_front_end_scale_factor: int + :param api_management_account_id: API Management Account associated with the App Service + Environment. + :type api_management_account_id: str + :param suspended: :code:`true` if the App Service Environment is suspended; + otherwise, :code:`false`. The environment can be suspended, e.g. when the + management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :type suspended: bool + :param dynamic_cache_enabled: True/false indicating whether the App Service Environment is + suspended. The environment can be suspended e.g. when the management endpoint is no longer + available + (most likely because NSG blocked the incoming traffic). + :type dynamic_cache_enabled: bool + :param cluster_settings: Custom settings for changing the behavior of the App Service + Environment. + :type cluster_settings: list[~azure.mgmt.web.v2020_06_01.models.NameValuePair] + :param user_whitelisted_ip_ranges: User added ip ranges to whitelist on ASE db. + :type user_whitelisted_ip_ranges: list[str] + :param has_linux_workers: Flag that displays whether an ASE has linux workers or not. + :type has_linux_workers: bool + :param ssl_cert_key_vault_id: Key Vault ID for ILB App Service Environment default SSL + certificate. + :type ssl_cert_key_vault_id: str + :param ssl_cert_key_vault_secret_name: Key Vault Secret Name for ILB App Service Environment + default SSL certificate. + :type ssl_cert_key_vault_secret_name: str + """ + + _validation = { + 'name': {'required': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'virtual_network': {'required': True}, + 'worker_pools': {'required': True}, + 'database_edition': {'readonly': True}, + 'database_service_objective': {'readonly': True}, + 'upgrade_domains': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'last_action': {'readonly': True}, + 'last_action_result': {'readonly': True}, + 'allowed_multi_sizes': {'readonly': True}, + 'allowed_worker_sizes': {'readonly': True}, + 'maximum_number_of_machines': {'readonly': True}, + 'vip_mappings': {'readonly': True}, + 'environment_capacities': {'readonly': True}, + 'environment_is_healthy': {'readonly': True}, + 'environment_status': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'default_front_end_scale_factor': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'vnet_name': {'key': 'vnetName', 'type': 'str'}, + 'vnet_resource_group_name': {'key': 'vnetResourceGroupName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'vnetSubnetName', 'type': 'str'}, + 'virtual_network': {'key': 'virtualNetwork', 'type': 'VirtualNetworkProfile'}, + 'internal_load_balancing_mode': {'key': 'internalLoadBalancingMode', 'type': 'str'}, + 'multi_size': {'key': 'multiSize', 'type': 'str'}, + 'multi_role_count': {'key': 'multiRoleCount', 'type': 'int'}, + 'worker_pools': {'key': 'workerPools', 'type': '[WorkerPool]'}, + 'ipssl_address_count': {'key': 'ipsslAddressCount', 'type': 'int'}, + 'database_edition': {'key': 'databaseEdition', 'type': 'str'}, + 'database_service_objective': {'key': 'databaseServiceObjective', 'type': 'str'}, + 'upgrade_domains': {'key': 'upgradeDomains', 'type': 'int'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'dns_suffix': {'key': 'dnsSuffix', 'type': 'str'}, + 'last_action': {'key': 'lastAction', 'type': 'str'}, + 'last_action_result': {'key': 'lastActionResult', 'type': 'str'}, + 'allowed_multi_sizes': {'key': 'allowedMultiSizes', 'type': 'str'}, + 'allowed_worker_sizes': {'key': 'allowedWorkerSizes', 'type': 'str'}, + 'maximum_number_of_machines': {'key': 'maximumNumberOfMachines', 'type': 'int'}, + 'vip_mappings': {'key': 'vipMappings', 'type': '[VirtualIPMapping]'}, + 'environment_capacities': {'key': 'environmentCapacities', 'type': '[StampCapacity]'}, + 'network_access_control_list': {'key': 'networkAccessControlList', 'type': '[NetworkAccessControlEntry]'}, + 'environment_is_healthy': {'key': 'environmentIsHealthy', 'type': 'bool'}, + 'environment_status': {'key': 'environmentStatus', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'front_end_scale_factor': {'key': 'frontEndScaleFactor', 'type': 'int'}, + 'default_front_end_scale_factor': {'key': 'defaultFrontEndScaleFactor', 'type': 'int'}, + 'api_management_account_id': {'key': 'apiManagementAccountId', 'type': 'str'}, + 'suspended': {'key': 'suspended', 'type': 'bool'}, + 'dynamic_cache_enabled': {'key': 'dynamicCacheEnabled', 'type': 'bool'}, + 'cluster_settings': {'key': 'clusterSettings', 'type': '[NameValuePair]'}, + 'user_whitelisted_ip_ranges': {'key': 'userWhitelistedIpRanges', 'type': '[str]'}, + 'has_linux_workers': {'key': 'hasLinuxWorkers', 'type': 'bool'}, + 'ssl_cert_key_vault_id': {'key': 'sslCertKeyVaultId', 'type': 'str'}, + 'ssl_cert_key_vault_secret_name': {'key': 'sslCertKeyVaultSecretName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceEnvironment, self).__init__(**kwargs) + self.name = kwargs['name'] + self.location = kwargs['location'] + self.provisioning_state = None + self.status = None + self.vnet_name = kwargs.get('vnet_name', None) + self.vnet_resource_group_name = kwargs.get('vnet_resource_group_name', None) + self.vnet_subnet_name = kwargs.get('vnet_subnet_name', None) + self.virtual_network = kwargs['virtual_network'] + self.internal_load_balancing_mode = kwargs.get('internal_load_balancing_mode', None) + self.multi_size = kwargs.get('multi_size', None) + self.multi_role_count = kwargs.get('multi_role_count', None) + self.worker_pools = kwargs['worker_pools'] + self.ipssl_address_count = kwargs.get('ipssl_address_count', None) + self.database_edition = None + self.database_service_objective = None + self.upgrade_domains = None + self.subscription_id = None + self.dns_suffix = kwargs.get('dns_suffix', None) + self.last_action = None + self.last_action_result = None + self.allowed_multi_sizes = None + self.allowed_worker_sizes = None + self.maximum_number_of_machines = None + self.vip_mappings = None + self.environment_capacities = None + self.network_access_control_list = kwargs.get('network_access_control_list', None) + self.environment_is_healthy = None + self.environment_status = None + self.resource_group = None + self.front_end_scale_factor = kwargs.get('front_end_scale_factor', None) + self.default_front_end_scale_factor = None + self.api_management_account_id = kwargs.get('api_management_account_id', None) + self.suspended = kwargs.get('suspended', None) + self.dynamic_cache_enabled = kwargs.get('dynamic_cache_enabled', None) + self.cluster_settings = kwargs.get('cluster_settings', None) + self.user_whitelisted_ip_ranges = kwargs.get('user_whitelisted_ip_ranges', None) + self.has_linux_workers = kwargs.get('has_linux_workers', None) + self.ssl_cert_key_vault_id = kwargs.get('ssl_cert_key_vault_id', None) + self.ssl_cert_key_vault_secret_name = kwargs.get('ssl_cert_key_vault_secret_name', None) + + +class AppServiceEnvironmentCollection(msrest.serialization.Model): + """Collection of App Service Environments. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.AppServiceEnvironmentResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServiceEnvironmentResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceEnvironmentCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class AppServiceEnvironmentPatchResource(ProxyOnlyResource): + """ARM resource for a app service environment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param name_properties_name: Name of the App Service Environment. + :type name_properties_name: str + :param location: Location of the App Service Environment, e.g. "West US". + :type location: str + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.ProvisioningState + :ivar status: Current status of the App Service Environment. Possible values include: + "Preparing", "Ready", "Scaling", "Deleting". + :vartype status: str or ~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentStatus + :param vnet_name: Name of the Virtual Network for the App Service Environment. + :type vnet_name: str + :param vnet_resource_group_name: Resource group of the Virtual Network. + :type vnet_resource_group_name: str + :param vnet_subnet_name: Subnet of the Virtual Network. + :type vnet_subnet_name: str + :param virtual_network: Description of the Virtual Network. + :type virtual_network: ~azure.mgmt.web.v2020_06_01.models.VirtualNetworkProfile + :param internal_load_balancing_mode: Specifies which endpoints to serve internally in the + Virtual Network for the App Service Environment. Possible values include: "None", "Web", + "Publishing", "Web,Publishing". + :type internal_load_balancing_mode: str or ~azure.mgmt.web.v2020_06_01.models.LoadBalancingMode + :param multi_size: Front-end VM size, e.g. "Medium", "Large". + :type multi_size: str + :param multi_role_count: Number of front-end instances. + :type multi_role_count: int + :param worker_pools: Description of worker pools with worker size IDs, VM sizes, and number of + workers in each pool. + :type worker_pools: list[~azure.mgmt.web.v2020_06_01.models.WorkerPool] + :param ipssl_address_count: Number of IP SSL addresses reserved for the App Service + Environment. + :type ipssl_address_count: int + :ivar database_edition: Edition of the metadata database for the App Service Environment, e.g. + "Standard". + :vartype database_edition: str + :ivar database_service_objective: Service objective of the metadata database for the App + Service Environment, e.g. "S0". + :vartype database_service_objective: str + :ivar upgrade_domains: Number of upgrade domains of the App Service Environment. + :vartype upgrade_domains: int + :ivar subscription_id: Subscription of the App Service Environment. + :vartype subscription_id: str + :param dns_suffix: DNS suffix of the App Service Environment. + :type dns_suffix: str + :ivar last_action: Last deployment action on the App Service Environment. + :vartype last_action: str + :ivar last_action_result: Result of the last deployment action on the App Service Environment. + :vartype last_action_result: str + :ivar allowed_multi_sizes: List of comma separated strings describing which VM sizes are + allowed for front-ends. + :vartype allowed_multi_sizes: str + :ivar allowed_worker_sizes: List of comma separated strings describing which VM sizes are + allowed for workers. + :vartype allowed_worker_sizes: str + :ivar maximum_number_of_machines: Maximum number of VMs in the App Service Environment. + :vartype maximum_number_of_machines: int + :ivar vip_mappings: Description of IP SSL mapping for the App Service Environment. + :vartype vip_mappings: list[~azure.mgmt.web.v2020_06_01.models.VirtualIPMapping] + :ivar environment_capacities: Current total, used, and available worker capacities. + :vartype environment_capacities: list[~azure.mgmt.web.v2020_06_01.models.StampCapacity] + :param network_access_control_list: Access control list for controlling traffic to the App + Service Environment. + :type network_access_control_list: + list[~azure.mgmt.web.v2020_06_01.models.NetworkAccessControlEntry] + :ivar environment_is_healthy: True/false indicating whether the App Service Environment is + healthy. + :vartype environment_is_healthy: bool + :ivar environment_status: Detailed message about with results of the last check of the App + Service Environment. + :vartype environment_status: str + :ivar resource_group: Resource group of the App Service Environment. + :vartype resource_group: str + :param front_end_scale_factor: Scale factor for front-ends. + :type front_end_scale_factor: int + :ivar default_front_end_scale_factor: Default Scale Factor for FrontEnds. + :vartype default_front_end_scale_factor: int + :param api_management_account_id: API Management Account associated with the App Service + Environment. + :type api_management_account_id: str + :param suspended: :code:`true` if the App Service Environment is suspended; + otherwise, :code:`false`. The environment can be suspended, e.g. when the + management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :type suspended: bool + :param dynamic_cache_enabled: True/false indicating whether the App Service Environment is + suspended. The environment can be suspended e.g. when the management endpoint is no longer + available + (most likely because NSG blocked the incoming traffic). + :type dynamic_cache_enabled: bool + :param cluster_settings: Custom settings for changing the behavior of the App Service + Environment. + :type cluster_settings: list[~azure.mgmt.web.v2020_06_01.models.NameValuePair] + :param user_whitelisted_ip_ranges: User added ip ranges to whitelist on ASE db. + :type user_whitelisted_ip_ranges: list[str] + :param has_linux_workers: Flag that displays whether an ASE has linux workers or not. + :type has_linux_workers: bool + :param ssl_cert_key_vault_id: Key Vault ID for ILB App Service Environment default SSL + certificate. + :type ssl_cert_key_vault_id: str + :param ssl_cert_key_vault_secret_name: Key Vault Secret Name for ILB App Service Environment + default SSL certificate. + :type ssl_cert_key_vault_secret_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'database_edition': {'readonly': True}, + 'database_service_objective': {'readonly': True}, + 'upgrade_domains': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'last_action': {'readonly': True}, + 'last_action_result': {'readonly': True}, + 'allowed_multi_sizes': {'readonly': True}, + 'allowed_worker_sizes': {'readonly': True}, + 'maximum_number_of_machines': {'readonly': True}, + 'vip_mappings': {'readonly': True}, + 'environment_capacities': {'readonly': True}, + 'environment_is_healthy': {'readonly': True}, + 'environment_status': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'default_front_end_scale_factor': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_resource_group_name': {'key': 'properties.vnetResourceGroupName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'properties.vnetSubnetName', 'type': 'str'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'VirtualNetworkProfile'}, + 'internal_load_balancing_mode': {'key': 'properties.internalLoadBalancingMode', 'type': 'str'}, + 'multi_size': {'key': 'properties.multiSize', 'type': 'str'}, + 'multi_role_count': {'key': 'properties.multiRoleCount', 'type': 'int'}, + 'worker_pools': {'key': 'properties.workerPools', 'type': '[WorkerPool]'}, + 'ipssl_address_count': {'key': 'properties.ipsslAddressCount', 'type': 'int'}, + 'database_edition': {'key': 'properties.databaseEdition', 'type': 'str'}, + 'database_service_objective': {'key': 'properties.databaseServiceObjective', 'type': 'str'}, + 'upgrade_domains': {'key': 'properties.upgradeDomains', 'type': 'int'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'dns_suffix': {'key': 'properties.dnsSuffix', 'type': 'str'}, + 'last_action': {'key': 'properties.lastAction', 'type': 'str'}, + 'last_action_result': {'key': 'properties.lastActionResult', 'type': 'str'}, + 'allowed_multi_sizes': {'key': 'properties.allowedMultiSizes', 'type': 'str'}, + 'allowed_worker_sizes': {'key': 'properties.allowedWorkerSizes', 'type': 'str'}, + 'maximum_number_of_machines': {'key': 'properties.maximumNumberOfMachines', 'type': 'int'}, + 'vip_mappings': {'key': 'properties.vipMappings', 'type': '[VirtualIPMapping]'}, + 'environment_capacities': {'key': 'properties.environmentCapacities', 'type': '[StampCapacity]'}, + 'network_access_control_list': {'key': 'properties.networkAccessControlList', 'type': '[NetworkAccessControlEntry]'}, + 'environment_is_healthy': {'key': 'properties.environmentIsHealthy', 'type': 'bool'}, + 'environment_status': {'key': 'properties.environmentStatus', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'front_end_scale_factor': {'key': 'properties.frontEndScaleFactor', 'type': 'int'}, + 'default_front_end_scale_factor': {'key': 'properties.defaultFrontEndScaleFactor', 'type': 'int'}, + 'api_management_account_id': {'key': 'properties.apiManagementAccountId', 'type': 'str'}, + 'suspended': {'key': 'properties.suspended', 'type': 'bool'}, + 'dynamic_cache_enabled': {'key': 'properties.dynamicCacheEnabled', 'type': 'bool'}, + 'cluster_settings': {'key': 'properties.clusterSettings', 'type': '[NameValuePair]'}, + 'user_whitelisted_ip_ranges': {'key': 'properties.userWhitelistedIpRanges', 'type': '[str]'}, + 'has_linux_workers': {'key': 'properties.hasLinuxWorkers', 'type': 'bool'}, + 'ssl_cert_key_vault_id': {'key': 'properties.sslCertKeyVaultId', 'type': 'str'}, + 'ssl_cert_key_vault_secret_name': {'key': 'properties.sslCertKeyVaultSecretName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceEnvironmentPatchResource, self).__init__(**kwargs) + self.name_properties_name = kwargs.get('name_properties_name', None) + self.location = kwargs.get('location', None) + self.provisioning_state = None + self.status = None + self.vnet_name = kwargs.get('vnet_name', None) + self.vnet_resource_group_name = kwargs.get('vnet_resource_group_name', None) + self.vnet_subnet_name = kwargs.get('vnet_subnet_name', None) + self.virtual_network = kwargs.get('virtual_network', None) + self.internal_load_balancing_mode = kwargs.get('internal_load_balancing_mode', None) + self.multi_size = kwargs.get('multi_size', None) + self.multi_role_count = kwargs.get('multi_role_count', None) + self.worker_pools = kwargs.get('worker_pools', None) + self.ipssl_address_count = kwargs.get('ipssl_address_count', None) + self.database_edition = None + self.database_service_objective = None + self.upgrade_domains = None + self.subscription_id = None + self.dns_suffix = kwargs.get('dns_suffix', None) + self.last_action = None + self.last_action_result = None + self.allowed_multi_sizes = None + self.allowed_worker_sizes = None + self.maximum_number_of_machines = None + self.vip_mappings = None + self.environment_capacities = None + self.network_access_control_list = kwargs.get('network_access_control_list', None) + self.environment_is_healthy = None + self.environment_status = None + self.resource_group = None + self.front_end_scale_factor = kwargs.get('front_end_scale_factor', None) + self.default_front_end_scale_factor = None + self.api_management_account_id = kwargs.get('api_management_account_id', None) + self.suspended = kwargs.get('suspended', None) + self.dynamic_cache_enabled = kwargs.get('dynamic_cache_enabled', None) + self.cluster_settings = kwargs.get('cluster_settings', None) + self.user_whitelisted_ip_ranges = kwargs.get('user_whitelisted_ip_ranges', None) + self.has_linux_workers = kwargs.get('has_linux_workers', None) + self.ssl_cert_key_vault_id = kwargs.get('ssl_cert_key_vault_id', None) + self.ssl_cert_key_vault_secret_name = kwargs.get('ssl_cert_key_vault_secret_name', None) + + +class AppServiceEnvironmentResource(Resource): + """App Service Environment ARM 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param name_properties_name: Name of the App Service Environment. + :type name_properties_name: str + :param location_properties_location: Location of the App Service Environment, e.g. "West US". + :type location_properties_location: str + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.ProvisioningState + :ivar status: Current status of the App Service Environment. Possible values include: + "Preparing", "Ready", "Scaling", "Deleting". + :vartype status: str or ~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentStatus + :param vnet_name: Name of the Virtual Network for the App Service Environment. + :type vnet_name: str + :param vnet_resource_group_name: Resource group of the Virtual Network. + :type vnet_resource_group_name: str + :param vnet_subnet_name: Subnet of the Virtual Network. + :type vnet_subnet_name: str + :param virtual_network: Description of the Virtual Network. + :type virtual_network: ~azure.mgmt.web.v2020_06_01.models.VirtualNetworkProfile + :param internal_load_balancing_mode: Specifies which endpoints to serve internally in the + Virtual Network for the App Service Environment. Possible values include: "None", "Web", + "Publishing", "Web,Publishing". + :type internal_load_balancing_mode: str or ~azure.mgmt.web.v2020_06_01.models.LoadBalancingMode + :param multi_size: Front-end VM size, e.g. "Medium", "Large". + :type multi_size: str + :param multi_role_count: Number of front-end instances. + :type multi_role_count: int + :param worker_pools: Description of worker pools with worker size IDs, VM sizes, and number of + workers in each pool. + :type worker_pools: list[~azure.mgmt.web.v2020_06_01.models.WorkerPool] + :param ipssl_address_count: Number of IP SSL addresses reserved for the App Service + Environment. + :type ipssl_address_count: int + :ivar database_edition: Edition of the metadata database for the App Service Environment, e.g. + "Standard". + :vartype database_edition: str + :ivar database_service_objective: Service objective of the metadata database for the App + Service Environment, e.g. "S0". + :vartype database_service_objective: str + :ivar upgrade_domains: Number of upgrade domains of the App Service Environment. + :vartype upgrade_domains: int + :ivar subscription_id: Subscription of the App Service Environment. + :vartype subscription_id: str + :param dns_suffix: DNS suffix of the App Service Environment. + :type dns_suffix: str + :ivar last_action: Last deployment action on the App Service Environment. + :vartype last_action: str + :ivar last_action_result: Result of the last deployment action on the App Service Environment. + :vartype last_action_result: str + :ivar allowed_multi_sizes: List of comma separated strings describing which VM sizes are + allowed for front-ends. + :vartype allowed_multi_sizes: str + :ivar allowed_worker_sizes: List of comma separated strings describing which VM sizes are + allowed for workers. + :vartype allowed_worker_sizes: str + :ivar maximum_number_of_machines: Maximum number of VMs in the App Service Environment. + :vartype maximum_number_of_machines: int + :ivar vip_mappings: Description of IP SSL mapping for the App Service Environment. + :vartype vip_mappings: list[~azure.mgmt.web.v2020_06_01.models.VirtualIPMapping] + :ivar environment_capacities: Current total, used, and available worker capacities. + :vartype environment_capacities: list[~azure.mgmt.web.v2020_06_01.models.StampCapacity] + :param network_access_control_list: Access control list for controlling traffic to the App + Service Environment. + :type network_access_control_list: + list[~azure.mgmt.web.v2020_06_01.models.NetworkAccessControlEntry] + :ivar environment_is_healthy: True/false indicating whether the App Service Environment is + healthy. + :vartype environment_is_healthy: bool + :ivar environment_status: Detailed message about with results of the last check of the App + Service Environment. + :vartype environment_status: str + :ivar resource_group: Resource group of the App Service Environment. + :vartype resource_group: str + :param front_end_scale_factor: Scale factor for front-ends. + :type front_end_scale_factor: int + :ivar default_front_end_scale_factor: Default Scale Factor for FrontEnds. + :vartype default_front_end_scale_factor: int + :param api_management_account_id: API Management Account associated with the App Service + Environment. + :type api_management_account_id: str + :param suspended: :code:`true` if the App Service Environment is suspended; + otherwise, :code:`false`. The environment can be suspended, e.g. when the + management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :type suspended: bool + :param dynamic_cache_enabled: True/false indicating whether the App Service Environment is + suspended. The environment can be suspended e.g. when the management endpoint is no longer + available + (most likely because NSG blocked the incoming traffic). + :type dynamic_cache_enabled: bool + :param cluster_settings: Custom settings for changing the behavior of the App Service + Environment. + :type cluster_settings: list[~azure.mgmt.web.v2020_06_01.models.NameValuePair] + :param user_whitelisted_ip_ranges: User added ip ranges to whitelist on ASE db. + :type user_whitelisted_ip_ranges: list[str] + :param has_linux_workers: Flag that displays whether an ASE has linux workers or not. + :type has_linux_workers: bool + :param ssl_cert_key_vault_id: Key Vault ID for ILB App Service Environment default SSL + certificate. + :type ssl_cert_key_vault_id: str + :param ssl_cert_key_vault_secret_name: Key Vault Secret Name for ILB App Service Environment + default SSL certificate. + :type ssl_cert_key_vault_secret_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'database_edition': {'readonly': True}, + 'database_service_objective': {'readonly': True}, + 'upgrade_domains': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'last_action': {'readonly': True}, + 'last_action_result': {'readonly': True}, + 'allowed_multi_sizes': {'readonly': True}, + 'allowed_worker_sizes': {'readonly': True}, + 'maximum_number_of_machines': {'readonly': True}, + 'vip_mappings': {'readonly': True}, + 'environment_capacities': {'readonly': True}, + 'environment_is_healthy': {'readonly': True}, + 'environment_status': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'default_front_end_scale_factor': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'location_properties_location': {'key': 'properties.location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_resource_group_name': {'key': 'properties.vnetResourceGroupName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'properties.vnetSubnetName', 'type': 'str'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'VirtualNetworkProfile'}, + 'internal_load_balancing_mode': {'key': 'properties.internalLoadBalancingMode', 'type': 'str'}, + 'multi_size': {'key': 'properties.multiSize', 'type': 'str'}, + 'multi_role_count': {'key': 'properties.multiRoleCount', 'type': 'int'}, + 'worker_pools': {'key': 'properties.workerPools', 'type': '[WorkerPool]'}, + 'ipssl_address_count': {'key': 'properties.ipsslAddressCount', 'type': 'int'}, + 'database_edition': {'key': 'properties.databaseEdition', 'type': 'str'}, + 'database_service_objective': {'key': 'properties.databaseServiceObjective', 'type': 'str'}, + 'upgrade_domains': {'key': 'properties.upgradeDomains', 'type': 'int'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'dns_suffix': {'key': 'properties.dnsSuffix', 'type': 'str'}, + 'last_action': {'key': 'properties.lastAction', 'type': 'str'}, + 'last_action_result': {'key': 'properties.lastActionResult', 'type': 'str'}, + 'allowed_multi_sizes': {'key': 'properties.allowedMultiSizes', 'type': 'str'}, + 'allowed_worker_sizes': {'key': 'properties.allowedWorkerSizes', 'type': 'str'}, + 'maximum_number_of_machines': {'key': 'properties.maximumNumberOfMachines', 'type': 'int'}, + 'vip_mappings': {'key': 'properties.vipMappings', 'type': '[VirtualIPMapping]'}, + 'environment_capacities': {'key': 'properties.environmentCapacities', 'type': '[StampCapacity]'}, + 'network_access_control_list': {'key': 'properties.networkAccessControlList', 'type': '[NetworkAccessControlEntry]'}, + 'environment_is_healthy': {'key': 'properties.environmentIsHealthy', 'type': 'bool'}, + 'environment_status': {'key': 'properties.environmentStatus', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'front_end_scale_factor': {'key': 'properties.frontEndScaleFactor', 'type': 'int'}, + 'default_front_end_scale_factor': {'key': 'properties.defaultFrontEndScaleFactor', 'type': 'int'}, + 'api_management_account_id': {'key': 'properties.apiManagementAccountId', 'type': 'str'}, + 'suspended': {'key': 'properties.suspended', 'type': 'bool'}, + 'dynamic_cache_enabled': {'key': 'properties.dynamicCacheEnabled', 'type': 'bool'}, + 'cluster_settings': {'key': 'properties.clusterSettings', 'type': '[NameValuePair]'}, + 'user_whitelisted_ip_ranges': {'key': 'properties.userWhitelistedIpRanges', 'type': '[str]'}, + 'has_linux_workers': {'key': 'properties.hasLinuxWorkers', 'type': 'bool'}, + 'ssl_cert_key_vault_id': {'key': 'properties.sslCertKeyVaultId', 'type': 'str'}, + 'ssl_cert_key_vault_secret_name': {'key': 'properties.sslCertKeyVaultSecretName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceEnvironmentResource, self).__init__(**kwargs) + self.name_properties_name = kwargs.get('name_properties_name', None) + self.location_properties_location = kwargs.get('location_properties_location', None) + self.provisioning_state = None + self.status = None + self.vnet_name = kwargs.get('vnet_name', None) + self.vnet_resource_group_name = kwargs.get('vnet_resource_group_name', None) + self.vnet_subnet_name = kwargs.get('vnet_subnet_name', None) + self.virtual_network = kwargs.get('virtual_network', None) + self.internal_load_balancing_mode = kwargs.get('internal_load_balancing_mode', None) + self.multi_size = kwargs.get('multi_size', None) + self.multi_role_count = kwargs.get('multi_role_count', None) + self.worker_pools = kwargs.get('worker_pools', None) + self.ipssl_address_count = kwargs.get('ipssl_address_count', None) + self.database_edition = None + self.database_service_objective = None + self.upgrade_domains = None + self.subscription_id = None + self.dns_suffix = kwargs.get('dns_suffix', None) + self.last_action = None + self.last_action_result = None + self.allowed_multi_sizes = None + self.allowed_worker_sizes = None + self.maximum_number_of_machines = None + self.vip_mappings = None + self.environment_capacities = None + self.network_access_control_list = kwargs.get('network_access_control_list', None) + self.environment_is_healthy = None + self.environment_status = None + self.resource_group = None + self.front_end_scale_factor = kwargs.get('front_end_scale_factor', None) + self.default_front_end_scale_factor = None + self.api_management_account_id = kwargs.get('api_management_account_id', None) + self.suspended = kwargs.get('suspended', None) + self.dynamic_cache_enabled = kwargs.get('dynamic_cache_enabled', None) + self.cluster_settings = kwargs.get('cluster_settings', None) + self.user_whitelisted_ip_ranges = kwargs.get('user_whitelisted_ip_ranges', None) + self.has_linux_workers = kwargs.get('has_linux_workers', None) + self.ssl_cert_key_vault_id = kwargs.get('ssl_cert_key_vault_id', None) + self.ssl_cert_key_vault_secret_name = kwargs.get('ssl_cert_key_vault_secret_name', None) + + +class AppServicePlan(Resource): + """App Service plan. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: Description of a SKU for a scalable resource. + :type sku: ~azure.mgmt.web.v2020_06_01.models.SkuDescription + :param worker_tier_name: Target worker tier assigned to the App Service plan. + :type worker_tier_name: str + :ivar status: App Service plan status. Possible values include: "Ready", "Pending", "Creating". + :vartype status: str or ~azure.mgmt.web.v2020_06_01.models.StatusOptions + :ivar subscription: App Service plan subscription. + :vartype subscription: str + :param hosting_environment_profile: Specification for the App Service Environment to use for + the App Service plan. + :type hosting_environment_profile: ~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentProfile + :ivar maximum_number_of_workers: Maximum number of instances that can be assigned to this App + Service plan. + :vartype maximum_number_of_workers: int + :ivar geo_region: Geographical location for the App Service plan. + :vartype geo_region: str + :param per_site_scaling: If :code:`true`, apps assigned to this App Service plan + can be scaled independently. + If :code:`false`, apps assigned to this App Service plan will scale to all + instances of the plan. + :type per_site_scaling: bool + :param maximum_elastic_worker_count: Maximum number of total workers allowed for this + ElasticScaleEnabled App Service Plan. + :type maximum_elastic_worker_count: int + :ivar number_of_sites: Number of apps assigned to this App Service plan. + :vartype number_of_sites: int + :param is_spot: If :code:`true`, this App Service Plan owns spot instances. + :type is_spot: bool + :param spot_expiration_time: The time when the server farm expires. Valid only if it is a spot + server farm. + :type spot_expiration_time: ~datetime.datetime + :param free_offer_expiration_time: The time when the server farm free offer expires. + :type free_offer_expiration_time: ~datetime.datetime + :ivar resource_group: Resource group of the App Service plan. + :vartype resource_group: str + :param reserved: If Linux app service plan :code:`true`, + :code:`false` otherwise. + :type reserved: bool + :param is_xenon: Obsolete: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type is_xenon: bool + :param hyper_v: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type hyper_v: bool + :param target_worker_count: Scaling worker count. + :type target_worker_count: int + :param target_worker_size_id: Scaling worker size ID. + :type target_worker_size_id: int + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'subscription': {'readonly': True}, + 'maximum_number_of_workers': {'readonly': True}, + 'geo_region': {'readonly': True}, + 'number_of_sites': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'worker_tier_name': {'key': 'properties.workerTierName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'maximum_number_of_workers': {'key': 'properties.maximumNumberOfWorkers', 'type': 'int'}, + 'geo_region': {'key': 'properties.geoRegion', 'type': 'str'}, + 'per_site_scaling': {'key': 'properties.perSiteScaling', 'type': 'bool'}, + 'maximum_elastic_worker_count': {'key': 'properties.maximumElasticWorkerCount', 'type': 'int'}, + 'number_of_sites': {'key': 'properties.numberOfSites', 'type': 'int'}, + 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, + 'spot_expiration_time': {'key': 'properties.spotExpirationTime', 'type': 'iso-8601'}, + 'free_offer_expiration_time': {'key': 'properties.freeOfferExpirationTime', 'type': 'iso-8601'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'target_worker_count': {'key': 'properties.targetWorkerCount', 'type': 'int'}, + 'target_worker_size_id': {'key': 'properties.targetWorkerSizeId', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServicePlan, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.worker_tier_name = kwargs.get('worker_tier_name', None) + self.status = None + self.subscription = None + self.hosting_environment_profile = kwargs.get('hosting_environment_profile', None) + self.maximum_number_of_workers = None + self.geo_region = None + self.per_site_scaling = kwargs.get('per_site_scaling', False) + self.maximum_elastic_worker_count = kwargs.get('maximum_elastic_worker_count', None) + self.number_of_sites = None + self.is_spot = kwargs.get('is_spot', None) + self.spot_expiration_time = kwargs.get('spot_expiration_time', None) + self.free_offer_expiration_time = kwargs.get('free_offer_expiration_time', None) + self.resource_group = None + self.reserved = kwargs.get('reserved', False) + self.is_xenon = kwargs.get('is_xenon', False) + self.hyper_v = kwargs.get('hyper_v', False) + self.target_worker_count = kwargs.get('target_worker_count', None) + self.target_worker_size_id = kwargs.get('target_worker_size_id', None) + self.provisioning_state = None + + +class AppServicePlanCollection(msrest.serialization.Model): + """Collection of App Service plans. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.AppServicePlan] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServicePlan]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServicePlanCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class AppServicePlanPatchResource(ProxyOnlyResource): + """ARM resource for a app service plan. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param worker_tier_name: Target worker tier assigned to the App Service plan. + :type worker_tier_name: str + :ivar status: App Service plan status. Possible values include: "Ready", "Pending", "Creating". + :vartype status: str or ~azure.mgmt.web.v2020_06_01.models.StatusOptions + :ivar subscription: App Service plan subscription. + :vartype subscription: str + :param hosting_environment_profile: Specification for the App Service Environment to use for + the App Service plan. + :type hosting_environment_profile: ~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentProfile + :ivar maximum_number_of_workers: Maximum number of instances that can be assigned to this App + Service plan. + :vartype maximum_number_of_workers: int + :ivar geo_region: Geographical location for the App Service plan. + :vartype geo_region: str + :param per_site_scaling: If :code:`true`, apps assigned to this App Service plan + can be scaled independently. + If :code:`false`, apps assigned to this App Service plan will scale to all + instances of the plan. + :type per_site_scaling: bool + :param maximum_elastic_worker_count: Maximum number of total workers allowed for this + ElasticScaleEnabled App Service Plan. + :type maximum_elastic_worker_count: int + :ivar number_of_sites: Number of apps assigned to this App Service plan. + :vartype number_of_sites: int + :param is_spot: If :code:`true`, this App Service Plan owns spot instances. + :type is_spot: bool + :param spot_expiration_time: The time when the server farm expires. Valid only if it is a spot + server farm. + :type spot_expiration_time: ~datetime.datetime + :param free_offer_expiration_time: The time when the server farm free offer expires. + :type free_offer_expiration_time: ~datetime.datetime + :ivar resource_group: Resource group of the App Service plan. + :vartype resource_group: str + :param reserved: This needs to set to :code:`true` when creating a Linux App + Service Plan, along with :code:`kind` set to :code:`Linux`. It should + be :code:`false` otherwise. + :type reserved: bool + :param is_xenon: Obsolete: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type is_xenon: bool + :param hyper_v: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type hyper_v: bool + :param target_worker_count: Scaling worker count. + :type target_worker_count: int + :param target_worker_size_id: Scaling worker size ID. + :type target_worker_size_id: int + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'subscription': {'readonly': True}, + 'maximum_number_of_workers': {'readonly': True}, + 'geo_region': {'readonly': True}, + 'number_of_sites': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'worker_tier_name': {'key': 'properties.workerTierName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'maximum_number_of_workers': {'key': 'properties.maximumNumberOfWorkers', 'type': 'int'}, + 'geo_region': {'key': 'properties.geoRegion', 'type': 'str'}, + 'per_site_scaling': {'key': 'properties.perSiteScaling', 'type': 'bool'}, + 'maximum_elastic_worker_count': {'key': 'properties.maximumElasticWorkerCount', 'type': 'int'}, + 'number_of_sites': {'key': 'properties.numberOfSites', 'type': 'int'}, + 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, + 'spot_expiration_time': {'key': 'properties.spotExpirationTime', 'type': 'iso-8601'}, + 'free_offer_expiration_time': {'key': 'properties.freeOfferExpirationTime', 'type': 'iso-8601'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'target_worker_count': {'key': 'properties.targetWorkerCount', 'type': 'int'}, + 'target_worker_size_id': {'key': 'properties.targetWorkerSizeId', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServicePlanPatchResource, self).__init__(**kwargs) + self.worker_tier_name = kwargs.get('worker_tier_name', None) + self.status = None + self.subscription = None + self.hosting_environment_profile = kwargs.get('hosting_environment_profile', None) + self.maximum_number_of_workers = None + self.geo_region = None + self.per_site_scaling = kwargs.get('per_site_scaling', False) + self.maximum_elastic_worker_count = kwargs.get('maximum_elastic_worker_count', None) + self.number_of_sites = None + self.is_spot = kwargs.get('is_spot', None) + self.spot_expiration_time = kwargs.get('spot_expiration_time', None) + self.free_offer_expiration_time = kwargs.get('free_offer_expiration_time', None) + self.resource_group = None + self.reserved = kwargs.get('reserved', False) + self.is_xenon = kwargs.get('is_xenon', False) + self.hyper_v = kwargs.get('hyper_v', False) + self.target_worker_count = kwargs.get('target_worker_count', None) + self.target_worker_size_id = kwargs.get('target_worker_size_id', None) + self.provisioning_state = None + + +class ArmIdWrapper(msrest.serialization.Model): + """A wrapper for an ARM resource id. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ArmIdWrapper, self).__init__(**kwargs) + self.id = None + + +class AuthPlatform(ProxyOnlyResource): + """AuthPlatform. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: + :type enabled: bool + :param runtime_version: + :type runtime_version: str + :param config_file_path: + :type config_file_path: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'runtime_version': {'key': 'properties.runtimeVersion', 'type': 'str'}, + 'config_file_path': {'key': 'properties.configFilePath', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AuthPlatform, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.runtime_version = kwargs.get('runtime_version', None) + self.config_file_path = kwargs.get('config_file_path', None) + + +class AutoHealActions(msrest.serialization.Model): + """Actions which to take by the auto-heal module when a rule is triggered. + + :param action_type: Predefined action to be taken. Possible values include: "Recycle", + "LogEvent", "CustomAction". + :type action_type: str or ~azure.mgmt.web.v2020_06_01.models.AutoHealActionType + :param custom_action: Custom action to be taken. + :type custom_action: ~azure.mgmt.web.v2020_06_01.models.AutoHealCustomAction + :param min_process_execution_time: Minimum time the process must execute + before taking the action. + :type min_process_execution_time: str + """ + + _attribute_map = { + 'action_type': {'key': 'actionType', 'type': 'str'}, + 'custom_action': {'key': 'customAction', 'type': 'AutoHealCustomAction'}, + 'min_process_execution_time': {'key': 'minProcessExecutionTime', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AutoHealActions, self).__init__(**kwargs) + self.action_type = kwargs.get('action_type', None) + self.custom_action = kwargs.get('custom_action', None) + self.min_process_execution_time = kwargs.get('min_process_execution_time', None) + + +class AutoHealCustomAction(msrest.serialization.Model): + """Custom action to be executed +when an auto heal rule is triggered. + + :param exe: Executable to be run. + :type exe: str + :param parameters: Parameters for the executable. + :type parameters: str + """ + + _attribute_map = { + 'exe': {'key': 'exe', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AutoHealCustomAction, self).__init__(**kwargs) + self.exe = kwargs.get('exe', None) + self.parameters = kwargs.get('parameters', None) + + +class AutoHealRules(msrest.serialization.Model): + """Rules that can be defined for auto-heal. + + :param triggers: Conditions that describe when to execute the auto-heal actions. + :type triggers: ~azure.mgmt.web.v2020_06_01.models.AutoHealTriggers + :param actions: Actions to be executed when a rule is triggered. + :type actions: ~azure.mgmt.web.v2020_06_01.models.AutoHealActions + """ + + _attribute_map = { + 'triggers': {'key': 'triggers', 'type': 'AutoHealTriggers'}, + 'actions': {'key': 'actions', 'type': 'AutoHealActions'}, + } + + def __init__( + self, + **kwargs + ): + super(AutoHealRules, self).__init__(**kwargs) + self.triggers = kwargs.get('triggers', None) + self.actions = kwargs.get('actions', None) + + +class AutoHealTriggers(msrest.serialization.Model): + """Triggers for auto-heal. + + :param requests: A rule based on total requests. + :type requests: ~azure.mgmt.web.v2020_06_01.models.RequestsBasedTrigger + :param private_bytes_in_kb: A rule based on private bytes. + :type private_bytes_in_kb: int + :param status_codes: A rule based on status codes. + :type status_codes: list[~azure.mgmt.web.v2020_06_01.models.StatusCodesBasedTrigger] + :param slow_requests: A rule based on request execution time. + :type slow_requests: ~azure.mgmt.web.v2020_06_01.models.SlowRequestsBasedTrigger + """ + + _attribute_map = { + 'requests': {'key': 'requests', 'type': 'RequestsBasedTrigger'}, + 'private_bytes_in_kb': {'key': 'privateBytesInKB', 'type': 'int'}, + 'status_codes': {'key': 'statusCodes', 'type': '[StatusCodesBasedTrigger]'}, + 'slow_requests': {'key': 'slowRequests', 'type': 'SlowRequestsBasedTrigger'}, + } + + def __init__( + self, + **kwargs + ): + super(AutoHealTriggers, self).__init__(**kwargs) + self.requests = kwargs.get('requests', None) + self.private_bytes_in_kb = kwargs.get('private_bytes_in_kb', None) + self.status_codes = kwargs.get('status_codes', None) + self.slow_requests = kwargs.get('slow_requests', None) + + +class AzureActiveDirectory(ProxyOnlyResource): + """AzureActiveDirectory. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_06_01.models.AzureActiveDirectoryRegistration + :param login: + :type login: ~azure.mgmt.web.v2020_06_01.models.AzureActiveDirectoryLogin + :param validation: + :type validation: ~azure.mgmt.web.v2020_06_01.models.AzureActiveDirectoryValidation + :param is_auto_provisioned: + :type is_auto_provisioned: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'AzureActiveDirectoryRegistration'}, + 'login': {'key': 'properties.login', 'type': 'AzureActiveDirectoryLogin'}, + 'validation': {'key': 'properties.validation', 'type': 'AzureActiveDirectoryValidation'}, + 'is_auto_provisioned': {'key': 'properties.isAutoProvisioned', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureActiveDirectory, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.registration = kwargs.get('registration', None) + self.login = kwargs.get('login', None) + self.validation = kwargs.get('validation', None) + self.is_auto_provisioned = kwargs.get('is_auto_provisioned', None) + + +class AzureActiveDirectoryLogin(ProxyOnlyResource): + """AzureActiveDirectoryLogin. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param disable_www_authenticate: + :type disable_www_authenticate: bool + :param login_parameters: + :type login_parameters: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'disable_www_authenticate': {'key': 'properties.disableWWWAuthenticate', 'type': 'bool'}, + 'login_parameters': {'key': 'properties.loginParameters', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureActiveDirectoryLogin, self).__init__(**kwargs) + self.disable_www_authenticate = kwargs.get('disable_www_authenticate', None) + self.login_parameters = kwargs.get('login_parameters', None) + + +class AzureActiveDirectoryRegistration(ProxyOnlyResource): + """AzureActiveDirectoryRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param open_id_issuer: + :type open_id_issuer: str + :param client_id: + :type client_id: str + :param client_secret_setting_name: + :type client_secret_setting_name: str + :param client_secret_certificate_thumbprint: + :type client_secret_certificate_thumbprint: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'open_id_issuer': {'key': 'properties.openIdIssuer', 'type': 'str'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_secret_certificate_thumbprint': {'key': 'properties.clientSecretCertificateThumbprint', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureActiveDirectoryRegistration, self).__init__(**kwargs) + self.open_id_issuer = kwargs.get('open_id_issuer', None) + self.client_id = kwargs.get('client_id', None) + self.client_secret_setting_name = kwargs.get('client_secret_setting_name', None) + self.client_secret_certificate_thumbprint = kwargs.get('client_secret_certificate_thumbprint', None) + + +class AzureActiveDirectoryValidation(ProxyOnlyResource): + """AzureActiveDirectoryValidation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param jwt_claim_checks: + :type jwt_claim_checks: ~azure.mgmt.web.v2020_06_01.models.JwtClaimChecks + :param allowed_audiences: + :type allowed_audiences: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'jwt_claim_checks': {'key': 'properties.jwtClaimChecks', 'type': 'JwtClaimChecks'}, + 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureActiveDirectoryValidation, self).__init__(**kwargs) + self.jwt_claim_checks = kwargs.get('jwt_claim_checks', None) + self.allowed_audiences = kwargs.get('allowed_audiences', None) + + +class AzureBlobStorageApplicationLogsConfig(msrest.serialization.Model): + """Application logs azure blob storage configuration. + + :param level: Log level. Possible values include: "Off", "Verbose", "Information", "Warning", + "Error". + :type level: str or ~azure.mgmt.web.v2020_06_01.models.LogLevel + :param sas_url: SAS url to a azure blob container with read/write/list/delete permissions. + :type sas_url: str + :param retention_in_days: Retention in days. + Remove blobs older than X days. + 0 or lower means no retention. + :type retention_in_days: int + """ + + _attribute_map = { + 'level': {'key': 'level', 'type': 'str'}, + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureBlobStorageApplicationLogsConfig, self).__init__(**kwargs) + self.level = kwargs.get('level', None) + self.sas_url = kwargs.get('sas_url', None) + self.retention_in_days = kwargs.get('retention_in_days', None) + + +class AzureBlobStorageHttpLogsConfig(msrest.serialization.Model): + """Http logs to azure blob storage configuration. + + :param sas_url: SAS url to a azure blob container with read/write/list/delete permissions. + :type sas_url: str + :param retention_in_days: Retention in days. + Remove blobs older than X days. + 0 or lower means no retention. + :type retention_in_days: int + :param enabled: True if configuration is enabled, false if it is disabled and null if + configuration is not set. + :type enabled: bool + """ + + _attribute_map = { + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureBlobStorageHttpLogsConfig, self).__init__(**kwargs) + self.sas_url = kwargs.get('sas_url', None) + self.retention_in_days = kwargs.get('retention_in_days', None) + self.enabled = kwargs.get('enabled', None) + + +class AzureStorageInfoValue(msrest.serialization.Model): + """Azure Files or Blob Storage access information value for dictionary storage. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Type of storage. Possible values include: "AzureFiles", "AzureBlob". + :type type: str or ~azure.mgmt.web.v2020_06_01.models.AzureStorageType + :param account_name: Name of the storage account. + :type account_name: str + :param share_name: Name of the file share (container name, for Blob storage). + :type share_name: str + :param access_key: Access key for the storage account. + :type access_key: str + :param mount_path: Path to mount the storage within the site's runtime environment. + :type mount_path: str + :ivar state: State of the storage account. Possible values include: "Ok", "InvalidCredentials", + "InvalidShare". + :vartype state: str or ~azure.mgmt.web.v2020_06_01.models.AzureStorageState + """ + + _validation = { + 'state': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'account_name': {'key': 'accountName', 'type': 'str'}, + 'share_name': {'key': 'shareName', 'type': 'str'}, + 'access_key': {'key': 'accessKey', 'type': 'str'}, + 'mount_path': {'key': 'mountPath', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureStorageInfoValue, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.account_name = kwargs.get('account_name', None) + self.share_name = kwargs.get('share_name', None) + self.access_key = kwargs.get('access_key', None) + self.mount_path = kwargs.get('mount_path', None) + self.state = None + + +class AzureStoragePropertyDictionaryResource(ProxyOnlyResource): + """AzureStorageInfo dictionary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param properties: Azure storage accounts. + :type properties: dict[str, ~azure.mgmt.web.v2020_06_01.models.AzureStorageInfoValue] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{AzureStorageInfoValue}'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureStoragePropertyDictionaryResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class AzureTableStorageApplicationLogsConfig(msrest.serialization.Model): + """Application logs to Azure table storage configuration. + + All required parameters must be populated in order to send to Azure. + + :param level: Log level. Possible values include: "Off", "Verbose", "Information", "Warning", + "Error". + :type level: str or ~azure.mgmt.web.v2020_06_01.models.LogLevel + :param sas_url: Required. SAS URL to an Azure table with add/query/delete permissions. + :type sas_url: str + """ + + _validation = { + 'sas_url': {'required': True}, + } + + _attribute_map = { + 'level': {'key': 'level', 'type': 'str'}, + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureTableStorageApplicationLogsConfig, self).__init__(**kwargs) + self.level = kwargs.get('level', None) + self.sas_url = kwargs['sas_url'] + + +class BackupItem(ProxyOnlyResource): + """Backup description. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar backup_id: Id of the backup. + :vartype backup_id: int + :ivar storage_account_url: SAS URL for the storage account container which contains this + backup. + :vartype storage_account_url: str + :ivar blob_name: Name of the blob which contains data for this backup. + :vartype blob_name: str + :ivar name_properties_name: Name of this backup. + :vartype name_properties_name: str + :ivar status: Backup status. Possible values include: "InProgress", "Failed", "Succeeded", + "TimedOut", "Created", "Skipped", "PartiallySucceeded", "DeleteInProgress", "DeleteFailed", + "Deleted". + :vartype status: str or ~azure.mgmt.web.v2020_06_01.models.BackupItemStatus + :ivar size_in_bytes: Size of the backup in bytes. + :vartype size_in_bytes: long + :ivar created: Timestamp of the backup creation. + :vartype created: ~datetime.datetime + :ivar log: Details regarding this backup. Might contain an error message. + :vartype log: str + :ivar databases: List of databases included in the backup. + :vartype databases: list[~azure.mgmt.web.v2020_06_01.models.DatabaseBackupSetting] + :ivar scheduled: True if this backup has been created due to a schedule being triggered. + :vartype scheduled: bool + :ivar last_restore_time_stamp: Timestamp of a last restore operation which used this backup. + :vartype last_restore_time_stamp: ~datetime.datetime + :ivar finished_time_stamp: Timestamp when this backup finished. + :vartype finished_time_stamp: ~datetime.datetime + :ivar correlation_id: Unique correlation identifier. Please use this along with the timestamp + while communicating with Azure support. + :vartype correlation_id: str + :ivar website_size_in_bytes: Size of the original web app which has been backed up. + :vartype website_size_in_bytes: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'backup_id': {'readonly': True}, + 'storage_account_url': {'readonly': True}, + 'blob_name': {'readonly': True}, + 'name_properties_name': {'readonly': True}, + 'status': {'readonly': True}, + 'size_in_bytes': {'readonly': True}, + 'created': {'readonly': True}, + 'log': {'readonly': True}, + 'databases': {'readonly': True}, + 'scheduled': {'readonly': True}, + 'last_restore_time_stamp': {'readonly': True}, + 'finished_time_stamp': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'website_size_in_bytes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'backup_id': {'key': 'properties.id', 'type': 'int'}, + 'storage_account_url': {'key': 'properties.storageAccountUrl', 'type': 'str'}, + 'blob_name': {'key': 'properties.blobName', 'type': 'str'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'size_in_bytes': {'key': 'properties.sizeInBytes', 'type': 'long'}, + 'created': {'key': 'properties.created', 'type': 'iso-8601'}, + 'log': {'key': 'properties.log', 'type': 'str'}, + 'databases': {'key': 'properties.databases', 'type': '[DatabaseBackupSetting]'}, + 'scheduled': {'key': 'properties.scheduled', 'type': 'bool'}, + 'last_restore_time_stamp': {'key': 'properties.lastRestoreTimeStamp', 'type': 'iso-8601'}, + 'finished_time_stamp': {'key': 'properties.finishedTimeStamp', 'type': 'iso-8601'}, + 'correlation_id': {'key': 'properties.correlationId', 'type': 'str'}, + 'website_size_in_bytes': {'key': 'properties.websiteSizeInBytes', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupItem, self).__init__(**kwargs) + self.backup_id = None + self.storage_account_url = None + self.blob_name = None + self.name_properties_name = None + self.status = None + self.size_in_bytes = None + self.created = None + self.log = None + self.databases = None + self.scheduled = None + self.last_restore_time_stamp = None + self.finished_time_stamp = None + self.correlation_id = None + self.website_size_in_bytes = None + + +class BackupItemCollection(msrest.serialization.Model): + """Collection of backup items. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.BackupItem] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BackupItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupItemCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class BackupRequest(ProxyOnlyResource): + """Description of a backup which will be performed. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param backup_name: Name of the backup. + :type backup_name: str + :param enabled: True if the backup schedule is enabled (must be included in that case), false + if the backup schedule should be disabled. + :type enabled: bool + :param storage_account_url: SAS URL to the container. + :type storage_account_url: str + :param backup_schedule: Schedule for the backup if it is executed periodically. + :type backup_schedule: ~azure.mgmt.web.v2020_06_01.models.BackupSchedule + :param databases: Databases included in the backup. + :type databases: list[~azure.mgmt.web.v2020_06_01.models.DatabaseBackupSetting] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'backup_name': {'key': 'properties.backupName', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'storage_account_url': {'key': 'properties.storageAccountUrl', 'type': 'str'}, + 'backup_schedule': {'key': 'properties.backupSchedule', 'type': 'BackupSchedule'}, + 'databases': {'key': 'properties.databases', 'type': '[DatabaseBackupSetting]'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupRequest, self).__init__(**kwargs) + self.backup_name = kwargs.get('backup_name', None) + self.enabled = kwargs.get('enabled', None) + self.storage_account_url = kwargs.get('storage_account_url', None) + self.backup_schedule = kwargs.get('backup_schedule', None) + self.databases = kwargs.get('databases', None) + + +class BackupSchedule(msrest.serialization.Model): + """Description of a backup schedule. Describes how often should be the backup performed and what should be the retention policy. + + 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. + + :param frequency_interval: Required. How often the backup should be executed (e.g. for weekly + backup, this should be set to 7 and FrequencyUnit should be set to Day). + :type frequency_interval: int + :param frequency_unit: Required. The unit of time for how often the backup should be executed + (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7). + Possible values include: "Day", "Hour". Default value: "Day". + :type frequency_unit: str or ~azure.mgmt.web.v2020_06_01.models.FrequencyUnit + :param keep_at_least_one_backup: Required. True if the retention policy should always keep at + least one backup in the storage account, regardless how old it is; false otherwise. + :type keep_at_least_one_backup: bool + :param retention_period_in_days: Required. After how many days backups should be deleted. + :type retention_period_in_days: int + :param start_time: When the schedule should start working. + :type start_time: ~datetime.datetime + :ivar last_execution_time: Last time when this schedule was triggered. + :vartype last_execution_time: ~datetime.datetime + """ + + _validation = { + 'frequency_interval': {'required': True}, + 'frequency_unit': {'required': True}, + 'keep_at_least_one_backup': {'required': True}, + 'retention_period_in_days': {'required': True}, + 'last_execution_time': {'readonly': True}, + } + + _attribute_map = { + 'frequency_interval': {'key': 'frequencyInterval', 'type': 'int'}, + 'frequency_unit': {'key': 'frequencyUnit', 'type': 'str'}, + 'keep_at_least_one_backup': {'key': 'keepAtLeastOneBackup', 'type': 'bool'}, + 'retention_period_in_days': {'key': 'retentionPeriodInDays', 'type': 'int'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'last_execution_time': {'key': 'lastExecutionTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupSchedule, self).__init__(**kwargs) + self.frequency_interval = kwargs.get('frequency_interval', 7) + self.frequency_unit = kwargs.get('frequency_unit', "Day") + self.keep_at_least_one_backup = kwargs.get('keep_at_least_one_backup', True) + self.retention_period_in_days = kwargs.get('retention_period_in_days', 30) + self.start_time = kwargs.get('start_time', None) + self.last_execution_time = None + + +class BillingMeter(ProxyOnlyResource): + """App Service billing entity that contains information about meter which the Azure billing system utilizes to charge users for services. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param meter_id: Meter GUID onboarded in Commerce. + :type meter_id: str + :param billing_location: Azure Location of billable resource. + :type billing_location: str + :param short_name: Short Name from App Service Azure pricing Page. + :type short_name: str + :param friendly_name: Friendly name of the meter. + :type friendly_name: str + :param resource_type: App Service ResourceType meter used for. + :type resource_type: str + :param os_type: App Service OS type meter used for. + :type os_type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, + 'billing_location': {'key': 'properties.billingLocation', 'type': 'str'}, + 'short_name': {'key': 'properties.shortName', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'resource_type': {'key': 'properties.resourceType', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BillingMeter, self).__init__(**kwargs) + self.meter_id = kwargs.get('meter_id', None) + self.billing_location = kwargs.get('billing_location', None) + self.short_name = kwargs.get('short_name', None) + self.friendly_name = kwargs.get('friendly_name', None) + self.resource_type = kwargs.get('resource_type', None) + self.os_type = kwargs.get('os_type', None) + + +class BillingMeterCollection(msrest.serialization.Model): + """Collection of Billing Meters. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.BillingMeter] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingMeter]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BillingMeterCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class BlobStorageTokenStore(ProxyOnlyResource): + """BlobStorageTokenStore. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param sas_url_setting_name: + :type sas_url_setting_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sas_url_setting_name': {'key': 'properties.sasUrlSettingName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobStorageTokenStore, self).__init__(**kwargs) + self.sas_url_setting_name = kwargs.get('sas_url_setting_name', None) + + +class Capability(msrest.serialization.Model): + """Describes the capabilities/features allowed for a specific SKU. + + :param name: Name of the SKU capability. + :type name: str + :param value: Value of the SKU capability. + :type value: str + :param reason: Reason of the SKU capability. + :type reason: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Capability, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + self.reason = kwargs.get('reason', None) + + +class Certificate(Resource): + """SSL certificate for an app. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar friendly_name: Friendly name of the certificate. + :vartype friendly_name: str + :ivar subject_name: Subject name of the certificate. + :vartype subject_name: str + :param host_names: Host names the certificate applies to. + :type host_names: list[str] + :param pfx_blob: Pfx blob. + :type pfx_blob: bytearray + :ivar site_name: App name. + :vartype site_name: str + :ivar self_link: Self link. + :vartype self_link: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar issue_date: Certificate issue Date. + :vartype issue_date: ~datetime.datetime + :ivar expiration_date: Certificate expiration date. + :vartype expiration_date: ~datetime.datetime + :param password: Certificate password. + :type password: str + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid: Is the certificate valid?. + :vartype valid: bool + :ivar cer_blob: Raw bytes of .cer file. + :vartype cer_blob: bytearray + :ivar public_key_hash: Public key hash. + :vartype public_key_hash: str + :ivar hosting_environment_profile: Specification for the App Service Environment to use for the + certificate. + :vartype hosting_environment_profile: + ~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentProfile + :param key_vault_id: Key Vault Csm resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar key_vault_secret_status: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype key_vault_secret_status: str or + ~azure.mgmt.web.v2020_06_01.models.KeyVaultSecretStatus + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param canonical_name: CNAME of the certificate to be issued via free certificate. + :type canonical_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'site_name': {'readonly': True}, + 'self_link': {'readonly': True}, + 'issuer': {'readonly': True}, + 'issue_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'valid': {'readonly': True}, + 'cer_blob': {'readonly': True}, + 'public_key_hash': {'readonly': True}, + 'hosting_environment_profile': {'readonly': True}, + 'key_vault_secret_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'subject_name': {'key': 'properties.subjectName', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'pfx_blob': {'key': 'properties.pfxBlob', 'type': 'bytearray'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'self_link': {'key': 'properties.selfLink', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'issue_date': {'key': 'properties.issueDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'valid': {'key': 'properties.valid', 'type': 'bool'}, + 'cer_blob': {'key': 'properties.cerBlob', 'type': 'bytearray'}, + 'public_key_hash': {'key': 'properties.publicKeyHash', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'key_vault_secret_status': {'key': 'properties.keyVaultSecretStatus', 'type': 'str'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'canonical_name': {'key': 'properties.canonicalName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Certificate, self).__init__(**kwargs) + self.friendly_name = None + self.subject_name = None + self.host_names = kwargs.get('host_names', None) + self.pfx_blob = kwargs.get('pfx_blob', None) + self.site_name = None + self.self_link = None + self.issuer = None + self.issue_date = None + self.expiration_date = None + self.password = kwargs.get('password', None) + self.thumbprint = None + self.valid = None + self.cer_blob = None + self.public_key_hash = None + self.hosting_environment_profile = None + self.key_vault_id = kwargs.get('key_vault_id', None) + self.key_vault_secret_name = kwargs.get('key_vault_secret_name', None) + self.key_vault_secret_status = None + self.server_farm_id = kwargs.get('server_farm_id', None) + self.canonical_name = kwargs.get('canonical_name', None) + + +class CertificateCollection(msrest.serialization.Model): + """Collection of certificates. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.Certificate] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Certificate]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class CertificateDetails(msrest.serialization.Model): + """SSL certificate details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar version: Certificate Version. + :vartype version: int + :ivar serial_number: Certificate Serial Number. + :vartype serial_number: str + :ivar thumbprint: Certificate Thumbprint. + :vartype thumbprint: str + :ivar subject: Certificate Subject. + :vartype subject: str + :ivar not_before: Date Certificate is valid from. + :vartype not_before: ~datetime.datetime + :ivar not_after: Date Certificate is valid to. + :vartype not_after: ~datetime.datetime + :ivar signature_algorithm: Certificate Signature algorithm. + :vartype signature_algorithm: str + :ivar issuer: Certificate Issuer. + :vartype issuer: str + :ivar raw_data: Raw certificate data. + :vartype raw_data: str + """ + + _validation = { + 'version': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'subject': {'readonly': True}, + 'not_before': {'readonly': True}, + 'not_after': {'readonly': True}, + 'signature_algorithm': {'readonly': True}, + 'issuer': {'readonly': True}, + 'raw_data': {'readonly': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'int'}, + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + 'not_before': {'key': 'notBefore', 'type': 'iso-8601'}, + 'not_after': {'key': 'notAfter', 'type': 'iso-8601'}, + 'signature_algorithm': {'key': 'signatureAlgorithm', 'type': 'str'}, + 'issuer': {'key': 'issuer', 'type': 'str'}, + 'raw_data': {'key': 'rawData', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateDetails, self).__init__(**kwargs) + self.version = None + self.serial_number = None + self.thumbprint = None + self.subject = None + self.not_before = None + self.not_after = None + self.signature_algorithm = None + self.issuer = None + self.raw_data = None + + +class CertificateEmail(ProxyOnlyResource): + """SSL certificate email. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param email_id: Email id. + :type email_id: str + :param time_stamp: Time stamp. + :type time_stamp: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'email_id': {'key': 'properties.emailId', 'type': 'str'}, + 'time_stamp': {'key': 'properties.timeStamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateEmail, self).__init__(**kwargs) + self.email_id = kwargs.get('email_id', None) + self.time_stamp = kwargs.get('time_stamp', None) + + +class CertificateOrderAction(ProxyOnlyResource): + """Certificate order action. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar action_type: Action type. Possible values include: "CertificateIssued", + "CertificateOrderCanceled", "CertificateOrderCreated", "CertificateRevoked", + "DomainValidationComplete", "FraudDetected", "OrgNameChange", "OrgValidationComplete", + "SanDrop", "FraudCleared", "CertificateExpired", "CertificateExpirationWarning", + "FraudDocumentationRequired", "Unknown". + :vartype action_type: str or ~azure.mgmt.web.v2020_06_01.models.CertificateOrderActionType + :ivar created_at: Time at which the certificate action was performed. + :vartype created_at: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'action_type': {'readonly': True}, + 'created_at': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'action_type': {'key': 'properties.actionType', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateOrderAction, self).__init__(**kwargs) + self.action_type = None + self.created_at = None + + +class CertificatePatchResource(ProxyOnlyResource): + """ARM resource for a certificate. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar friendly_name: Friendly name of the certificate. + :vartype friendly_name: str + :ivar subject_name: Subject name of the certificate. + :vartype subject_name: str + :param host_names: Host names the certificate applies to. + :type host_names: list[str] + :param pfx_blob: Pfx blob. + :type pfx_blob: bytearray + :ivar site_name: App name. + :vartype site_name: str + :ivar self_link: Self link. + :vartype self_link: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar issue_date: Certificate issue Date. + :vartype issue_date: ~datetime.datetime + :ivar expiration_date: Certificate expiration date. + :vartype expiration_date: ~datetime.datetime + :param password: Certificate password. + :type password: str + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid: Is the certificate valid?. + :vartype valid: bool + :ivar cer_blob: Raw bytes of .cer file. + :vartype cer_blob: bytearray + :ivar public_key_hash: Public key hash. + :vartype public_key_hash: str + :ivar hosting_environment_profile: Specification for the App Service Environment to use for the + certificate. + :vartype hosting_environment_profile: + ~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentProfile + :param key_vault_id: Key Vault Csm resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar key_vault_secret_status: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype key_vault_secret_status: str or + ~azure.mgmt.web.v2020_06_01.models.KeyVaultSecretStatus + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param canonical_name: CNAME of the certificate to be issued via free certificate. + :type canonical_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'site_name': {'readonly': True}, + 'self_link': {'readonly': True}, + 'issuer': {'readonly': True}, + 'issue_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'valid': {'readonly': True}, + 'cer_blob': {'readonly': True}, + 'public_key_hash': {'readonly': True}, + 'hosting_environment_profile': {'readonly': True}, + 'key_vault_secret_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'subject_name': {'key': 'properties.subjectName', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'pfx_blob': {'key': 'properties.pfxBlob', 'type': 'bytearray'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'self_link': {'key': 'properties.selfLink', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'issue_date': {'key': 'properties.issueDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'valid': {'key': 'properties.valid', 'type': 'bool'}, + 'cer_blob': {'key': 'properties.cerBlob', 'type': 'bytearray'}, + 'public_key_hash': {'key': 'properties.publicKeyHash', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'key_vault_secret_status': {'key': 'properties.keyVaultSecretStatus', 'type': 'str'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'canonical_name': {'key': 'properties.canonicalName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificatePatchResource, self).__init__(**kwargs) + self.friendly_name = None + self.subject_name = None + self.host_names = kwargs.get('host_names', None) + self.pfx_blob = kwargs.get('pfx_blob', None) + self.site_name = None + self.self_link = None + self.issuer = None + self.issue_date = None + self.expiration_date = None + self.password = kwargs.get('password', None) + self.thumbprint = None + self.valid = None + self.cer_blob = None + self.public_key_hash = None + self.hosting_environment_profile = None + self.key_vault_id = kwargs.get('key_vault_id', None) + self.key_vault_secret_name = kwargs.get('key_vault_secret_name', None) + self.key_vault_secret_status = None + self.server_farm_id = kwargs.get('server_farm_id', None) + self.canonical_name = kwargs.get('canonical_name', None) + + +class ClientRegistration(ProxyOnlyResource): + """ClientRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param client_id: + :type client_id: str + :param client_secret_setting_name: + :type client_secret_setting_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ClientRegistration, self).__init__(**kwargs) + self.client_id = kwargs.get('client_id', None) + self.client_secret_setting_name = kwargs.get('client_secret_setting_name', None) + + +class CloningInfo(msrest.serialization.Model): + """Information needed for cloning operation. + + All required parameters must be populated in order to send to Azure. + + :param correlation_id: Correlation ID of cloning operation. This ID ties multiple cloning + operations + together to use the same snapshot. + :type correlation_id: str + :param overwrite: :code:`true` to overwrite destination app; otherwise, + :code:`false`. + :type overwrite: bool + :param clone_custom_host_names: :code:`true` to clone custom hostnames from source + app; otherwise, :code:`false`. + :type clone_custom_host_names: bool + :param clone_source_control: :code:`true` to clone source control from source app; + otherwise, :code:`false`. + :type clone_source_control: bool + :param source_web_app_id: Required. ARM resource ID of the source app. App resource ID is of + the form + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + for production slots and + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + for other slots. + :type source_web_app_id: str + :param source_web_app_location: Location of source app ex: West US or North Europe. + :type source_web_app_location: str + :param hosting_environment: App Service Environment. + :type hosting_environment: str + :param app_settings_overrides: Application setting overrides for cloned app. If specified, + these settings override the settings cloned + from source app. Otherwise, application settings from source app are retained. + :type app_settings_overrides: dict[str, str] + :param configure_load_balancing: :code:`true` to configure load balancing for + source and destination app. + :type configure_load_balancing: bool + :param traffic_manager_profile_id: ARM resource ID of the Traffic Manager profile to use, if it + exists. Traffic Manager resource ID is of the form + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + :type traffic_manager_profile_id: str + :param traffic_manager_profile_name: Name of Traffic Manager profile to create. This is only + needed if Traffic Manager profile does not already exist. + :type traffic_manager_profile_name: str + """ + + _validation = { + 'source_web_app_id': {'required': True}, + } + + _attribute_map = { + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'overwrite': {'key': 'overwrite', 'type': 'bool'}, + 'clone_custom_host_names': {'key': 'cloneCustomHostNames', 'type': 'bool'}, + 'clone_source_control': {'key': 'cloneSourceControl', 'type': 'bool'}, + 'source_web_app_id': {'key': 'sourceWebAppId', 'type': 'str'}, + 'source_web_app_location': {'key': 'sourceWebAppLocation', 'type': 'str'}, + 'hosting_environment': {'key': 'hostingEnvironment', 'type': 'str'}, + 'app_settings_overrides': {'key': 'appSettingsOverrides', 'type': '{str}'}, + 'configure_load_balancing': {'key': 'configureLoadBalancing', 'type': 'bool'}, + 'traffic_manager_profile_id': {'key': 'trafficManagerProfileId', 'type': 'str'}, + 'traffic_manager_profile_name': {'key': 'trafficManagerProfileName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CloningInfo, self).__init__(**kwargs) + self.correlation_id = kwargs.get('correlation_id', None) + self.overwrite = kwargs.get('overwrite', None) + self.clone_custom_host_names = kwargs.get('clone_custom_host_names', None) + self.clone_source_control = kwargs.get('clone_source_control', None) + self.source_web_app_id = kwargs['source_web_app_id'] + self.source_web_app_location = kwargs.get('source_web_app_location', None) + self.hosting_environment = kwargs.get('hosting_environment', None) + self.app_settings_overrides = kwargs.get('app_settings_overrides', None) + self.configure_load_balancing = kwargs.get('configure_load_balancing', None) + self.traffic_manager_profile_id = kwargs.get('traffic_manager_profile_id', None) + self.traffic_manager_profile_name = kwargs.get('traffic_manager_profile_name', None) + + +class Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: Principal Id of user assigned identity. + :vartype principal_id: str + :ivar client_id: Client Id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class ConnectionStringDictionary(ProxyOnlyResource): + """String dictionary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param properties: Connection strings. + :type properties: dict[str, ~azure.mgmt.web.v2020_06_01.models.ConnStringValueTypePair] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{ConnStringValueTypePair}'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionStringDictionary, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ConnStringInfo(msrest.serialization.Model): + """Database connection string information. + + :param name: Name of connection string. + :type name: str + :param connection_string: Connection string value. + :type connection_string: str + :param type: Type of database. Possible values include: "MySql", "SQLServer", "SQLAzure", + "Custom", "NotificationHub", "ServiceBus", "EventHub", "ApiHub", "DocDb", "RedisCache", + "PostgreSQL". + :type type: str or ~azure.mgmt.web.v2020_06_01.models.ConnectionStringType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnStringInfo, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.connection_string = kwargs.get('connection_string', None) + self.type = kwargs.get('type', None) + + +class ConnStringValueTypePair(msrest.serialization.Model): + """Database connection string value to type pair. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Value of pair. + :type value: str + :param type: Required. Type of database. Possible values include: "MySql", "SQLServer", + "SQLAzure", "Custom", "NotificationHub", "ServiceBus", "EventHub", "ApiHub", "DocDb", + "RedisCache", "PostgreSQL". + :type type: str or ~azure.mgmt.web.v2020_06_01.models.ConnectionStringType + """ + + _validation = { + 'value': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnStringValueTypePair, self).__init__(**kwargs) + self.value = kwargs['value'] + self.type = kwargs['type'] + + +class Contact(msrest.serialization.Model): + """Contact information for domain registration. If 'Domain Privacy' option is not selected then the contact information is made publicly available through the Whois +directories as per ICANN requirements. + + All required parameters must be populated in order to send to Azure. + + :param address_mailing: Mailing address. + :type address_mailing: ~azure.mgmt.web.v2020_06_01.models.Address + :param email: Required. Email address. + :type email: str + :param fax: Fax number. + :type fax: str + :param job_title: Job title. + :type job_title: str + :param name_first: Required. First name. + :type name_first: str + :param name_last: Required. Last name. + :type name_last: str + :param name_middle: Middle name. + :type name_middle: str + :param organization: Organization contact belongs to. + :type organization: str + :param phone: Required. Phone number. + :type phone: str + """ + + _validation = { + 'email': {'required': True}, + 'name_first': {'required': True}, + 'name_last': {'required': True}, + 'phone': {'required': True}, + } + + _attribute_map = { + 'address_mailing': {'key': 'addressMailing', 'type': 'Address'}, + 'email': {'key': 'email', 'type': 'str'}, + 'fax': {'key': 'fax', 'type': 'str'}, + 'job_title': {'key': 'jobTitle', 'type': 'str'}, + 'name_first': {'key': 'nameFirst', 'type': 'str'}, + 'name_last': {'key': 'nameLast', 'type': 'str'}, + 'name_middle': {'key': 'nameMiddle', 'type': 'str'}, + 'organization': {'key': 'organization', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Contact, self).__init__(**kwargs) + self.address_mailing = kwargs.get('address_mailing', None) + self.email = kwargs['email'] + self.fax = kwargs.get('fax', None) + self.job_title = kwargs.get('job_title', None) + self.name_first = kwargs['name_first'] + self.name_last = kwargs['name_last'] + self.name_middle = kwargs.get('name_middle', None) + self.organization = kwargs.get('organization', None) + self.phone = kwargs['phone'] + + +class ContainerCpuStatistics(msrest.serialization.Model): + """ContainerCpuStatistics. + + :param cpu_usage: + :type cpu_usage: ~azure.mgmt.web.v2020_06_01.models.ContainerCpuUsage + :param system_cpu_usage: + :type system_cpu_usage: long + :param online_cpu_count: + :type online_cpu_count: int + :param throttling_data: + :type throttling_data: ~azure.mgmt.web.v2020_06_01.models.ContainerThrottlingData + """ + + _attribute_map = { + 'cpu_usage': {'key': 'cpuUsage', 'type': 'ContainerCpuUsage'}, + 'system_cpu_usage': {'key': 'systemCpuUsage', 'type': 'long'}, + 'online_cpu_count': {'key': 'onlineCpuCount', 'type': 'int'}, + 'throttling_data': {'key': 'throttlingData', 'type': 'ContainerThrottlingData'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerCpuStatistics, self).__init__(**kwargs) + self.cpu_usage = kwargs.get('cpu_usage', None) + self.system_cpu_usage = kwargs.get('system_cpu_usage', None) + self.online_cpu_count = kwargs.get('online_cpu_count', None) + self.throttling_data = kwargs.get('throttling_data', None) + + +class ContainerCpuUsage(msrest.serialization.Model): + """ContainerCpuUsage. + + :param total_usage: + :type total_usage: long + :param per_cpu_usage: + :type per_cpu_usage: list[long] + :param kernel_mode_usage: + :type kernel_mode_usage: long + :param user_mode_usage: + :type user_mode_usage: long + """ + + _attribute_map = { + 'total_usage': {'key': 'totalUsage', 'type': 'long'}, + 'per_cpu_usage': {'key': 'perCpuUsage', 'type': '[long]'}, + 'kernel_mode_usage': {'key': 'kernelModeUsage', 'type': 'long'}, + 'user_mode_usage': {'key': 'userModeUsage', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerCpuUsage, self).__init__(**kwargs) + self.total_usage = kwargs.get('total_usage', None) + self.per_cpu_usage = kwargs.get('per_cpu_usage', None) + self.kernel_mode_usage = kwargs.get('kernel_mode_usage', None) + self.user_mode_usage = kwargs.get('user_mode_usage', None) + + +class ContainerInfo(msrest.serialization.Model): + """ContainerInfo. + + :param current_time_stamp: + :type current_time_stamp: ~datetime.datetime + :param previous_time_stamp: + :type previous_time_stamp: ~datetime.datetime + :param current_cpu_stats: + :type current_cpu_stats: ~azure.mgmt.web.v2020_06_01.models.ContainerCpuStatistics + :param previous_cpu_stats: + :type previous_cpu_stats: ~azure.mgmt.web.v2020_06_01.models.ContainerCpuStatistics + :param memory_stats: + :type memory_stats: ~azure.mgmt.web.v2020_06_01.models.ContainerMemoryStatistics + :param name: + :type name: str + :param id: + :type id: str + :param eth0: + :type eth0: ~azure.mgmt.web.v2020_06_01.models.ContainerNetworkInterfaceStatistics + """ + + _attribute_map = { + 'current_time_stamp': {'key': 'currentTimeStamp', 'type': 'iso-8601'}, + 'previous_time_stamp': {'key': 'previousTimeStamp', 'type': 'iso-8601'}, + 'current_cpu_stats': {'key': 'currentCpuStats', 'type': 'ContainerCpuStatistics'}, + 'previous_cpu_stats': {'key': 'previousCpuStats', 'type': 'ContainerCpuStatistics'}, + 'memory_stats': {'key': 'memoryStats', 'type': 'ContainerMemoryStatistics'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'eth0': {'key': 'eth0', 'type': 'ContainerNetworkInterfaceStatistics'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerInfo, self).__init__(**kwargs) + self.current_time_stamp = kwargs.get('current_time_stamp', None) + self.previous_time_stamp = kwargs.get('previous_time_stamp', None) + self.current_cpu_stats = kwargs.get('current_cpu_stats', None) + self.previous_cpu_stats = kwargs.get('previous_cpu_stats', None) + self.memory_stats = kwargs.get('memory_stats', None) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.eth0 = kwargs.get('eth0', None) + + +class ContainerMemoryStatistics(msrest.serialization.Model): + """ContainerMemoryStatistics. + + :param usage: + :type usage: long + :param max_usage: + :type max_usage: long + :param limit: + :type limit: long + """ + + _attribute_map = { + 'usage': {'key': 'usage', 'type': 'long'}, + 'max_usage': {'key': 'maxUsage', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerMemoryStatistics, self).__init__(**kwargs) + self.usage = kwargs.get('usage', None) + self.max_usage = kwargs.get('max_usage', None) + self.limit = kwargs.get('limit', None) + + +class ContainerNetworkInterfaceStatistics(msrest.serialization.Model): + """ContainerNetworkInterfaceStatistics. + + :param rx_bytes: + :type rx_bytes: long + :param rx_packets: + :type rx_packets: long + :param rx_errors: + :type rx_errors: long + :param rx_dropped: + :type rx_dropped: long + :param tx_bytes: + :type tx_bytes: long + :param tx_packets: + :type tx_packets: long + :param tx_errors: + :type tx_errors: long + :param tx_dropped: + :type tx_dropped: long + """ + + _attribute_map = { + 'rx_bytes': {'key': 'rxBytes', 'type': 'long'}, + 'rx_packets': {'key': 'rxPackets', 'type': 'long'}, + 'rx_errors': {'key': 'rxErrors', 'type': 'long'}, + 'rx_dropped': {'key': 'rxDropped', 'type': 'long'}, + 'tx_bytes': {'key': 'txBytes', 'type': 'long'}, + 'tx_packets': {'key': 'txPackets', 'type': 'long'}, + 'tx_errors': {'key': 'txErrors', 'type': 'long'}, + 'tx_dropped': {'key': 'txDropped', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerNetworkInterfaceStatistics, self).__init__(**kwargs) + self.rx_bytes = kwargs.get('rx_bytes', None) + self.rx_packets = kwargs.get('rx_packets', None) + self.rx_errors = kwargs.get('rx_errors', None) + self.rx_dropped = kwargs.get('rx_dropped', None) + self.tx_bytes = kwargs.get('tx_bytes', None) + self.tx_packets = kwargs.get('tx_packets', None) + self.tx_errors = kwargs.get('tx_errors', None) + self.tx_dropped = kwargs.get('tx_dropped', None) + + +class ContainerThrottlingData(msrest.serialization.Model): + """ContainerThrottlingData. + + :param periods: + :type periods: int + :param throttled_periods: + :type throttled_periods: int + :param throttled_time: + :type throttled_time: int + """ + + _attribute_map = { + 'periods': {'key': 'periods', 'type': 'int'}, + 'throttled_periods': {'key': 'throttledPeriods', 'type': 'int'}, + 'throttled_time': {'key': 'throttledTime', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerThrottlingData, self).__init__(**kwargs) + self.periods = kwargs.get('periods', None) + self.throttled_periods = kwargs.get('throttled_periods', None) + self.throttled_time = kwargs.get('throttled_time', None) + + +class ContinuousWebJob(ProxyOnlyResource): + """Continuous Web Job Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param status: Job status. Possible values include: "Initializing", "Starting", "Running", + "PendingRestart", "Stopped". + :type status: str or ~azure.mgmt.web.v2020_06_01.models.ContinuousWebJobStatus + :param detailed_status: Detailed status. + :type detailed_status: str + :param log_url: Log URL. + :type log_url: str + :param run_command: Run command. + :type run_command: str + :param url: Job URL. + :type url: str + :param extra_info_url: Extra Info URL. + :type extra_info_url: str + :param web_job_type: Job type. Possible values include: "Continuous", "Triggered". + :type web_job_type: str or ~azure.mgmt.web.v2020_06_01.models.WebJobType + :param error: Error information. + :type error: str + :param using_sdk: Using SDK?. + :type using_sdk: bool + :param settings: Job settings. + :type settings: dict[str, object] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'detailed_status': {'key': 'properties.detailed_status', 'type': 'str'}, + 'log_url': {'key': 'properties.log_url', 'type': 'str'}, + 'run_command': {'key': 'properties.run_command', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'extra_info_url': {'key': 'properties.extra_info_url', 'type': 'str'}, + 'web_job_type': {'key': 'properties.web_job_type', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'str'}, + 'using_sdk': {'key': 'properties.using_sdk', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(ContinuousWebJob, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.detailed_status = kwargs.get('detailed_status', None) + self.log_url = kwargs.get('log_url', None) + self.run_command = kwargs.get('run_command', None) + self.url = kwargs.get('url', None) + self.extra_info_url = kwargs.get('extra_info_url', None) + self.web_job_type = kwargs.get('web_job_type', None) + self.error = kwargs.get('error', None) + self.using_sdk = kwargs.get('using_sdk', None) + self.settings = kwargs.get('settings', None) + + +class ContinuousWebJobCollection(msrest.serialization.Model): + """Collection of Kudu continuous web job information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.ContinuousWebJob] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ContinuousWebJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ContinuousWebJobCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class CookieExpiration(ProxyOnlyResource): + """CookieExpiration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param convention: Possible values include: "FixedTime", "IdentityProviderDerived". + :type convention: str or ~azure.mgmt.web.v2020_06_01.models.CookieExpirationConvention + :param time_to_expiration: + :type time_to_expiration: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'convention': {'key': 'properties.convention', 'type': 'str'}, + 'time_to_expiration': {'key': 'properties.timeToExpiration', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CookieExpiration, self).__init__(**kwargs) + self.convention = kwargs.get('convention', None) + self.time_to_expiration = kwargs.get('time_to_expiration', None) + + +class CorsSettings(msrest.serialization.Model): + """Cross-Origin Resource Sharing (CORS) settings for the app. + + :param allowed_origins: Gets or sets the list of origins that should be allowed to make cross- + origin + calls (for example: http://example.com:12345). Use "*" to allow all. + :type allowed_origins: list[str] + :param support_credentials: Gets or sets whether CORS requests with credentials are allowed. + See + https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + for more details. + :type support_credentials: bool + """ + + _attribute_map = { + 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'support_credentials': {'key': 'supportCredentials', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(CorsSettings, self).__init__(**kwargs) + self.allowed_origins = kwargs.get('allowed_origins', None) + self.support_credentials = kwargs.get('support_credentials', None) + + +class CsmCopySlotEntity(msrest.serialization.Model): + """Copy deployment slot parameters. + + All required parameters must be populated in order to send to Azure. + + :param target_slot: Required. Destination deployment slot during copy operation. + :type target_slot: str + :param site_config: Required. The site object which will be merged with the source slot site + to produce new destination slot site object. + :code:`null` to just copy source slot content. Otherwise a + :code:`Site` + object with properties to override source slot site. + :type site_config: ~azure.mgmt.web.v2020_06_01.models.SiteConfig + """ + + _validation = { + 'target_slot': {'required': True}, + 'site_config': {'required': True}, + } + + _attribute_map = { + 'target_slot': {'key': 'targetSlot', 'type': 'str'}, + 'site_config': {'key': 'siteConfig', 'type': 'SiteConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmCopySlotEntity, self).__init__(**kwargs) + self.target_slot = kwargs['target_slot'] + self.site_config = kwargs['site_config'] + + +class CsmMoveResourceEnvelope(msrest.serialization.Model): + """Object with a list of the resources that need to be moved and the resource group they should be moved to. + + :param target_resource_group: + :type target_resource_group: str + :param resources: + :type resources: list[str] + """ + + _validation = { + 'target_resource_group': {'max_length': 90, 'min_length': 1, 'pattern': r' ^[-\w\._\(\)]+[^\.]$'}, + } + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmMoveResourceEnvelope, self).__init__(**kwargs) + self.target_resource_group = kwargs.get('target_resource_group', None) + self.resources = kwargs.get('resources', None) + + +class CsmOperationCollection(msrest.serialization.Model): + """Collection of Azure resource manager operation metadata. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.CsmOperationDescription] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CsmOperationDescription]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmOperationCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class CsmOperationDescription(msrest.serialization.Model): + """Description of an operation available for Microsoft.Web resource provider. + + :param name: + :type name: str + :param display: Meta data about operation used for display in portal. + :type display: ~azure.mgmt.web.v2020_06_01.models.CsmOperationDisplay + :param origin: + :type origin: str + :param properties: Properties available for a Microsoft.Web resource provider operation. + :type properties: ~azure.mgmt.web.v2020_06_01.models.CsmOperationDescriptionProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'CsmOperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CsmOperationDescriptionProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmOperationDescription, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) + + +class CsmOperationDescriptionProperties(msrest.serialization.Model): + """Properties available for a Microsoft.Web resource provider operation. + + :param service_specification: Resource metrics service provided by Microsoft.Insights resource + provider. + :type service_specification: ~azure.mgmt.web.v2020_06_01.models.ServiceSpecification + """ + + _attribute_map = { + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmOperationDescriptionProperties, self).__init__(**kwargs) + self.service_specification = kwargs.get('service_specification', None) + + +class CsmOperationDisplay(msrest.serialization.Model): + """Meta data about operation used for display in portal. + + :param provider: + :type provider: str + :param resource: + :type resource: str + :param operation: + :type operation: str + :param description: + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmOperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class CsmPublishingCredentialsPoliciesCollection(ProxyOnlyResource): + """Publishing Credentials Policies collection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param ftp: Whether FTP is allowed. + :type ftp: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingCredentialsPoliciesEntity + :param scm: Whether Scm Basic Auth is allowed. + :type scm: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingCredentialsPoliciesEntity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'ftp': {'key': 'properties.ftp', 'type': 'CsmPublishingCredentialsPoliciesEntity'}, + 'scm': {'key': 'properties.scm', 'type': 'CsmPublishingCredentialsPoliciesEntity'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmPublishingCredentialsPoliciesCollection, self).__init__(**kwargs) + self.ftp = kwargs.get('ftp', None) + self.scm = kwargs.get('scm', None) + + +class CsmPublishingCredentialsPoliciesEntity(ProxyOnlyResource): + """Publishing Credentials Policies parameters. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param allow: :code:`true` to allow access to a publishing method; otherwise, + :code:`false`. + :type allow: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'allow': {'key': 'properties.allow', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmPublishingCredentialsPoliciesEntity, self).__init__(**kwargs) + self.allow = kwargs.get('allow', None) + + +class CsmPublishingProfileOptions(msrest.serialization.Model): + """Publishing options for requested profile. + + :param format: Name of the format. Valid values are: + FileZilla3 + WebDeploy -- default + Ftp. Possible values include: "FileZilla3", "WebDeploy", "Ftp". + :type format: str or ~azure.mgmt.web.v2020_06_01.models.PublishingProfileFormat + :param include_disaster_recovery_endpoints: Include the DisasterRecover endpoint if true. + :type include_disaster_recovery_endpoints: bool + """ + + _attribute_map = { + 'format': {'key': 'format', 'type': 'str'}, + 'include_disaster_recovery_endpoints': {'key': 'includeDisasterRecoveryEndpoints', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmPublishingProfileOptions, self).__init__(**kwargs) + self.format = kwargs.get('format', None) + self.include_disaster_recovery_endpoints = kwargs.get('include_disaster_recovery_endpoints', None) + + +class CsmSlotEntity(msrest.serialization.Model): + """Deployment slot parameters. + + All required parameters must be populated in order to send to Azure. + + :param target_slot: Required. Destination deployment slot during swap operation. + :type target_slot: str + :param preserve_vnet: Required. :code:`true` to preserve Virtual Network to the + slot during swap; otherwise, :code:`false`. + :type preserve_vnet: bool + """ + + _validation = { + 'target_slot': {'required': True}, + 'preserve_vnet': {'required': True}, + } + + _attribute_map = { + 'target_slot': {'key': 'targetSlot', 'type': 'str'}, + 'preserve_vnet': {'key': 'preserveVnet', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmSlotEntity, self).__init__(**kwargs) + self.target_slot = kwargs['target_slot'] + self.preserve_vnet = kwargs['preserve_vnet'] + + +class CsmUsageQuota(msrest.serialization.Model): + """Usage of the quota resource. + + :param unit: Units of measurement for the quota resource. + :type unit: str + :param next_reset_time: Next reset time for the resource counter. + :type next_reset_time: ~datetime.datetime + :param current_value: The current value of the resource counter. + :type current_value: long + :param limit: The resource limit. + :type limit: long + :param name: Quota name. + :type name: ~azure.mgmt.web.v2020_06_01.models.LocalizableString + """ + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'next_reset_time': {'key': 'nextResetTime', 'type': 'iso-8601'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'LocalizableString'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmUsageQuota, self).__init__(**kwargs) + self.unit = kwargs.get('unit', None) + self.next_reset_time = kwargs.get('next_reset_time', None) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) + + +class CsmUsageQuotaCollection(msrest.serialization.Model): + """Collection of CSM usage quotas. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.CsmUsageQuota] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CsmUsageQuota]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmUsageQuotaCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class CustomHostnameAnalysisResult(ProxyOnlyResource): + """Custom domain analysis. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar is_hostname_already_verified: :code:`true` if hostname is already verified; + otherwise, :code:`false`. + :vartype is_hostname_already_verified: bool + :ivar custom_domain_verification_test: DNS verification test result. Possible values include: + "Passed", "Failed", "Skipped". + :vartype custom_domain_verification_test: str or + ~azure.mgmt.web.v2020_06_01.models.DnsVerificationTestResult + :ivar custom_domain_verification_failure_info: Raw failure information if DNS verification + fails. + :vartype custom_domain_verification_failure_info: + ~azure.mgmt.web.v2020_06_01.models.ErrorEntity + :ivar has_conflict_on_scale_unit: :code:`true` if there is a conflict on a scale + unit; otherwise, :code:`false`. + :vartype has_conflict_on_scale_unit: bool + :ivar has_conflict_across_subscription: :code:`true` if there is a conflict across + subscriptions; otherwise, :code:`false`. + :vartype has_conflict_across_subscription: bool + :ivar conflicting_app_resource_id: Name of the conflicting app on scale unit if it's within the + same subscription. + :vartype conflicting_app_resource_id: str + :param c_name_records: CName records controller can see for this hostname. + :type c_name_records: list[str] + :param txt_records: TXT records controller can see for this hostname. + :type txt_records: list[str] + :param a_records: A records controller can see for this hostname. + :type a_records: list[str] + :param alternate_c_name_records: Alternate CName records controller can see for this hostname. + :type alternate_c_name_records: list[str] + :param alternate_txt_records: Alternate TXT records controller can see for this hostname. + :type alternate_txt_records: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'is_hostname_already_verified': {'readonly': True}, + 'custom_domain_verification_test': {'readonly': True}, + 'custom_domain_verification_failure_info': {'readonly': True}, + 'has_conflict_on_scale_unit': {'readonly': True}, + 'has_conflict_across_subscription': {'readonly': True}, + 'conflicting_app_resource_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_hostname_already_verified': {'key': 'properties.isHostnameAlreadyVerified', 'type': 'bool'}, + 'custom_domain_verification_test': {'key': 'properties.customDomainVerificationTest', 'type': 'str'}, + 'custom_domain_verification_failure_info': {'key': 'properties.customDomainVerificationFailureInfo', 'type': 'ErrorEntity'}, + 'has_conflict_on_scale_unit': {'key': 'properties.hasConflictOnScaleUnit', 'type': 'bool'}, + 'has_conflict_across_subscription': {'key': 'properties.hasConflictAcrossSubscription', 'type': 'bool'}, + 'conflicting_app_resource_id': {'key': 'properties.conflictingAppResourceId', 'type': 'str'}, + 'c_name_records': {'key': 'properties.cNameRecords', 'type': '[str]'}, + 'txt_records': {'key': 'properties.txtRecords', 'type': '[str]'}, + 'a_records': {'key': 'properties.aRecords', 'type': '[str]'}, + 'alternate_c_name_records': {'key': 'properties.alternateCNameRecords', 'type': '[str]'}, + 'alternate_txt_records': {'key': 'properties.alternateTxtRecords', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(CustomHostnameAnalysisResult, self).__init__(**kwargs) + self.is_hostname_already_verified = None + self.custom_domain_verification_test = None + self.custom_domain_verification_failure_info = None + self.has_conflict_on_scale_unit = None + self.has_conflict_across_subscription = None + self.conflicting_app_resource_id = None + self.c_name_records = kwargs.get('c_name_records', None) + self.txt_records = kwargs.get('txt_records', None) + self.a_records = kwargs.get('a_records', None) + self.alternate_c_name_records = kwargs.get('alternate_c_name_records', None) + self.alternate_txt_records = kwargs.get('alternate_txt_records', None) + + +class CustomOpenIdConnectProvider(ProxyOnlyResource): + """CustomOpenIdConnectProvider. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_06_01.models.OpenIdConnectRegistration + :param login: + :type login: ~azure.mgmt.web.v2020_06_01.models.OpenIdConnectLogin + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'OpenIdConnectRegistration'}, + 'login': {'key': 'properties.login', 'type': 'OpenIdConnectLogin'}, + } + + def __init__( + self, + **kwargs + ): + super(CustomOpenIdConnectProvider, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.registration = kwargs.get('registration', None) + self.login = kwargs.get('login', None) + + +class DatabaseBackupSetting(msrest.serialization.Model): + """Database backup settings. + + All required parameters must be populated in order to send to Azure. + + :param database_type: Required. Database type (e.g. SqlAzure / MySql). Possible values include: + "SqlAzure", "MySql", "LocalMySql", "PostgreSql". + :type database_type: str or ~azure.mgmt.web.v2020_06_01.models.DatabaseType + :param name: + :type name: str + :param connection_string_name: Contains a connection string name that is linked to the + SiteConfig.ConnectionStrings. + This is used during restore with overwrite connection strings options. + :type connection_string_name: str + :param connection_string: Contains a connection string to a database which is being backed up + or restored. If the restore should happen to a new database, the database name inside is the + new one. + :type connection_string: str + """ + + _validation = { + 'database_type': {'required': True}, + } + + _attribute_map = { + 'database_type': {'key': 'databaseType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'connection_string_name': {'key': 'connectionStringName', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabaseBackupSetting, self).__init__(**kwargs) + self.database_type = kwargs['database_type'] + self.name = kwargs.get('name', None) + self.connection_string_name = kwargs.get('connection_string_name', None) + self.connection_string = kwargs.get('connection_string', None) + + +class DataSource(msrest.serialization.Model): + """Class representing data source used by the detectors. + + :param instructions: Instructions if any for the data source. + :type instructions: list[str] + :param data_source_uri: Datasource Uri Links. + :type data_source_uri: list[~azure.mgmt.web.v2020_06_01.models.NameValuePair] + """ + + _attribute_map = { + 'instructions': {'key': 'instructions', 'type': '[str]'}, + 'data_source_uri': {'key': 'dataSourceUri', 'type': '[NameValuePair]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataSource, self).__init__(**kwargs) + self.instructions = kwargs.get('instructions', None) + self.data_source_uri = kwargs.get('data_source_uri', None) + + +class DataTableResponseColumn(msrest.serialization.Model): + """Column definition. + + :param column_name: Name of the column. + :type column_name: str + :param data_type: Data type which looks like 'String' or 'Int32'. + :type data_type: str + :param column_type: Column Type. + :type column_type: str + """ + + _attribute_map = { + 'column_name': {'key': 'columnName', 'type': 'str'}, + 'data_type': {'key': 'dataType', 'type': 'str'}, + 'column_type': {'key': 'columnType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataTableResponseColumn, self).__init__(**kwargs) + self.column_name = kwargs.get('column_name', None) + self.data_type = kwargs.get('data_type', None) + self.column_type = kwargs.get('column_type', None) + + +class DataTableResponseObject(msrest.serialization.Model): + """Data Table which defines columns and raw row values. + + :param table_name: Name of the table. + :type table_name: str + :param columns: List of columns with data types. + :type columns: list[~azure.mgmt.web.v2020_06_01.models.DataTableResponseColumn] + :param rows: Raw row values. + :type rows: list[list[str]] + """ + + _attribute_map = { + 'table_name': {'key': 'tableName', 'type': 'str'}, + 'columns': {'key': 'columns', 'type': '[DataTableResponseColumn]'}, + 'rows': {'key': 'rows', 'type': '[[str]]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataTableResponseObject, self).__init__(**kwargs) + self.table_name = kwargs.get('table_name', None) + self.columns = kwargs.get('columns', None) + self.rows = kwargs.get('rows', None) + + +class DefaultErrorResponse(msrest.serialization.Model): + """App Service error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Error model. + :vartype error: ~azure.mgmt.web.v2020_06_01.models.DefaultErrorResponseError + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'DefaultErrorResponseError'}, + } + + def __init__( + self, + **kwargs + ): + super(DefaultErrorResponse, self).__init__(**kwargs) + self.error = None + + +class DefaultErrorResponseError(msrest.serialization.Model): + """Error model. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Standardized string to programmatically identify the error. + :vartype code: str + :ivar message: Detailed error description and debugging information. + :vartype message: str + :ivar target: Detailed error description and debugging information. + :vartype target: str + :param details: + :type details: list[~azure.mgmt.web.v2020_06_01.models.DefaultErrorResponseErrorDetailsItem] + :ivar innererror: More information to debug error. + :vartype innererror: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'innererror': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[DefaultErrorResponseErrorDetailsItem]'}, + 'innererror': {'key': 'innererror', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DefaultErrorResponseError, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = kwargs.get('details', None) + self.innererror = None + + +class DefaultErrorResponseErrorDetailsItem(msrest.serialization.Model): + """Detailed errors. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Standardized string to programmatically identify the error. + :vartype code: str + :ivar message: Detailed error description and debugging information. + :vartype message: str + :ivar target: Detailed error description and debugging information. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DefaultErrorResponseErrorDetailsItem, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + + +class DeletedAppRestoreRequest(ProxyOnlyResource): + """Details about restoring a deleted app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param deleted_site_id: ARM resource ID of the deleted app. Example: + /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}. + :type deleted_site_id: str + :param recover_configuration: If true, deleted site configuration, in addition to content, will + be restored. + :type recover_configuration: bool + :param snapshot_time: Point in time to restore the deleted app from, formatted as a DateTime + string. + If unspecified, default value is the time that the app was deleted. + :type snapshot_time: str + :param use_dr_secondary: If true, the snapshot is retrieved from DRSecondary endpoint. + :type use_dr_secondary: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'deleted_site_id': {'key': 'properties.deletedSiteId', 'type': 'str'}, + 'recover_configuration': {'key': 'properties.recoverConfiguration', 'type': 'bool'}, + 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'str'}, + 'use_dr_secondary': {'key': 'properties.useDRSecondary', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedAppRestoreRequest, self).__init__(**kwargs) + self.deleted_site_id = kwargs.get('deleted_site_id', None) + self.recover_configuration = kwargs.get('recover_configuration', None) + self.snapshot_time = kwargs.get('snapshot_time', None) + self.use_dr_secondary = kwargs.get('use_dr_secondary', None) + + +class DeletedSite(ProxyOnlyResource): + """A deleted app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar deleted_site_id: Numeric id for the deleted site. + :vartype deleted_site_id: int + :ivar deleted_timestamp: Time in UTC when the app was deleted. + :vartype deleted_timestamp: str + :ivar subscription: Subscription containing the deleted site. + :vartype subscription: str + :ivar resource_group: ResourceGroup that contained the deleted site. + :vartype resource_group: str + :ivar deleted_site_name: Name of the deleted site. + :vartype deleted_site_name: str + :ivar slot: Slot of the deleted site. + :vartype slot: str + :ivar kind_properties_kind: Kind of site that was deleted. + :vartype kind_properties_kind: str + :ivar geo_region_name: Geo Region of the deleted site. + :vartype geo_region_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'deleted_site_id': {'readonly': True}, + 'deleted_timestamp': {'readonly': True}, + 'subscription': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'deleted_site_name': {'readonly': True}, + 'slot': {'readonly': True}, + 'kind_properties_kind': {'readonly': True}, + 'geo_region_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'deleted_site_id': {'key': 'properties.deletedSiteId', 'type': 'int'}, + 'deleted_timestamp': {'key': 'properties.deletedTimestamp', 'type': 'str'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'deleted_site_name': {'key': 'properties.deletedSiteName', 'type': 'str'}, + 'slot': {'key': 'properties.slot', 'type': 'str'}, + 'kind_properties_kind': {'key': 'properties.kind', 'type': 'str'}, + 'geo_region_name': {'key': 'properties.geoRegionName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedSite, self).__init__(**kwargs) + self.deleted_site_id = None + self.deleted_timestamp = None + self.subscription = None + self.resource_group = None + self.deleted_site_name = None + self.slot = None + self.kind_properties_kind = None + self.geo_region_name = None + + +class DeletedWebAppCollection(msrest.serialization.Model): + """Collection of deleted apps. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.DeletedSite] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DeletedSite]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedWebAppCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class Deployment(ProxyOnlyResource): + """User credentials used for publishing activity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param status: Deployment status. + :type status: int + :param message: Details about deployment status. + :type message: str + :param author: Who authored the deployment. + :type author: str + :param deployer: Who performed the deployment. + :type deployer: str + :param author_email: Author email. + :type author_email: str + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param end_time: End time. + :type end_time: ~datetime.datetime + :param active: True if deployment is currently active, false if completed and null if not + started. + :type active: bool + :param details: Details on deployment. + :type details: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'int'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'author': {'key': 'properties.author', 'type': 'str'}, + 'deployer': {'key': 'properties.deployer', 'type': 'str'}, + 'author_email': {'key': 'properties.author_email', 'type': 'str'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.end_time', 'type': 'iso-8601'}, + 'active': {'key': 'properties.active', 'type': 'bool'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Deployment, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.message = kwargs.get('message', None) + self.author = kwargs.get('author', None) + self.deployer = kwargs.get('deployer', None) + self.author_email = kwargs.get('author_email', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.active = kwargs.get('active', None) + self.details = kwargs.get('details', None) + + +class DeploymentCollection(msrest.serialization.Model): + """Collection of app deployments. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.Deployment] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Deployment]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DeploymentCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class DeploymentLocations(msrest.serialization.Model): + """List of available locations (regions or App Service Environments) for +deployment of App Service resources. + + :param locations: Available regions. + :type locations: list[~azure.mgmt.web.v2020_06_01.models.GeoRegion] + :param hosting_environments: Available App Service Environments with full descriptions of the + environments. + :type hosting_environments: list[~azure.mgmt.web.v2020_06_01.models.AppServiceEnvironment] + :param hosting_environment_deployment_infos: Available App Service Environments with basic + information. + :type hosting_environment_deployment_infos: + list[~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentDeploymentInfo] + """ + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[GeoRegion]'}, + 'hosting_environments': {'key': 'hostingEnvironments', 'type': '[AppServiceEnvironment]'}, + 'hosting_environment_deployment_infos': {'key': 'hostingEnvironmentDeploymentInfos', 'type': '[HostingEnvironmentDeploymentInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(DeploymentLocations, self).__init__(**kwargs) + self.locations = kwargs.get('locations', None) + self.hosting_environments = kwargs.get('hosting_environments', None) + self.hosting_environment_deployment_infos = kwargs.get('hosting_environment_deployment_infos', None) + + +class DetectorAbnormalTimePeriod(msrest.serialization.Model): + """Class representing Abnormal Time Period detected. + + :param start_time: Start time of the correlated event. + :type start_time: ~datetime.datetime + :param end_time: End time of the correlated event. + :type end_time: ~datetime.datetime + :param message: Message describing the event. + :type message: str + :param source: Represents the name of the Detector. + :type source: str + :param priority: Represents the rank of the Detector. + :type priority: float + :param meta_data: Downtime metadata. + :type meta_data: list[list[~azure.mgmt.web.v2020_06_01.models.NameValuePair]] + :param type: Represents the type of the Detector. Possible values include: "ServiceIncident", + "AppDeployment", "AppCrash", "RuntimeIssueDetected", "AseDeployment", "UserIssue", + "PlatformIssue", "Other". + :type type: str or ~azure.mgmt.web.v2020_06_01.models.IssueType + :param solutions: List of proposed solutions. + :type solutions: list[~azure.mgmt.web.v2020_06_01.models.Solution] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'float'}, + 'meta_data': {'key': 'metaData', 'type': '[[NameValuePair]]'}, + 'type': {'key': 'type', 'type': 'str'}, + 'solutions': {'key': 'solutions', 'type': '[Solution]'}, + } + + def __init__( + self, + **kwargs + ): + super(DetectorAbnormalTimePeriod, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.message = kwargs.get('message', None) + self.source = kwargs.get('source', None) + self.priority = kwargs.get('priority', None) + self.meta_data = kwargs.get('meta_data', None) + self.type = kwargs.get('type', None) + self.solutions = kwargs.get('solutions', None) + + +class DetectorDefinition(ProxyOnlyResource): + """Class representing detector definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: Display name of the detector. + :vartype display_name: str + :ivar description: Description of the detector. + :vartype description: str + :ivar rank: Detector Rank. + :vartype rank: float + :ivar is_enabled: Flag representing whether detector is enabled or not. + :vartype is_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'rank': {'readonly': True}, + 'is_enabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'rank': {'key': 'properties.rank', 'type': 'float'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DetectorDefinition, self).__init__(**kwargs) + self.display_name = None + self.description = None + self.rank = None + self.is_enabled = None + + +class DetectorInfo(msrest.serialization.Model): + """Definition of Detector. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar description: Short description of the detector and its purpose. + :vartype description: str + :ivar category: Support Category. + :vartype category: str + :ivar sub_category: Support Sub Category. + :vartype sub_category: str + :ivar support_topic_id: Support Topic Id. + :vartype support_topic_id: str + """ + + _validation = { + 'description': {'readonly': True}, + 'category': {'readonly': True}, + 'sub_category': {'readonly': True}, + 'support_topic_id': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'sub_category': {'key': 'subCategory', 'type': 'str'}, + 'support_topic_id': {'key': 'supportTopicId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DetectorInfo, self).__init__(**kwargs) + self.description = None + self.category = None + self.sub_category = None + self.support_topic_id = None + + +class DetectorResponse(ProxyOnlyResource): + """Class representing Response from Detector. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param metadata: metadata for the detector. + :type metadata: ~azure.mgmt.web.v2020_06_01.models.DetectorInfo + :param dataset: Data Set. + :type dataset: list[~azure.mgmt.web.v2020_06_01.models.DiagnosticData] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': 'DetectorInfo'}, + 'dataset': {'key': 'properties.dataset', 'type': '[DiagnosticData]'}, + } + + def __init__( + self, + **kwargs + ): + super(DetectorResponse, self).__init__(**kwargs) + self.metadata = kwargs.get('metadata', None) + self.dataset = kwargs.get('dataset', None) + + +class DetectorResponseCollection(msrest.serialization.Model): + """Collection of detector responses. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.DetectorResponse] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DetectorResponse]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DetectorResponseCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class DiagnosticAnalysis(ProxyOnlyResource): + """Class representing a diagnostic analysis done on an application. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param abnormal_time_periods: List of time periods. + :type abnormal_time_periods: list[~azure.mgmt.web.v2020_06_01.models.AbnormalTimePeriod] + :param payload: Data by each detector. + :type payload: list[~azure.mgmt.web.v2020_06_01.models.AnalysisData] + :param non_correlated_detectors: Data by each detector for detectors that did not corelate. + :type non_correlated_detectors: list[~azure.mgmt.web.v2020_06_01.models.DetectorDefinition] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'abnormal_time_periods': {'key': 'properties.abnormalTimePeriods', 'type': '[AbnormalTimePeriod]'}, + 'payload': {'key': 'properties.payload', 'type': '[AnalysisData]'}, + 'non_correlated_detectors': {'key': 'properties.nonCorrelatedDetectors', 'type': '[DetectorDefinition]'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticAnalysis, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.abnormal_time_periods = kwargs.get('abnormal_time_periods', None) + self.payload = kwargs.get('payload', None) + self.non_correlated_detectors = kwargs.get('non_correlated_detectors', None) + + +class DiagnosticAnalysisCollection(msrest.serialization.Model): + """Collection of Diagnostic Analyses. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.AnalysisDefinition] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AnalysisDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticAnalysisCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class DiagnosticCategory(ProxyOnlyResource): + """Class representing detector definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar description: Description of the diagnostic category. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticCategory, self).__init__(**kwargs) + self.description = None + + +class DiagnosticCategoryCollection(msrest.serialization.Model): + """Collection of Diagnostic Categories. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.DiagnosticCategory] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DiagnosticCategory]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticCategoryCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class DiagnosticData(msrest.serialization.Model): + """Set of data with rendering instructions. + + :param table: Data in table form. + :type table: ~azure.mgmt.web.v2020_06_01.models.DataTableResponseObject + :param rendering_properties: Properties that describe how the table should be rendered. + :type rendering_properties: ~azure.mgmt.web.v2020_06_01.models.Rendering + """ + + _attribute_map = { + 'table': {'key': 'table', 'type': 'DataTableResponseObject'}, + 'rendering_properties': {'key': 'renderingProperties', 'type': 'Rendering'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticData, self).__init__(**kwargs) + self.table = kwargs.get('table', None) + self.rendering_properties = kwargs.get('rendering_properties', None) + + +class DiagnosticDetectorCollection(msrest.serialization.Model): + """Collection of Diagnostic Detectors. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.DetectorDefinition] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DetectorDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticDetectorCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class DiagnosticDetectorResponse(ProxyOnlyResource): + """Class representing Response from Diagnostic Detectors. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param issue_detected: Flag representing Issue was detected. + :type issue_detected: bool + :param detector_definition: Detector's definition. + :type detector_definition: ~azure.mgmt.web.v2020_06_01.models.DetectorDefinition + :param metrics: Metrics provided by the detector. + :type metrics: list[~azure.mgmt.web.v2020_06_01.models.DiagnosticMetricSet] + :param abnormal_time_periods: List of Correlated events found by the detector. + :type abnormal_time_periods: + list[~azure.mgmt.web.v2020_06_01.models.DetectorAbnormalTimePeriod] + :param data: Additional Data that detector wants to send. + :type data: list[list[~azure.mgmt.web.v2020_06_01.models.NameValuePair]] + :param response_meta_data: Meta Data. + :type response_meta_data: ~azure.mgmt.web.v2020_06_01.models.ResponseMetaData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'issue_detected': {'key': 'properties.issueDetected', 'type': 'bool'}, + 'detector_definition': {'key': 'properties.detectorDefinition', 'type': 'DetectorDefinition'}, + 'metrics': {'key': 'properties.metrics', 'type': '[DiagnosticMetricSet]'}, + 'abnormal_time_periods': {'key': 'properties.abnormalTimePeriods', 'type': '[DetectorAbnormalTimePeriod]'}, + 'data': {'key': 'properties.data', 'type': '[[NameValuePair]]'}, + 'response_meta_data': {'key': 'properties.responseMetaData', 'type': 'ResponseMetaData'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticDetectorResponse, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.issue_detected = kwargs.get('issue_detected', None) + self.detector_definition = kwargs.get('detector_definition', None) + self.metrics = kwargs.get('metrics', None) + self.abnormal_time_periods = kwargs.get('abnormal_time_periods', None) + self.data = kwargs.get('data', None) + self.response_meta_data = kwargs.get('response_meta_data', None) + + +class DiagnosticMetricSample(msrest.serialization.Model): + """Class representing Diagnostic Metric. + + :param timestamp: Time at which metric is measured. + :type timestamp: ~datetime.datetime + :param role_instance: Role Instance. Null if this counter is not per instance + This is returned and should be whichever instance name we desire to be returned + i.e. CPU and Memory return RDWORKERNAME (LargeDed..._IN_0) + where RDWORKERNAME is Machine name below and RoleInstance name in parenthesis. + :type role_instance: str + :param total: Total value of the metric. If multiple measurements are made this will have sum + of all. + :type total: float + :param maximum: Maximum of the metric sampled during the time period. + :type maximum: float + :param minimum: Minimum of the metric sampled during the time period. + :type minimum: float + :param is_aggregated: Whether the values are aggregates across all workers or not. + :type is_aggregated: bool + """ + + _attribute_map = { + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'role_instance': {'key': 'roleInstance', 'type': 'str'}, + 'total': {'key': 'total', 'type': 'float'}, + 'maximum': {'key': 'maximum', 'type': 'float'}, + 'minimum': {'key': 'minimum', 'type': 'float'}, + 'is_aggregated': {'key': 'isAggregated', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticMetricSample, self).__init__(**kwargs) + self.timestamp = kwargs.get('timestamp', None) + self.role_instance = kwargs.get('role_instance', None) + self.total = kwargs.get('total', None) + self.maximum = kwargs.get('maximum', None) + self.minimum = kwargs.get('minimum', None) + self.is_aggregated = kwargs.get('is_aggregated', None) + + +class DiagnosticMetricSet(msrest.serialization.Model): + """Class representing Diagnostic Metric information. + + :param name: Name of the metric. + :type name: str + :param unit: Metric's unit. + :type unit: str + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param time_grain: Presented time grain. Supported grains at the moment are PT1M, PT1H, P1D. + :type time_grain: str + :param values: Collection of metric values for the selected period based on the + {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain}. + :type values: list[~azure.mgmt.web.v2020_06_01.models.DiagnosticMetricSample] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[DiagnosticMetricSample]'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticMetricSet, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.unit = kwargs.get('unit', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.time_grain = kwargs.get('time_grain', None) + self.values = kwargs.get('values', None) + + +class Dimension(msrest.serialization.Model): + """Dimension of a resource metric. For e.g. instance specific HTTP requests for a web app, +where instance name is dimension of the metric HTTP request. + + :param name: + :type name: str + :param display_name: + :type display_name: str + :param internal_name: + :type internal_name: str + :param to_be_exported_for_shoebox: + :type to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.internal_name = kwargs.get('internal_name', None) + self.to_be_exported_for_shoebox = kwargs.get('to_be_exported_for_shoebox', None) + + +class Domain(Resource): + """Information about a domain. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param contact_admin: Administrative contact. + :type contact_admin: ~azure.mgmt.web.v2020_06_01.models.Contact + :param contact_billing: Billing contact. + :type contact_billing: ~azure.mgmt.web.v2020_06_01.models.Contact + :param contact_registrant: Registrant contact. + :type contact_registrant: ~azure.mgmt.web.v2020_06_01.models.Contact + :param contact_tech: Technical contact. + :type contact_tech: ~azure.mgmt.web.v2020_06_01.models.Contact + :ivar registration_status: Domain registration status. Possible values include: "Active", + "Awaiting", "Cancelled", "Confiscated", "Disabled", "Excluded", "Expired", "Failed", "Held", + "Locked", "Parked", "Pending", "Reserved", "Reverted", "Suspended", "Transferred", "Unknown", + "Unlocked", "Unparked", "Updated", "JsonConverterFailed". + :vartype registration_status: str or ~azure.mgmt.web.v2020_06_01.models.DomainStatus + :ivar provisioning_state: Domain provisioning state. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.ProvisioningState + :ivar name_servers: Name servers. + :vartype name_servers: list[str] + :param privacy: :code:`true` if domain privacy is enabled for this domain; + otherwise, :code:`false`. + :type privacy: bool + :ivar created_time: Domain creation timestamp. + :vartype created_time: ~datetime.datetime + :ivar expiration_time: Domain expiration timestamp. + :vartype expiration_time: ~datetime.datetime + :ivar last_renewed_time: Timestamp when the domain was renewed last time. + :vartype last_renewed_time: ~datetime.datetime + :param auto_renew: :code:`true` if the domain should be automatically renewed; + otherwise, :code:`false`. + :type auto_renew: bool + :ivar ready_for_dns_record_management: :code:`true` if Azure can assign this + domain to App Service apps; otherwise, :code:`false`. This value will be + :code:`true` if domain registration status is active and + it is hosted on name servers Azure has programmatic access to. + :vartype ready_for_dns_record_management: bool + :ivar managed_host_names: All hostnames derived from the domain and assigned to Azure + resources. + :vartype managed_host_names: list[~azure.mgmt.web.v2020_06_01.models.HostName] + :param consent: Legal agreement consent. + :type consent: ~azure.mgmt.web.v2020_06_01.models.DomainPurchaseConsent + :ivar domain_not_renewable_reasons: Reasons why domain is not renewable. + :vartype domain_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2020_06_01.models.DomainPropertiesDomainNotRenewableReasonsItem] + :param dns_type: Current DNS type. Possible values include: "AzureDns", + "DefaultDomainRegistrarDns". + :type dns_type: str or ~azure.mgmt.web.v2020_06_01.models.DnsType + :param dns_zone_id: Azure DNS Zone to use. + :type dns_zone_id: str + :param target_dns_type: Target DNS type (would be used for migration). Possible values include: + "AzureDns", "DefaultDomainRegistrarDns". + :type target_dns_type: str or ~azure.mgmt.web.v2020_06_01.models.DnsType + :param auth_code: + :type auth_code: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'registration_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'name_servers': {'readonly': True}, + 'created_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'last_renewed_time': {'readonly': True}, + 'ready_for_dns_record_management': {'readonly': True}, + 'managed_host_names': {'readonly': True}, + 'domain_not_renewable_reasons': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'contact_admin': {'key': 'properties.contactAdmin', 'type': 'Contact'}, + 'contact_billing': {'key': 'properties.contactBilling', 'type': 'Contact'}, + 'contact_registrant': {'key': 'properties.contactRegistrant', 'type': 'Contact'}, + 'contact_tech': {'key': 'properties.contactTech', 'type': 'Contact'}, + 'registration_status': {'key': 'properties.registrationStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name_servers': {'key': 'properties.nameServers', 'type': '[str]'}, + 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'last_renewed_time': {'key': 'properties.lastRenewedTime', 'type': 'iso-8601'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'ready_for_dns_record_management': {'key': 'properties.readyForDnsRecordManagement', 'type': 'bool'}, + 'managed_host_names': {'key': 'properties.managedHostNames', 'type': '[HostName]'}, + 'consent': {'key': 'properties.consent', 'type': 'DomainPurchaseConsent'}, + 'domain_not_renewable_reasons': {'key': 'properties.domainNotRenewableReasons', 'type': '[str]'}, + 'dns_type': {'key': 'properties.dnsType', 'type': 'str'}, + 'dns_zone_id': {'key': 'properties.dnsZoneId', 'type': 'str'}, + 'target_dns_type': {'key': 'properties.targetDnsType', 'type': 'str'}, + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Domain, self).__init__(**kwargs) + self.contact_admin = kwargs.get('contact_admin', None) + self.contact_billing = kwargs.get('contact_billing', None) + self.contact_registrant = kwargs.get('contact_registrant', None) + self.contact_tech = kwargs.get('contact_tech', None) + self.registration_status = None + self.provisioning_state = None + self.name_servers = None + self.privacy = kwargs.get('privacy', None) + self.created_time = None + self.expiration_time = None + self.last_renewed_time = None + self.auto_renew = kwargs.get('auto_renew', True) + self.ready_for_dns_record_management = None + self.managed_host_names = None + self.consent = kwargs.get('consent', None) + self.domain_not_renewable_reasons = None + self.dns_type = kwargs.get('dns_type', None) + self.dns_zone_id = kwargs.get('dns_zone_id', None) + self.target_dns_type = kwargs.get('target_dns_type', None) + self.auth_code = kwargs.get('auth_code', None) + + +class DomainAvailabilityCheckResult(msrest.serialization.Model): + """Domain availability check result. + + :param name: Name of the domain. + :type name: str + :param available: :code:`true` if domain can be purchased using CreateDomain API; + otherwise, :code:`false`. + :type available: bool + :param domain_type: Valid values are Regular domain: Azure will charge the full price of domain + registration, SoftDeleted: Purchasing this domain will simply restore it and this operation + will not cost anything. Possible values include: "Regular", "SoftDeleted". + :type domain_type: str or ~azure.mgmt.web.v2020_06_01.models.DomainType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'available': {'key': 'available', 'type': 'bool'}, + 'domain_type': {'key': 'domainType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainAvailabilityCheckResult, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.available = kwargs.get('available', None) + self.domain_type = kwargs.get('domain_type', None) + + +class DomainCollection(msrest.serialization.Model): + """Collection of domains. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.Domain] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Domain]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class DomainControlCenterSsoRequest(msrest.serialization.Model): + """Single sign-on request information for domain management. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar url: URL where the single sign-on request is to be made. + :vartype url: str + :ivar post_parameter_key: Post parameter key. + :vartype post_parameter_key: str + :ivar post_parameter_value: Post parameter value. Client should use 'application/x-www-form- + urlencoded' encoding for this value. + :vartype post_parameter_value: str + """ + + _validation = { + 'url': {'readonly': True}, + 'post_parameter_key': {'readonly': True}, + 'post_parameter_value': {'readonly': True}, + } + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'post_parameter_key': {'key': 'postParameterKey', 'type': 'str'}, + 'post_parameter_value': {'key': 'postParameterValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainControlCenterSsoRequest, self).__init__(**kwargs) + self.url = None + self.post_parameter_key = None + self.post_parameter_value = None + + +class DomainOwnershipIdentifier(ProxyOnlyResource): + """Domain ownership Identifier. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param ownership_id: Ownership Id. + :type ownership_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'ownership_id': {'key': 'properties.ownershipId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainOwnershipIdentifier, self).__init__(**kwargs) + self.ownership_id = kwargs.get('ownership_id', None) + + +class DomainOwnershipIdentifierCollection(msrest.serialization.Model): + """Collection of domain ownership identifiers. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.DomainOwnershipIdentifier] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DomainOwnershipIdentifier]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainOwnershipIdentifierCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class DomainPatchResource(ProxyOnlyResource): + """ARM resource for a domain. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param contact_admin: Administrative contact. + :type contact_admin: ~azure.mgmt.web.v2020_06_01.models.Contact + :param contact_billing: Billing contact. + :type contact_billing: ~azure.mgmt.web.v2020_06_01.models.Contact + :param contact_registrant: Registrant contact. + :type contact_registrant: ~azure.mgmt.web.v2020_06_01.models.Contact + :param contact_tech: Technical contact. + :type contact_tech: ~azure.mgmt.web.v2020_06_01.models.Contact + :ivar registration_status: Domain registration status. Possible values include: "Active", + "Awaiting", "Cancelled", "Confiscated", "Disabled", "Excluded", "Expired", "Failed", "Held", + "Locked", "Parked", "Pending", "Reserved", "Reverted", "Suspended", "Transferred", "Unknown", + "Unlocked", "Unparked", "Updated", "JsonConverterFailed". + :vartype registration_status: str or ~azure.mgmt.web.v2020_06_01.models.DomainStatus + :ivar provisioning_state: Domain provisioning state. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.ProvisioningState + :ivar name_servers: Name servers. + :vartype name_servers: list[str] + :param privacy: :code:`true` if domain privacy is enabled for this domain; + otherwise, :code:`false`. + :type privacy: bool + :ivar created_time: Domain creation timestamp. + :vartype created_time: ~datetime.datetime + :ivar expiration_time: Domain expiration timestamp. + :vartype expiration_time: ~datetime.datetime + :ivar last_renewed_time: Timestamp when the domain was renewed last time. + :vartype last_renewed_time: ~datetime.datetime + :param auto_renew: :code:`true` if the domain should be automatically renewed; + otherwise, :code:`false`. + :type auto_renew: bool + :ivar ready_for_dns_record_management: :code:`true` if Azure can assign this + domain to App Service apps; otherwise, :code:`false`. This value will be + :code:`true` if domain registration status is active and + it is hosted on name servers Azure has programmatic access to. + :vartype ready_for_dns_record_management: bool + :ivar managed_host_names: All hostnames derived from the domain and assigned to Azure + resources. + :vartype managed_host_names: list[~azure.mgmt.web.v2020_06_01.models.HostName] + :param consent: Legal agreement consent. + :type consent: ~azure.mgmt.web.v2020_06_01.models.DomainPurchaseConsent + :ivar domain_not_renewable_reasons: Reasons why domain is not renewable. + :vartype domain_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2020_06_01.models.DomainPatchResourcePropertiesDomainNotRenewableReasonsItem] + :param dns_type: Current DNS type. Possible values include: "AzureDns", + "DefaultDomainRegistrarDns". + :type dns_type: str or ~azure.mgmt.web.v2020_06_01.models.DnsType + :param dns_zone_id: Azure DNS Zone to use. + :type dns_zone_id: str + :param target_dns_type: Target DNS type (would be used for migration). Possible values include: + "AzureDns", "DefaultDomainRegistrarDns". + :type target_dns_type: str or ~azure.mgmt.web.v2020_06_01.models.DnsType + :param auth_code: + :type auth_code: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'registration_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'name_servers': {'readonly': True}, + 'created_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'last_renewed_time': {'readonly': True}, + 'ready_for_dns_record_management': {'readonly': True}, + 'managed_host_names': {'readonly': True}, + 'domain_not_renewable_reasons': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'contact_admin': {'key': 'properties.contactAdmin', 'type': 'Contact'}, + 'contact_billing': {'key': 'properties.contactBilling', 'type': 'Contact'}, + 'contact_registrant': {'key': 'properties.contactRegistrant', 'type': 'Contact'}, + 'contact_tech': {'key': 'properties.contactTech', 'type': 'Contact'}, + 'registration_status': {'key': 'properties.registrationStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name_servers': {'key': 'properties.nameServers', 'type': '[str]'}, + 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'last_renewed_time': {'key': 'properties.lastRenewedTime', 'type': 'iso-8601'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'ready_for_dns_record_management': {'key': 'properties.readyForDnsRecordManagement', 'type': 'bool'}, + 'managed_host_names': {'key': 'properties.managedHostNames', 'type': '[HostName]'}, + 'consent': {'key': 'properties.consent', 'type': 'DomainPurchaseConsent'}, + 'domain_not_renewable_reasons': {'key': 'properties.domainNotRenewableReasons', 'type': '[str]'}, + 'dns_type': {'key': 'properties.dnsType', 'type': 'str'}, + 'dns_zone_id': {'key': 'properties.dnsZoneId', 'type': 'str'}, + 'target_dns_type': {'key': 'properties.targetDnsType', 'type': 'str'}, + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainPatchResource, self).__init__(**kwargs) + self.contact_admin = kwargs.get('contact_admin', None) + self.contact_billing = kwargs.get('contact_billing', None) + self.contact_registrant = kwargs.get('contact_registrant', None) + self.contact_tech = kwargs.get('contact_tech', None) + self.registration_status = None + self.provisioning_state = None + self.name_servers = None + self.privacy = kwargs.get('privacy', None) + self.created_time = None + self.expiration_time = None + self.last_renewed_time = None + self.auto_renew = kwargs.get('auto_renew', True) + self.ready_for_dns_record_management = None + self.managed_host_names = None + self.consent = kwargs.get('consent', None) + self.domain_not_renewable_reasons = None + self.dns_type = kwargs.get('dns_type', None) + self.dns_zone_id = kwargs.get('dns_zone_id', None) + self.target_dns_type = kwargs.get('target_dns_type', None) + self.auth_code = kwargs.get('auth_code', None) + + +class DomainPurchaseConsent(msrest.serialization.Model): + """Domain purchase consent object, representing acceptance of applicable legal agreements. + + :param agreement_keys: List of applicable legal agreement keys. This list can be retrieved + using ListLegalAgreements API under :code:`TopLevelDomain` resource. + :type agreement_keys: list[str] + :param agreed_by: Client IP address. + :type agreed_by: str + :param agreed_at: Timestamp when the agreements were accepted. + :type agreed_at: ~datetime.datetime + """ + + _attribute_map = { + 'agreement_keys': {'key': 'agreementKeys', 'type': '[str]'}, + 'agreed_by': {'key': 'agreedBy', 'type': 'str'}, + 'agreed_at': {'key': 'agreedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainPurchaseConsent, self).__init__(**kwargs) + self.agreement_keys = kwargs.get('agreement_keys', None) + self.agreed_by = kwargs.get('agreed_by', None) + self.agreed_at = kwargs.get('agreed_at', None) + + +class DomainRecommendationSearchParameters(msrest.serialization.Model): + """Domain recommendation search parameters. + + :param keywords: Keywords to be used for generating domain recommendations. + :type keywords: str + :param max_domain_recommendations: Maximum number of recommendations. + :type max_domain_recommendations: int + """ + + _attribute_map = { + 'keywords': {'key': 'keywords', 'type': 'str'}, + 'max_domain_recommendations': {'key': 'maxDomainRecommendations', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainRecommendationSearchParameters, self).__init__(**kwargs) + self.keywords = kwargs.get('keywords', None) + self.max_domain_recommendations = kwargs.get('max_domain_recommendations', None) + + +class EnabledConfig(msrest.serialization.Model): + """Enabled configuration. + + :param enabled: True if configuration is enabled, false if it is disabled and null if + configuration is not set. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(EnabledConfig, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + + +class EndpointDependency(msrest.serialization.Model): + """A domain name that a service is reached at, including details of the current connection status. + + :param domain_name: The domain name of the dependency. + :type domain_name: str + :param endpoint_details: The IP Addresses and Ports used when connecting to DomainName. + :type endpoint_details: list[~azure.mgmt.web.v2020_06_01.models.EndpointDetail] + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'endpoint_details': {'key': 'endpointDetails', 'type': '[EndpointDetail]'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointDependency, self).__init__(**kwargs) + self.domain_name = kwargs.get('domain_name', None) + self.endpoint_details = kwargs.get('endpoint_details', None) + + +class EndpointDetail(msrest.serialization.Model): + """Current TCP connectivity information from the App Service Environment to a single endpoint. + + :param ip_address: An IP Address that Domain Name currently resolves to. + :type ip_address: str + :param port: The port an endpoint is connected to. + :type port: int + :param latency: The time in milliseconds it takes for a TCP connection to be created from the + App Service Environment to this IpAddress at this Port. + :type latency: float + :param is_accessible: Whether it is possible to create a TCP connection from the App Service + Environment to this IpAddress at this Port. + :type is_accessible: bool + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'latency': {'key': 'latency', 'type': 'float'}, + 'is_accessible': {'key': 'isAccessible', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointDetail, self).__init__(**kwargs) + self.ip_address = kwargs.get('ip_address', None) + self.port = kwargs.get('port', None) + self.latency = kwargs.get('latency', None) + self.is_accessible = kwargs.get('is_accessible', None) + + +class ErrorEntity(msrest.serialization.Model): + """Body of the error response returned from the API. + + :param extended_code: Type of error. + :type extended_code: str + :param message_template: Message template. + :type message_template: str + :param parameters: Parameters for the template. + :type parameters: list[str] + :param inner_errors: Inner errors. + :type inner_errors: list[~azure.mgmt.web.v2020_06_01.models.ErrorEntity] + :param code: Basic error code. + :type code: str + :param message: Any details of the error. + :type message: str + """ + + _attribute_map = { + 'extended_code': {'key': 'extendedCode', 'type': 'str'}, + 'message_template': {'key': 'messageTemplate', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '[str]'}, + 'inner_errors': {'key': 'innerErrors', 'type': '[ErrorEntity]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorEntity, self).__init__(**kwargs) + self.extended_code = kwargs.get('extended_code', None) + self.message_template = kwargs.get('message_template', None) + self.parameters = kwargs.get('parameters', None) + self.inner_errors = kwargs.get('inner_errors', None) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class Experiments(msrest.serialization.Model): + """Routing rules in production experiments. + + :param ramp_up_rules: List of ramp-up rules. + :type ramp_up_rules: list[~azure.mgmt.web.v2020_06_01.models.RampUpRule] + """ + + _attribute_map = { + 'ramp_up_rules': {'key': 'rampUpRules', 'type': '[RampUpRule]'}, + } + + def __init__( + self, + **kwargs + ): + super(Experiments, self).__init__(**kwargs) + self.ramp_up_rules = kwargs.get('ramp_up_rules', None) + + +class Facebook(ProxyOnlyResource): + """Facebook. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_06_01.models.AppRegistration + :param graph_api_version: + :type graph_api_version: str + :param login: + :type login: ~azure.mgmt.web.v2020_06_01.models.LoginScopes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'AppRegistration'}, + 'graph_api_version': {'key': 'properties.graphApiVersion', 'type': 'str'}, + 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + } + + def __init__( + self, + **kwargs + ): + super(Facebook, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.registration = kwargs.get('registration', None) + self.graph_api_version = kwargs.get('graph_api_version', None) + self.login = kwargs.get('login', None) + + +class FileSystemApplicationLogsConfig(msrest.serialization.Model): + """Application logs to file system configuration. + + :param level: Log level. Possible values include: "Off", "Verbose", "Information", "Warning", + "Error". + :type level: str or ~azure.mgmt.web.v2020_06_01.models.LogLevel + """ + + _attribute_map = { + 'level': {'key': 'level', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FileSystemApplicationLogsConfig, self).__init__(**kwargs) + self.level = kwargs.get('level', None) + + +class FileSystemHttpLogsConfig(msrest.serialization.Model): + """Http logs to file system configuration. + + :param retention_in_mb: Maximum size in megabytes that http log files can use. + When reached old log files will be removed to make space for new ones. + Value can range between 25 and 100. + :type retention_in_mb: int + :param retention_in_days: Retention in days. + Remove files older than X days. + 0 or lower means no retention. + :type retention_in_days: int + :param enabled: True if configuration is enabled, false if it is disabled and null if + configuration is not set. + :type enabled: bool + """ + + _validation = { + 'retention_in_mb': {'maximum': 100, 'minimum': 25}, + } + + _attribute_map = { + 'retention_in_mb': {'key': 'retentionInMb', 'type': 'int'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(FileSystemHttpLogsConfig, self).__init__(**kwargs) + self.retention_in_mb = kwargs.get('retention_in_mb', None) + self.retention_in_days = kwargs.get('retention_in_days', None) + self.enabled = kwargs.get('enabled', None) + + +class FileSystemTokenStore(ProxyOnlyResource): + """FileSystemTokenStore. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param directory: + :type directory: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'directory': {'key': 'properties.directory', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FileSystemTokenStore, self).__init__(**kwargs) + self.directory = kwargs.get('directory', None) + + +class ForwardProxy(ProxyOnlyResource): + """ForwardProxy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param convention: Possible values include: "NoProxy", "Standard", "Custom". + :type convention: str or ~azure.mgmt.web.v2020_06_01.models.ForwardProxyConvention + :param custom_host_header_name: + :type custom_host_header_name: str + :param custom_proto_header_name: + :type custom_proto_header_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'convention': {'key': 'properties.convention', 'type': 'str'}, + 'custom_host_header_name': {'key': 'properties.customHostHeaderName', 'type': 'str'}, + 'custom_proto_header_name': {'key': 'properties.customProtoHeaderName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ForwardProxy, self).__init__(**kwargs) + self.convention = kwargs.get('convention', None) + self.custom_host_header_name = kwargs.get('custom_host_header_name', None) + self.custom_proto_header_name = kwargs.get('custom_proto_header_name', None) + + +class FunctionEnvelope(ProxyOnlyResource): + """Function information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param function_app_id: Function App ID. + :type function_app_id: str + :param script_root_path_href: Script root path URI. + :type script_root_path_href: str + :param script_href: Script URI. + :type script_href: str + :param config_href: Config URI. + :type config_href: str + :param test_data_href: Test data URI. + :type test_data_href: str + :param secrets_file_href: Secrets file URI. + :type secrets_file_href: str + :param href: Function URI. + :type href: str + :param config: Config information. + :type config: object + :param files: File list. + :type files: dict[str, str] + :param test_data: Test data used when testing via the Azure Portal. + :type test_data: str + :param invoke_url_template: The invocation URL. + :type invoke_url_template: str + :param language: The function language. + :type language: str + :param is_disabled: Gets or sets a value indicating whether the function is disabled. + :type is_disabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'function_app_id': {'key': 'properties.function_app_id', 'type': 'str'}, + 'script_root_path_href': {'key': 'properties.script_root_path_href', 'type': 'str'}, + 'script_href': {'key': 'properties.script_href', 'type': 'str'}, + 'config_href': {'key': 'properties.config_href', 'type': 'str'}, + 'test_data_href': {'key': 'properties.test_data_href', 'type': 'str'}, + 'secrets_file_href': {'key': 'properties.secrets_file_href', 'type': 'str'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'config': {'key': 'properties.config', 'type': 'object'}, + 'files': {'key': 'properties.files', 'type': '{str}'}, + 'test_data': {'key': 'properties.test_data', 'type': 'str'}, + 'invoke_url_template': {'key': 'properties.invoke_url_template', 'type': 'str'}, + 'language': {'key': 'properties.language', 'type': 'str'}, + 'is_disabled': {'key': 'properties.isDisabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(FunctionEnvelope, self).__init__(**kwargs) + self.function_app_id = kwargs.get('function_app_id', None) + self.script_root_path_href = kwargs.get('script_root_path_href', None) + self.script_href = kwargs.get('script_href', None) + self.config_href = kwargs.get('config_href', None) + self.test_data_href = kwargs.get('test_data_href', None) + self.secrets_file_href = kwargs.get('secrets_file_href', None) + self.href = kwargs.get('href', None) + self.config = kwargs.get('config', None) + self.files = kwargs.get('files', None) + self.test_data = kwargs.get('test_data', None) + self.invoke_url_template = kwargs.get('invoke_url_template', None) + self.language = kwargs.get('language', None) + self.is_disabled = kwargs.get('is_disabled', None) + + +class FunctionEnvelopeCollection(msrest.serialization.Model): + """Collection of Kudu function information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.FunctionEnvelope] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FunctionEnvelope]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FunctionEnvelopeCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class FunctionSecrets(msrest.serialization.Model): + """Function secrets. + + :param key: Secret key. + :type key: str + :param trigger_url: Trigger URL. + :type trigger_url: str + """ + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'trigger_url': {'key': 'trigger_url', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FunctionSecrets, self).__init__(**kwargs) + self.key = kwargs.get('key', None) + self.trigger_url = kwargs.get('trigger_url', None) + + +class GeoRegion(ProxyOnlyResource): + """Geographical region. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar description: Region description. + :vartype description: str + :ivar display_name: Display name for region. + :vartype display_name: str + :ivar org_domain: Display name for region. + :vartype org_domain: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'display_name': {'readonly': True}, + 'org_domain': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'org_domain': {'key': 'properties.orgDomain', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoRegion, self).__init__(**kwargs) + self.description = None + self.display_name = None + self.org_domain = None + + +class GeoRegionCollection(msrest.serialization.Model): + """Collection of geographical regions. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.GeoRegion] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GeoRegion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoRegionCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class GitHub(ProxyOnlyResource): + """GitHub. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_06_01.models.ClientRegistration + :param login: + :type login: ~azure.mgmt.web.v2020_06_01.models.LoginScopes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + } + + def __init__( + self, + **kwargs + ): + super(GitHub, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.registration = kwargs.get('registration', None) + self.login = kwargs.get('login', None) + + +class GlobalCsmSkuDescription(msrest.serialization.Model): + """A Global SKU Description. + + :param name: Name of the resource SKU. + :type name: str + :param tier: Service Tier of the resource SKU. + :type tier: str + :param size: Size specifier of the resource SKU. + :type size: str + :param family: Family code of the resource SKU. + :type family: str + :param capacity: Min, max, and default scale values of the SKU. + :type capacity: ~azure.mgmt.web.v2020_06_01.models.SkuCapacity + :param locations: Locations of the SKU. + :type locations: list[str] + :param capabilities: Capabilities of the SKU, e.g., is traffic manager enabled?. + :type capabilities: list[~azure.mgmt.web.v2020_06_01.models.Capability] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[Capability]'}, + } + + def __init__( + self, + **kwargs + ): + super(GlobalCsmSkuDescription, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.capacity = kwargs.get('capacity', None) + self.locations = kwargs.get('locations', None) + self.capabilities = kwargs.get('capabilities', None) + + +class GlobalValidation(ProxyOnlyResource): + """GlobalValidation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param require_authentication: + :type require_authentication: bool + :param unauthenticated_client_action: Possible values include: "RedirectToLoginPage", + "AllowAnonymous", "Return401", "Return403". + :type unauthenticated_client_action: str or + ~azure.mgmt.web.v2020_06_01.models.UnauthenticatedClientActionV2 + :param redirect_to_provider: + :type redirect_to_provider: str + :param excluded_paths: + :type excluded_paths: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'require_authentication': {'key': 'properties.requireAuthentication', 'type': 'bool'}, + 'unauthenticated_client_action': {'key': 'properties.unauthenticatedClientAction', 'type': 'str'}, + 'redirect_to_provider': {'key': 'properties.redirectToProvider', 'type': 'str'}, + 'excluded_paths': {'key': 'properties.excludedPaths', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(GlobalValidation, self).__init__(**kwargs) + self.require_authentication = kwargs.get('require_authentication', None) + self.unauthenticated_client_action = kwargs.get('unauthenticated_client_action', None) + self.redirect_to_provider = kwargs.get('redirect_to_provider', None) + self.excluded_paths = kwargs.get('excluded_paths', None) + + +class Google(ProxyOnlyResource): + """Google. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_06_01.models.ClientRegistration + :param login: + :type login: ~azure.mgmt.web.v2020_06_01.models.LoginScopes + :param validation: + :type validation: ~azure.mgmt.web.v2020_06_01.models.AllowedAudiencesValidation + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'validation': {'key': 'properties.validation', 'type': 'AllowedAudiencesValidation'}, + } + + def __init__( + self, + **kwargs + ): + super(Google, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.registration = kwargs.get('registration', None) + self.login = kwargs.get('login', None) + self.validation = kwargs.get('validation', None) + + +class HandlerMapping(msrest.serialization.Model): + """The IIS handler mappings used to define which handler processes HTTP requests with certain extension. +For example, it is used to configure php-cgi.exe process to handle all HTTP requests with *.php extension. + + :param extension: Requests with this extension will be handled using the specified FastCGI + application. + :type extension: str + :param script_processor: The absolute path to the FastCGI application. + :type script_processor: str + :param arguments: Command-line arguments to be passed to the script processor. + :type arguments: str + """ + + _attribute_map = { + 'extension': {'key': 'extension', 'type': 'str'}, + 'script_processor': {'key': 'scriptProcessor', 'type': 'str'}, + 'arguments': {'key': 'arguments', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HandlerMapping, self).__init__(**kwargs) + self.extension = kwargs.get('extension', None) + self.script_processor = kwargs.get('script_processor', None) + self.arguments = kwargs.get('arguments', None) + + +class HostingEnvironmentDeploymentInfo(msrest.serialization.Model): + """Information needed to create resources on an App Service Environment. + + :param name: Name of the App Service Environment. + :type name: str + :param location: Location of the App Service Environment. + :type location: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostingEnvironmentDeploymentInfo, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + + +class HostingEnvironmentDiagnostics(msrest.serialization.Model): + """Diagnostics for an App Service Environment. + + :param name: Name/identifier of the diagnostics. + :type name: str + :param diagnostics_output: Diagnostics output. + :type diagnostics_output: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'diagnostics_output': {'key': 'diagnosticsOutput', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostingEnvironmentDiagnostics, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.diagnostics_output = kwargs.get('diagnostics_output', None) + + +class HostingEnvironmentProfile(msrest.serialization.Model): + """Specification for an App Service Environment to use for this resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID of the App Service Environment. + :type id: str + :ivar name: Name of the App Service Environment. + :vartype name: str + :ivar type: Resource type of the App Service Environment. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostingEnvironmentProfile, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = None + self.type = None + + +class HostKeys(msrest.serialization.Model): + """Functions host level keys. + + :param master_key: Secret key. + :type master_key: str + :param function_keys: Host level function keys. + :type function_keys: dict[str, str] + :param system_keys: System keys. + :type system_keys: dict[str, str] + """ + + _attribute_map = { + 'master_key': {'key': 'masterKey', 'type': 'str'}, + 'function_keys': {'key': 'functionKeys', 'type': '{str}'}, + 'system_keys': {'key': 'systemKeys', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(HostKeys, self).__init__(**kwargs) + self.master_key = kwargs.get('master_key', None) + self.function_keys = kwargs.get('function_keys', None) + self.system_keys = kwargs.get('system_keys', None) + + +class HostName(msrest.serialization.Model): + """Details of a hostname derived from a domain. + + :param name: Name of the hostname. + :type name: str + :param site_names: List of apps the hostname is assigned to. This list will have more than one + app only if the hostname is pointing to a Traffic Manager. + :type site_names: list[str] + :param azure_resource_name: Name of the Azure resource the hostname is assigned to. If it is + assigned to a Traffic Manager then it will be the Traffic Manager name otherwise it will be the + app name. + :type azure_resource_name: str + :param azure_resource_type: Type of the Azure resource the hostname is assigned to. Possible + values include: "Website", "TrafficManager". + :type azure_resource_type: str or ~azure.mgmt.web.v2020_06_01.models.AzureResourceType + :param custom_host_name_dns_record_type: Type of the DNS record. Possible values include: + "CName", "A". + :type custom_host_name_dns_record_type: str or + ~azure.mgmt.web.v2020_06_01.models.CustomHostNameDnsRecordType + :param host_name_type: Type of the hostname. Possible values include: "Verified", "Managed". + :type host_name_type: str or ~azure.mgmt.web.v2020_06_01.models.HostNameType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'site_names': {'key': 'siteNames', 'type': '[str]'}, + 'azure_resource_name': {'key': 'azureResourceName', 'type': 'str'}, + 'azure_resource_type': {'key': 'azureResourceType', 'type': 'str'}, + 'custom_host_name_dns_record_type': {'key': 'customHostNameDnsRecordType', 'type': 'str'}, + 'host_name_type': {'key': 'hostNameType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostName, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.site_names = kwargs.get('site_names', None) + self.azure_resource_name = kwargs.get('azure_resource_name', None) + self.azure_resource_type = kwargs.get('azure_resource_type', None) + self.custom_host_name_dns_record_type = kwargs.get('custom_host_name_dns_record_type', None) + self.host_name_type = kwargs.get('host_name_type', None) + + +class HostNameBinding(ProxyOnlyResource): + """A hostname binding object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param site_name: App Service app name. + :type site_name: str + :param domain_id: Fully qualified ARM domain resource URI. + :type domain_id: str + :param azure_resource_name: Azure resource name. + :type azure_resource_name: str + :param azure_resource_type: Azure resource type. Possible values include: "Website", + "TrafficManager". + :type azure_resource_type: str or ~azure.mgmt.web.v2020_06_01.models.AzureResourceType + :param custom_host_name_dns_record_type: Custom DNS record type. Possible values include: + "CName", "A". + :type custom_host_name_dns_record_type: str or + ~azure.mgmt.web.v2020_06_01.models.CustomHostNameDnsRecordType + :param host_name_type: Hostname type. Possible values include: "Verified", "Managed". + :type host_name_type: str or ~azure.mgmt.web.v2020_06_01.models.HostNameType + :param ssl_state: SSL type. Possible values include: "Disabled", "SniEnabled", + "IpBasedEnabled". + :type ssl_state: str or ~azure.mgmt.web.v2020_06_01.models.SslState + :param thumbprint: SSL certificate thumbprint. + :type thumbprint: str + :ivar virtual_ip: Virtual IP address assigned to the hostname if IP based SSL is enabled. + :vartype virtual_ip: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_ip': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'domain_id': {'key': 'properties.domainId', 'type': 'str'}, + 'azure_resource_name': {'key': 'properties.azureResourceName', 'type': 'str'}, + 'azure_resource_type': {'key': 'properties.azureResourceType', 'type': 'str'}, + 'custom_host_name_dns_record_type': {'key': 'properties.customHostNameDnsRecordType', 'type': 'str'}, + 'host_name_type': {'key': 'properties.hostNameType', 'type': 'str'}, + 'ssl_state': {'key': 'properties.sslState', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'virtual_ip': {'key': 'properties.virtualIP', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostNameBinding, self).__init__(**kwargs) + self.site_name = kwargs.get('site_name', None) + self.domain_id = kwargs.get('domain_id', None) + self.azure_resource_name = kwargs.get('azure_resource_name', None) + self.azure_resource_type = kwargs.get('azure_resource_type', None) + self.custom_host_name_dns_record_type = kwargs.get('custom_host_name_dns_record_type', None) + self.host_name_type = kwargs.get('host_name_type', None) + self.ssl_state = kwargs.get('ssl_state', None) + self.thumbprint = kwargs.get('thumbprint', None) + self.virtual_ip = None + + +class HostNameBindingCollection(msrest.serialization.Model): + """Collection of hostname bindings. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.HostNameBinding] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HostNameBinding]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostNameBindingCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class HostNameSslState(msrest.serialization.Model): + """SSL-enabled hostname. + + :param name: Hostname. + :type name: str + :param ssl_state: SSL type. Possible values include: "Disabled", "SniEnabled", + "IpBasedEnabled". + :type ssl_state: str or ~azure.mgmt.web.v2020_06_01.models.SslState + :param virtual_ip: Virtual IP address assigned to the hostname if IP based SSL is enabled. + :type virtual_ip: str + :param thumbprint: SSL certificate thumbprint. + :type thumbprint: str + :param to_update: Set to :code:`true` to update existing hostname. + :type to_update: bool + :param host_type: Indicates whether the hostname is a standard or repository hostname. Possible + values include: "Standard", "Repository". + :type host_type: str or ~azure.mgmt.web.v2020_06_01.models.HostType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'ssl_state': {'key': 'sslState', 'type': 'str'}, + 'virtual_ip': {'key': 'virtualIP', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'to_update': {'key': 'toUpdate', 'type': 'bool'}, + 'host_type': {'key': 'hostType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostNameSslState, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.ssl_state = kwargs.get('ssl_state', None) + self.virtual_ip = kwargs.get('virtual_ip', None) + self.thumbprint = kwargs.get('thumbprint', None) + self.to_update = kwargs.get('to_update', None) + self.host_type = kwargs.get('host_type', None) + + +class HttpLogsConfig(msrest.serialization.Model): + """Http logs configuration. + + :param file_system: Http logs to file system configuration. + :type file_system: ~azure.mgmt.web.v2020_06_01.models.FileSystemHttpLogsConfig + :param azure_blob_storage: Http logs to azure blob storage configuration. + :type azure_blob_storage: ~azure.mgmt.web.v2020_06_01.models.AzureBlobStorageHttpLogsConfig + """ + + _attribute_map = { + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemHttpLogsConfig'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'AzureBlobStorageHttpLogsConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(HttpLogsConfig, self).__init__(**kwargs) + self.file_system = kwargs.get('file_system', None) + self.azure_blob_storage = kwargs.get('azure_blob_storage', None) + + +class HttpSettings(ProxyOnlyResource): + """HttpSettings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param require_https: + :type require_https: bool + :param routes: + :type routes: ~azure.mgmt.web.v2020_06_01.models.HttpSettingsRoutes + :param forward_proxy: + :type forward_proxy: ~azure.mgmt.web.v2020_06_01.models.ForwardProxy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'require_https': {'key': 'properties.requireHttps', 'type': 'bool'}, + 'routes': {'key': 'properties.routes', 'type': 'HttpSettingsRoutes'}, + 'forward_proxy': {'key': 'properties.forwardProxy', 'type': 'ForwardProxy'}, + } + + def __init__( + self, + **kwargs + ): + super(HttpSettings, self).__init__(**kwargs) + self.require_https = kwargs.get('require_https', None) + self.routes = kwargs.get('routes', None) + self.forward_proxy = kwargs.get('forward_proxy', None) + + +class HttpSettingsRoutes(ProxyOnlyResource): + """HttpSettingsRoutes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param api_prefix: + :type api_prefix: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'api_prefix': {'key': 'properties.apiPrefix', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HttpSettingsRoutes, self).__init__(**kwargs) + self.api_prefix = kwargs.get('api_prefix', None) + + +class HybridConnection(ProxyOnlyResource): + """Hybrid Connection contract. This is used to configure a Hybrid Connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param service_bus_namespace: The name of the Service Bus namespace. + :type service_bus_namespace: str + :param relay_name: The name of the Service Bus relay. + :type relay_name: str + :param relay_arm_uri: The ARM URI to the Service Bus relay. + :type relay_arm_uri: str + :param hostname: The hostname of the endpoint. + :type hostname: str + :param port: The port of the endpoint. + :type port: int + :param send_key_name: The name of the Service Bus key which has Send permissions. This is used + to authenticate to Service Bus. + :type send_key_name: str + :param send_key_value: The value of the Service Bus key. This is used to authenticate to + Service Bus. In ARM this key will not be returned + normally, use the POST /listKeys API instead. + :type send_key_value: str + :param service_bus_suffix: The suffix for the service bus endpoint. By default this is + .servicebus.windows.net. + :type service_bus_suffix: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'service_bus_namespace': {'key': 'properties.serviceBusNamespace', 'type': 'str'}, + 'relay_name': {'key': 'properties.relayName', 'type': 'str'}, + 'relay_arm_uri': {'key': 'properties.relayArmUri', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'send_key_name': {'key': 'properties.sendKeyName', 'type': 'str'}, + 'send_key_value': {'key': 'properties.sendKeyValue', 'type': 'str'}, + 'service_bus_suffix': {'key': 'properties.serviceBusSuffix', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridConnection, self).__init__(**kwargs) + self.service_bus_namespace = kwargs.get('service_bus_namespace', None) + self.relay_name = kwargs.get('relay_name', None) + self.relay_arm_uri = kwargs.get('relay_arm_uri', None) + self.hostname = kwargs.get('hostname', None) + self.port = kwargs.get('port', None) + self.send_key_name = kwargs.get('send_key_name', None) + self.send_key_value = kwargs.get('send_key_value', None) + self.service_bus_suffix = kwargs.get('service_bus_suffix', None) + + +class HybridConnectionCollection(msrest.serialization.Model): + """Collection of hostname bindings. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.HybridConnection] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HybridConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridConnectionCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class HybridConnectionKey(ProxyOnlyResource): + """Hybrid Connection key contract. This has the send key name and value for a Hybrid Connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar send_key_name: The name of the send key. + :vartype send_key_name: str + :ivar send_key_value: The value of the send key. + :vartype send_key_value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'send_key_name': {'readonly': True}, + 'send_key_value': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'send_key_name': {'key': 'properties.sendKeyName', 'type': 'str'}, + 'send_key_value': {'key': 'properties.sendKeyValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridConnectionKey, self).__init__(**kwargs) + self.send_key_name = None + self.send_key_value = None + + +class HybridConnectionLimits(ProxyOnlyResource): + """Hybrid Connection limits contract. This is used to return the plan limits of Hybrid Connections. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar current: The current number of Hybrid Connections. + :vartype current: int + :ivar maximum: The maximum number of Hybrid Connections allowed. + :vartype maximum: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'current': {'readonly': True}, + 'maximum': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'current': {'key': 'properties.current', 'type': 'int'}, + 'maximum': {'key': 'properties.maximum', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridConnectionLimits, self).__init__(**kwargs) + self.current = None + self.maximum = None + + +class Identifier(ProxyOnlyResource): + """A domain specific resource identifier. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param value: String representation of the identity. + :type value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'properties.id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Identifier, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class IdentifierCollection(msrest.serialization.Model): + """Collection of identifiers. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.Identifier] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Identifier]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IdentifierCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class IdentityProviders(ProxyOnlyResource): + """IdentityProviders. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param azure_active_directory: + :type azure_active_directory: ~azure.mgmt.web.v2020_06_01.models.AzureActiveDirectory + :param facebook: + :type facebook: ~azure.mgmt.web.v2020_06_01.models.Facebook + :param git_hub: + :type git_hub: ~azure.mgmt.web.v2020_06_01.models.GitHub + :param google: + :type google: ~azure.mgmt.web.v2020_06_01.models.Google + :param twitter: + :type twitter: ~azure.mgmt.web.v2020_06_01.models.Twitter + :param custom_open_id_connect_providers: Dictionary of :code:``. + :type custom_open_id_connect_providers: dict[str, + ~azure.mgmt.web.v2020_06_01.models.CustomOpenIdConnectProvider] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'azure_active_directory': {'key': 'properties.azureActiveDirectory', 'type': 'AzureActiveDirectory'}, + 'facebook': {'key': 'properties.facebook', 'type': 'Facebook'}, + 'git_hub': {'key': 'properties.gitHub', 'type': 'GitHub'}, + 'google': {'key': 'properties.google', 'type': 'Google'}, + 'twitter': {'key': 'properties.twitter', 'type': 'Twitter'}, + 'custom_open_id_connect_providers': {'key': 'properties.customOpenIdConnectProviders', 'type': '{CustomOpenIdConnectProvider}'}, + } + + def __init__( + self, + **kwargs + ): + super(IdentityProviders, self).__init__(**kwargs) + self.azure_active_directory = kwargs.get('azure_active_directory', None) + self.facebook = kwargs.get('facebook', None) + self.git_hub = kwargs.get('git_hub', None) + self.google = kwargs.get('google', None) + self.twitter = kwargs.get('twitter', None) + self.custom_open_id_connect_providers = kwargs.get('custom_open_id_connect_providers', None) + + +class InboundEnvironmentEndpoint(msrest.serialization.Model): + """The IP Addresses and Ports that require inbound network access to and within the subnet of the App Service Environment. + + :param description: Short text describing the purpose of the network traffic. + :type description: str + :param endpoints: The IP addresses that network traffic will originate from in cidr notation. + :type endpoints: list[str] + :param ports: The ports that network traffic will arrive to the App Service Environment at. + :type ports: list[str] + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[str]'}, + 'ports': {'key': 'ports', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(InboundEnvironmentEndpoint, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.endpoints = kwargs.get('endpoints', None) + self.ports = kwargs.get('ports', None) + + +class InboundEnvironmentEndpointCollection(msrest.serialization.Model): + """Collection of Inbound Environment Endpoints. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.InboundEnvironmentEndpoint] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InboundEnvironmentEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(InboundEnvironmentEndpointCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class IpSecurityRestriction(msrest.serialization.Model): + """IP security restriction on an app. + + :param ip_address: IP address the security restriction is valid for. + It can be in form of pure ipv4 address (required SubnetMask property) or + CIDR notation such as ipv4/mask (leading bit match). For CIDR, + SubnetMask property must not be specified. + :type ip_address: str + :param subnet_mask: Subnet mask for the range of IP addresses the restriction is valid for. + :type subnet_mask: str + :param vnet_subnet_resource_id: Virtual network resource id. + :type vnet_subnet_resource_id: str + :param vnet_traffic_tag: (internal) Vnet traffic tag. + :type vnet_traffic_tag: int + :param subnet_traffic_tag: (internal) Subnet traffic tag. + :type subnet_traffic_tag: int + :param action: Allow or Deny access for this IP range. + :type action: str + :param tag: Defines what this IP filter will be used for. This is to support IP filtering on + proxies. Possible values include: "Default", "XffProxy", "ServiceTag". + :type tag: str or ~azure.mgmt.web.v2020_06_01.models.IpFilterTag + :param priority: Priority of IP restriction rule. + :type priority: int + :param name: IP restriction rule name. + :type name: str + :param description: IP restriction rule description. + :type description: str + :param headers: IP restriction rule headers. + X-Forwarded-Host (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded- + Host#Examples). + The matching logic is .. + + + * If the property is null or empty (default), all hosts(or lack of) are allowed. + * A value is compared using ordinal-ignore-case (excluding port number). + * Subdomain wildcards are permitted but don't match the root domain. For example, + *.contoso.com matches the subdomain foo.contoso.com + but not the root domain contoso.com or multi-level foo.bar.contoso.com + * Unicode host names are allowed but are converted to Punycode for matching. + + X-Forwarded-For (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded- + For#Examples). + The matching logic is .. + + + * If the property is null or empty (default), any forwarded-for chains (or lack of) are + allowed. + * If any address (excluding port number) in the chain (comma separated) matches the CIDR + defined by the property. + + X-Azure-FDID and X-FD-HealthProbe. + The matching logic is exact match. + :type headers: dict[str, list[str]] + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet_mask': {'key': 'subnetMask', 'type': 'str'}, + 'vnet_subnet_resource_id': {'key': 'vnetSubnetResourceId', 'type': 'str'}, + 'vnet_traffic_tag': {'key': 'vnetTrafficTag', 'type': 'int'}, + 'subnet_traffic_tag': {'key': 'subnetTrafficTag', 'type': 'int'}, + 'action': {'key': 'action', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '{[str]}'}, + } + + def __init__( + self, + **kwargs + ): + super(IpSecurityRestriction, self).__init__(**kwargs) + self.ip_address = kwargs.get('ip_address', None) + self.subnet_mask = kwargs.get('subnet_mask', None) + self.vnet_subnet_resource_id = kwargs.get('vnet_subnet_resource_id', None) + self.vnet_traffic_tag = kwargs.get('vnet_traffic_tag', None) + self.subnet_traffic_tag = kwargs.get('subnet_traffic_tag', None) + self.action = kwargs.get('action', None) + self.tag = kwargs.get('tag', None) + self.priority = kwargs.get('priority', None) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.headers = kwargs.get('headers', None) + + +class JwtClaimChecks(ProxyOnlyResource): + """JwtClaimChecks. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param allowed_groups: + :type allowed_groups: list[str] + :param allowed_client_applications: + :type allowed_client_applications: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'allowed_groups': {'key': 'properties.allowedGroups', 'type': '[str]'}, + 'allowed_client_applications': {'key': 'properties.allowedClientApplications', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(JwtClaimChecks, self).__init__(**kwargs) + self.allowed_groups = kwargs.get('allowed_groups', None) + self.allowed_client_applications = kwargs.get('allowed_client_applications', None) + + +class KeyInfo(msrest.serialization.Model): + """Function key info. + + :param name: Key name. + :type name: str + :param value: Key value. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyInfo, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class LocalizableString(msrest.serialization.Model): + """Localizable string object containing the name and a localized value. + + :param value: Non-localized name. + :type value: str + :param localized_value: Localized name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LocalizableString, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) + + +class Login(ProxyOnlyResource): + """Login. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param routes: + :type routes: ~azure.mgmt.web.v2020_06_01.models.LoginRoutes + :param token_store: + :type token_store: ~azure.mgmt.web.v2020_06_01.models.TokenStore + :param preserve_url_fragments_for_logins: + :type preserve_url_fragments_for_logins: bool + :param allowed_external_redirect_urls: + :type allowed_external_redirect_urls: list[str] + :param cookie_expiration: + :type cookie_expiration: ~azure.mgmt.web.v2020_06_01.models.CookieExpiration + :param nonce: + :type nonce: ~azure.mgmt.web.v2020_06_01.models.Nonce + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'routes': {'key': 'properties.routes', 'type': 'LoginRoutes'}, + 'token_store': {'key': 'properties.tokenStore', 'type': 'TokenStore'}, + 'preserve_url_fragments_for_logins': {'key': 'properties.preserveUrlFragmentsForLogins', 'type': 'bool'}, + 'allowed_external_redirect_urls': {'key': 'properties.allowedExternalRedirectUrls', 'type': '[str]'}, + 'cookie_expiration': {'key': 'properties.cookieExpiration', 'type': 'CookieExpiration'}, + 'nonce': {'key': 'properties.nonce', 'type': 'Nonce'}, + } + + def __init__( + self, + **kwargs + ): + super(Login, self).__init__(**kwargs) + self.routes = kwargs.get('routes', None) + self.token_store = kwargs.get('token_store', None) + self.preserve_url_fragments_for_logins = kwargs.get('preserve_url_fragments_for_logins', None) + self.allowed_external_redirect_urls = kwargs.get('allowed_external_redirect_urls', None) + self.cookie_expiration = kwargs.get('cookie_expiration', None) + self.nonce = kwargs.get('nonce', None) + + +class LoginRoutes(ProxyOnlyResource): + """LoginRoutes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param logout_endpoint: + :type logout_endpoint: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'logout_endpoint': {'key': 'properties.logoutEndpoint', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoginRoutes, self).__init__(**kwargs) + self.logout_endpoint = kwargs.get('logout_endpoint', None) + + +class LoginScopes(ProxyOnlyResource): + """LoginScopes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param scopes: + :type scopes: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(LoginScopes, self).__init__(**kwargs) + self.scopes = kwargs.get('scopes', None) + + +class LogSpecification(msrest.serialization.Model): + """Log Definition of a single resource metric. + + :param name: + :type name: str + :param display_name: + :type display_name: str + :param blob_duration: + :type blob_duration: str + :param log_filter_pattern: + :type log_filter_pattern: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + 'log_filter_pattern': {'key': 'logFilterPattern', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LogSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.blob_duration = kwargs.get('blob_duration', None) + self.log_filter_pattern = kwargs.get('log_filter_pattern', None) + + +class ManagedServiceIdentity(msrest.serialization.Model): + """Managed service identity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Type of managed service identity. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type: str or ~azure.mgmt.web.v2020_06_01.models.ManagedServiceIdentityType + :ivar tenant_id: Tenant of managed service identity. + :vartype tenant_id: str + :ivar principal_id: Principal Id of managed service identity. + :vartype principal_id: str + :param user_assigned_identities: The list of user assigned identities associated with the + resource. The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + :type user_assigned_identities: dict[str, + ~azure.mgmt.web.v2020_06_01.models.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties] + """ + + _validation = { + 'tenant_id': {'readonly': True}, + 'principal_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedServiceIdentity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.tenant_id = None + self.principal_id = None + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class MetricAvailability(msrest.serialization.Model): + """Retention policy of a resource metric. + + :param time_grain: + :type time_grain: str + :param blob_duration: + :type blob_duration: str + """ + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricAvailability, self).__init__(**kwargs) + self.time_grain = kwargs.get('time_grain', None) + self.blob_duration = kwargs.get('blob_duration', None) + + +class MetricSpecification(msrest.serialization.Model): + """Definition of a single resource metric. + + :param name: + :type name: str + :param display_name: + :type display_name: str + :param display_description: + :type display_description: str + :param unit: + :type unit: str + :param aggregation_type: + :type aggregation_type: str + :param supports_instance_level_aggregation: + :type supports_instance_level_aggregation: bool + :param enable_regional_mdm_account: + :type enable_regional_mdm_account: bool + :param source_mdm_account: + :type source_mdm_account: str + :param source_mdm_namespace: + :type source_mdm_namespace: str + :param metric_filter_pattern: + :type metric_filter_pattern: str + :param fill_gap_with_zero: + :type fill_gap_with_zero: bool + :param is_internal: + :type is_internal: bool + :param dimensions: + :type dimensions: list[~azure.mgmt.web.v2020_06_01.models.Dimension] + :param category: + :type category: str + :param availabilities: + :type availabilities: list[~azure.mgmt.web.v2020_06_01.models.MetricAvailability] + :param supported_time_grain_types: + :type supported_time_grain_types: list[str] + :param supported_aggregation_types: + :type supported_aggregation_types: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'supports_instance_level_aggregation': {'key': 'supportsInstanceLevelAggregation', 'type': 'bool'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'bool'}, + 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'metric_filter_pattern': {'key': 'metricFilterPattern', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'is_internal': {'key': 'isInternal', 'type': 'bool'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'category': {'key': 'category', 'type': 'str'}, + 'availabilities': {'key': 'availabilities', 'type': '[MetricAvailability]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.supports_instance_level_aggregation = kwargs.get('supports_instance_level_aggregation', None) + self.enable_regional_mdm_account = kwargs.get('enable_regional_mdm_account', None) + self.source_mdm_account = kwargs.get('source_mdm_account', None) + self.source_mdm_namespace = kwargs.get('source_mdm_namespace', None) + self.metric_filter_pattern = kwargs.get('metric_filter_pattern', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.is_internal = kwargs.get('is_internal', None) + self.dimensions = kwargs.get('dimensions', None) + self.category = kwargs.get('category', None) + self.availabilities = kwargs.get('availabilities', None) + self.supported_time_grain_types = kwargs.get('supported_time_grain_types', None) + self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) + + +class MigrateMySqlRequest(ProxyOnlyResource): + """MySQL migration request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param connection_string: Connection string to the remote MySQL database. + :type connection_string: str + :param migration_type: The type of migration operation to be done. Possible values include: + "LocalToRemote", "RemoteToLocal". + :type migration_type: str or ~azure.mgmt.web.v2020_06_01.models.MySqlMigrationType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'migration_type': {'key': 'properties.migrationType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MigrateMySqlRequest, self).__init__(**kwargs) + self.connection_string = kwargs.get('connection_string', None) + self.migration_type = kwargs.get('migration_type', None) + + +class MigrateMySqlStatus(ProxyOnlyResource): + """MySQL migration status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar migration_operation_status: Status of the migration task. Possible values include: + "InProgress", "Failed", "Succeeded", "TimedOut", "Created". + :vartype migration_operation_status: str or ~azure.mgmt.web.v2020_06_01.models.OperationStatus + :ivar operation_id: Operation ID for the migration task. + :vartype operation_id: str + :ivar local_my_sql_enabled: True if the web app has in app MySql enabled. + :vartype local_my_sql_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'migration_operation_status': {'readonly': True}, + 'operation_id': {'readonly': True}, + 'local_my_sql_enabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'migration_operation_status': {'key': 'properties.migrationOperationStatus', 'type': 'str'}, + 'operation_id': {'key': 'properties.operationId', 'type': 'str'}, + 'local_my_sql_enabled': {'key': 'properties.localMySqlEnabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(MigrateMySqlStatus, self).__init__(**kwargs) + self.migration_operation_status = None + self.operation_id = None + self.local_my_sql_enabled = None + + +class MSDeploy(ProxyOnlyResource): + """MSDeploy ARM PUT information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param package_uri: Package URI. + :type package_uri: str + :param connection_string: SQL Connection String. + :type connection_string: str + :param db_type: Database Type. + :type db_type: str + :param set_parameters_xml_file_uri: URI of MSDeploy Parameters file. Must not be set if + SetParameters is used. + :type set_parameters_xml_file_uri: str + :param set_parameters: MSDeploy Parameters. Must not be set if SetParametersXmlFileUri is used. + :type set_parameters: dict[str, str] + :param skip_app_data: Controls whether the MSDeploy operation skips the App_Data directory. + If set to :code:`true`, the existing App_Data directory on the destination + will not be deleted, and any App_Data directory in the source will be ignored. + Setting is :code:`false` by default. + :type skip_app_data: bool + :param app_offline: Sets the AppOffline rule while the MSDeploy operation executes. + Setting is :code:`false` by default. + :type app_offline: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'package_uri': {'key': 'properties.packageUri', 'type': 'str'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'db_type': {'key': 'properties.dbType', 'type': 'str'}, + 'set_parameters_xml_file_uri': {'key': 'properties.setParametersXmlFileUri', 'type': 'str'}, + 'set_parameters': {'key': 'properties.setParameters', 'type': '{str}'}, + 'skip_app_data': {'key': 'properties.skipAppData', 'type': 'bool'}, + 'app_offline': {'key': 'properties.appOffline', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(MSDeploy, self).__init__(**kwargs) + self.package_uri = kwargs.get('package_uri', None) + self.connection_string = kwargs.get('connection_string', None) + self.db_type = kwargs.get('db_type', None) + self.set_parameters_xml_file_uri = kwargs.get('set_parameters_xml_file_uri', None) + self.set_parameters = kwargs.get('set_parameters', None) + self.skip_app_data = kwargs.get('skip_app_data', None) + self.app_offline = kwargs.get('app_offline', None) + + +class MSDeployLog(ProxyOnlyResource): + """MSDeploy log. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar entries: List of log entry messages. + :vartype entries: list[~azure.mgmt.web.v2020_06_01.models.MSDeployLogEntry] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'entries': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'entries': {'key': 'properties.entries', 'type': '[MSDeployLogEntry]'}, + } + + def __init__( + self, + **kwargs + ): + super(MSDeployLog, self).__init__(**kwargs) + self.entries = None + + +class MSDeployLogEntry(msrest.serialization.Model): + """MSDeploy log entry. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar time: Timestamp of log entry. + :vartype time: ~datetime.datetime + :ivar type: Log entry type. Possible values include: "Message", "Warning", "Error". + :vartype type: str or ~azure.mgmt.web.v2020_06_01.models.MSDeployLogEntryType + :ivar message: Log entry message. + :vartype message: str + """ + + _validation = { + 'time': {'readonly': True}, + 'type': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MSDeployLogEntry, self).__init__(**kwargs) + self.time = None + self.type = None + self.message = None + + +class MSDeployStatus(ProxyOnlyResource): + """MSDeploy ARM response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar deployer: Username of deployer. + :vartype deployer: str + :ivar provisioning_state: Provisioning state. Possible values include: "accepted", "running", + "succeeded", "failed", "canceled". + :vartype provisioning_state: str or + ~azure.mgmt.web.v2020_06_01.models.MSDeployProvisioningState + :ivar start_time: Start time of deploy operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: End time of deploy operation. + :vartype end_time: ~datetime.datetime + :ivar complete: Whether the deployment operation has completed. + :vartype complete: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'deployer': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'complete': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'deployer': {'key': 'properties.deployer', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'complete': {'key': 'properties.complete', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(MSDeployStatus, self).__init__(**kwargs) + self.deployer = None + self.provisioning_state = None + self.start_time = None + self.end_time = None + self.complete = None + + +class NameIdentifier(msrest.serialization.Model): + """Identifies an object. + + :param name: Name of the object. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NameIdentifier, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class NameIdentifierCollection(msrest.serialization.Model): + """Collection of domain name identifiers. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.NameIdentifier] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NameIdentifier]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NameIdentifierCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class NameValuePair(msrest.serialization.Model): + """Name value pair. + + :param name: Pair name. + :type name: str + :param value: Pair value. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NameValuePair, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class NetworkAccessControlEntry(msrest.serialization.Model): + """Network access control entry. + + :param action: Action object. Possible values include: "Permit", "Deny". + :type action: str or ~azure.mgmt.web.v2020_06_01.models.AccessControlEntryAction + :param description: Description of network access control entry. + :type description: str + :param order: Order of precedence. + :type order: int + :param remote_subnet: Remote subnet. + :type remote_subnet: str + """ + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'int'}, + 'remote_subnet': {'key': 'remoteSubnet', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkAccessControlEntry, self).__init__(**kwargs) + self.action = kwargs.get('action', None) + self.description = kwargs.get('description', None) + self.order = kwargs.get('order', None) + self.remote_subnet = kwargs.get('remote_subnet', None) + + +class NetworkFeatures(ProxyOnlyResource): + """Full view of network features for an app (presently VNET integration and Hybrid Connections). + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar virtual_network_name: The Virtual Network name. + :vartype virtual_network_name: str + :ivar virtual_network_connection: The Virtual Network summary view. + :vartype virtual_network_connection: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :ivar hybrid_connections: The Hybrid Connections summary view. + :vartype hybrid_connections: + list[~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity] + :ivar hybrid_connections_v2: The Hybrid Connection V2 (Service Bus) view. + :vartype hybrid_connections_v2: list[~azure.mgmt.web.v2020_06_01.models.HybridConnection] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_name': {'readonly': True}, + 'virtual_network_connection': {'readonly': True}, + 'hybrid_connections': {'readonly': True}, + 'hybrid_connections_v2': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'virtual_network_name': {'key': 'properties.virtualNetworkName', 'type': 'str'}, + 'virtual_network_connection': {'key': 'properties.virtualNetworkConnection', 'type': 'VnetInfo'}, + 'hybrid_connections': {'key': 'properties.hybridConnections', 'type': '[RelayServiceConnectionEntity]'}, + 'hybrid_connections_v2': {'key': 'properties.hybridConnectionsV2', 'type': '[HybridConnection]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkFeatures, self).__init__(**kwargs) + self.virtual_network_name = None + self.virtual_network_connection = None + self.hybrid_connections = None + self.hybrid_connections_v2 = None + + +class NetworkTrace(msrest.serialization.Model): + """Network trace. + + :param path: Local file path for the captured network trace file. + :type path: str + :param status: Current status of the network trace operation, same as Operation.Status + (InProgress/Succeeded/Failed). + :type status: str + :param message: Detailed message of a network trace operation, e.g. error message in case of + failure. + :type message: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkTrace, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.status = kwargs.get('status', None) + self.message = kwargs.get('message', None) + + +class Nonce(ProxyOnlyResource): + """Nonce. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param validate_nonce: + :type validate_nonce: bool + :param nonce_expiration_interval: + :type nonce_expiration_interval: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'validate_nonce': {'key': 'properties.validateNonce', 'type': 'bool'}, + 'nonce_expiration_interval': {'key': 'properties.nonceExpirationInterval', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Nonce, self).__init__(**kwargs) + self.validate_nonce = kwargs.get('validate_nonce', None) + self.nonce_expiration_interval = kwargs.get('nonce_expiration_interval', None) + + +class OpenIdConnectClientCredential(ProxyOnlyResource): + """OpenIdConnectClientCredential. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar method: Default value: "ClientSecretPost". + :vartype method: str + :param client_secret_setting_name: + :type client_secret_setting_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'method': {'constant': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'method': {'key': 'properties.method', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + } + + method = "ClientSecretPost" + + def __init__( + self, + **kwargs + ): + super(OpenIdConnectClientCredential, self).__init__(**kwargs) + self.client_secret_setting_name = kwargs.get('client_secret_setting_name', None) + + +class OpenIdConnectConfig(ProxyOnlyResource): + """OpenIdConnectConfig. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param authorization_endpoint: + :type authorization_endpoint: str + :param token_endpoint: + :type token_endpoint: str + :param issuer: + :type issuer: str + :param certification_uri: + :type certification_uri: str + :param well_known_open_id_configuration: + :type well_known_open_id_configuration: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'authorization_endpoint': {'key': 'properties.authorizationEndpoint', 'type': 'str'}, + 'token_endpoint': {'key': 'properties.tokenEndpoint', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'certification_uri': {'key': 'properties.certificationUri', 'type': 'str'}, + 'well_known_open_id_configuration': {'key': 'properties.wellKnownOpenIdConfiguration', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OpenIdConnectConfig, self).__init__(**kwargs) + self.authorization_endpoint = kwargs.get('authorization_endpoint', None) + self.token_endpoint = kwargs.get('token_endpoint', None) + self.issuer = kwargs.get('issuer', None) + self.certification_uri = kwargs.get('certification_uri', None) + self.well_known_open_id_configuration = kwargs.get('well_known_open_id_configuration', None) + + +class OpenIdConnectLogin(ProxyOnlyResource): + """OpenIdConnectLogin. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param name_claim_type: + :type name_claim_type: str + :param scopes: + :type scopes: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name_claim_type': {'key': 'properties.nameClaimType', 'type': 'str'}, + 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(OpenIdConnectLogin, self).__init__(**kwargs) + self.name_claim_type = kwargs.get('name_claim_type', None) + self.scopes = kwargs.get('scopes', None) + + +class OpenIdConnectRegistration(ProxyOnlyResource): + """OpenIdConnectRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param client_id: + :type client_id: str + :param client_credential: + :type client_credential: ~azure.mgmt.web.v2020_06_01.models.OpenIdConnectClientCredential + :param open_id_connect_configuration: + :type open_id_connect_configuration: ~azure.mgmt.web.v2020_06_01.models.OpenIdConnectConfig + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_credential': {'key': 'properties.clientCredential', 'type': 'OpenIdConnectClientCredential'}, + 'open_id_connect_configuration': {'key': 'properties.openIdConnectConfiguration', 'type': 'OpenIdConnectConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(OpenIdConnectRegistration, self).__init__(**kwargs) + self.client_id = kwargs.get('client_id', None) + self.client_credential = kwargs.get('client_credential', None) + self.open_id_connect_configuration = kwargs.get('open_id_connect_configuration', None) + + +class Operation(msrest.serialization.Model): + """An operation on a resource. + + :param id: Operation ID. + :type id: str + :param name: Operation name. + :type name: str + :param status: The current status of the operation. Possible values include: "InProgress", + "Failed", "Succeeded", "TimedOut", "Created". + :type status: str or ~azure.mgmt.web.v2020_06_01.models.OperationStatus + :param errors: Any errors associate with the operation. + :type errors: list[~azure.mgmt.web.v2020_06_01.models.ErrorEntity] + :param created_time: Time when operation has started. + :type created_time: ~datetime.datetime + :param modified_time: Time when operation has been updated. + :type modified_time: ~datetime.datetime + :param expiration_time: Time when operation will expire. + :type expiration_time: ~datetime.datetime + :param geo_master_operation_id: Applicable only for stamp operation ids. + :type geo_master_operation_id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[ErrorEntity]'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'modified_time': {'key': 'modifiedTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'expirationTime', 'type': 'iso-8601'}, + 'geo_master_operation_id': {'key': 'geoMasterOperationId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.status = kwargs.get('status', None) + self.errors = kwargs.get('errors', None) + self.created_time = kwargs.get('created_time', None) + self.modified_time = kwargs.get('modified_time', None) + self.expiration_time = kwargs.get('expiration_time', None) + self.geo_master_operation_id = kwargs.get('geo_master_operation_id', None) + + +class OutboundEnvironmentEndpoint(msrest.serialization.Model): + """Endpoints accessed for a common purpose that the App Service Environment requires outbound network access to. + + :param category: The type of service accessed by the App Service Environment, e.g., Azure + Storage, Azure SQL Database, and Azure Active Directory. + :type category: str + :param endpoints: The endpoints that the App Service Environment reaches the service at. + :type endpoints: list[~azure.mgmt.web.v2020_06_01.models.EndpointDependency] + """ + + _attribute_map = { + 'category': {'key': 'category', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[EndpointDependency]'}, + } + + def __init__( + self, + **kwargs + ): + super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) + self.category = kwargs.get('category', None) + self.endpoints = kwargs.get('endpoints', None) + + +class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): + """Collection of Outbound Environment Endpoints. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.OutboundEnvironmentEndpoint] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OutboundEnvironmentEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class PerfMonCounterCollection(msrest.serialization.Model): + """Collection of performance monitor counters. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.PerfMonResponse] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PerfMonResponse]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PerfMonCounterCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class PerfMonResponse(msrest.serialization.Model): + """Performance monitor API response. + + :param code: The response code. + :type code: str + :param message: The message. + :type message: str + :param data: The performance monitor counters. + :type data: ~azure.mgmt.web.v2020_06_01.models.PerfMonSet + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'PerfMonSet'}, + } + + def __init__( + self, + **kwargs + ): + super(PerfMonResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.data = kwargs.get('data', None) + + +class PerfMonSample(msrest.serialization.Model): + """Performance monitor sample in a set. + + :param time: Point in time for which counter was measured. + :type time: ~datetime.datetime + :param instance_name: Name of the server on which the measurement is made. + :type instance_name: str + :param value: Value of counter at a certain time. + :type value: float + """ + + _attribute_map = { + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'instance_name': {'key': 'instanceName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(PerfMonSample, self).__init__(**kwargs) + self.time = kwargs.get('time', None) + self.instance_name = kwargs.get('instance_name', None) + self.value = kwargs.get('value', None) + + +class PerfMonSet(msrest.serialization.Model): + """Metric information. + + :param name: Unique key name of the counter. + :type name: str + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param time_grain: Presented time grain. + :type time_grain: str + :param values: Collection of workers that are active during this time. + :type values: list[~azure.mgmt.web.v2020_06_01.models.PerfMonSample] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[PerfMonSample]'}, + } + + def __init__( + self, + **kwargs + ): + super(PerfMonSet, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.time_grain = kwargs.get('time_grain', None) + self.values = kwargs.get('values', None) + + +class PremierAddOn(Resource): + """Premier add-on. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: Premier add on SKU. + :type sku: str + :param product: Premier add on Product. + :type product: str + :param vendor: Premier add on Vendor. + :type vendor: str + :param marketplace_publisher: Premier add on Marketplace publisher. + :type marketplace_publisher: str + :param marketplace_offer: Premier add on Marketplace offer. + :type marketplace_offer: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'marketplace_publisher': {'key': 'properties.marketplacePublisher', 'type': 'str'}, + 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PremierAddOn, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.product = kwargs.get('product', None) + self.vendor = kwargs.get('vendor', None) + self.marketplace_publisher = kwargs.get('marketplace_publisher', None) + self.marketplace_offer = kwargs.get('marketplace_offer', None) + + +class PremierAddOnOffer(ProxyOnlyResource): + """Premier add-on offer. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param sku: Premier add on SKU. + :type sku: str + :param product: Premier add on offer Product. + :type product: str + :param vendor: Premier add on offer Vendor. + :type vendor: str + :param promo_code_required: :code:`true` if promotion code is required; otherwise, + :code:`false`. + :type promo_code_required: bool + :param quota: Premier add on offer Quota. + :type quota: int + :param web_hosting_plan_restrictions: App Service plans this offer is restricted to. Possible + values include: "None", "Free", "Shared", "Basic", "Standard", "Premium". + :type web_hosting_plan_restrictions: str or + ~azure.mgmt.web.v2020_06_01.models.AppServicePlanRestrictions + :param privacy_policy_url: Privacy policy URL. + :type privacy_policy_url: str + :param legal_terms_url: Legal terms URL. + :type legal_terms_url: str + :param marketplace_publisher: Marketplace publisher. + :type marketplace_publisher: str + :param marketplace_offer: Marketplace offer. + :type marketplace_offer: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'promo_code_required': {'key': 'properties.promoCodeRequired', 'type': 'bool'}, + 'quota': {'key': 'properties.quota', 'type': 'int'}, + 'web_hosting_plan_restrictions': {'key': 'properties.webHostingPlanRestrictions', 'type': 'str'}, + 'privacy_policy_url': {'key': 'properties.privacyPolicyUrl', 'type': 'str'}, + 'legal_terms_url': {'key': 'properties.legalTermsUrl', 'type': 'str'}, + 'marketplace_publisher': {'key': 'properties.marketplacePublisher', 'type': 'str'}, + 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PremierAddOnOffer, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.product = kwargs.get('product', None) + self.vendor = kwargs.get('vendor', None) + self.promo_code_required = kwargs.get('promo_code_required', None) + self.quota = kwargs.get('quota', None) + self.web_hosting_plan_restrictions = kwargs.get('web_hosting_plan_restrictions', None) + self.privacy_policy_url = kwargs.get('privacy_policy_url', None) + self.legal_terms_url = kwargs.get('legal_terms_url', None) + self.marketplace_publisher = kwargs.get('marketplace_publisher', None) + self.marketplace_offer = kwargs.get('marketplace_offer', None) + + +class PremierAddOnOfferCollection(msrest.serialization.Model): + """Collection of premier add-on offers. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.PremierAddOnOffer] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PremierAddOnOffer]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PremierAddOnOfferCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class PremierAddOnPatchResource(ProxyOnlyResource): + """ARM resource for a PremierAddOn. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param sku: Premier add on SKU. + :type sku: str + :param product: Premier add on Product. + :type product: str + :param vendor: Premier add on Vendor. + :type vendor: str + :param marketplace_publisher: Premier add on Marketplace publisher. + :type marketplace_publisher: str + :param marketplace_offer: Premier add on Marketplace offer. + :type marketplace_offer: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'marketplace_publisher': {'key': 'properties.marketplacePublisher', 'type': 'str'}, + 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PremierAddOnPatchResource, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.product = kwargs.get('product', None) + self.vendor = kwargs.get('vendor', None) + self.marketplace_publisher = kwargs.get('marketplace_publisher', None) + self.marketplace_offer = kwargs.get('marketplace_offer', None) + + +class PrivateAccess(ProxyOnlyResource): + """Description of the parameters of Private Access for a Web Site. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: Whether private access is enabled or not. + :type enabled: bool + :param virtual_networks: The Virtual Networks (and subnets) allowed to access the site + privately. + :type virtual_networks: list[~azure.mgmt.web.v2020_06_01.models.PrivateAccessVirtualNetwork] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'virtual_networks': {'key': 'properties.virtualNetworks', 'type': '[PrivateAccessVirtualNetwork]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateAccess, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.virtual_networks = kwargs.get('virtual_networks', None) + + +class PrivateAccessSubnet(msrest.serialization.Model): + """Description of a Virtual Network subnet that is useable for private site access. + + :param name: The name of the subnet. + :type name: str + :param key: The key (ID) of the subnet. + :type key: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateAccessSubnet, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.key = kwargs.get('key', None) + + +class PrivateAccessVirtualNetwork(msrest.serialization.Model): + """Description of a Virtual Network that is useable for private site access. + + :param name: The name of the Virtual Network. + :type name: str + :param key: The key (ID) of the Virtual Network. + :type key: int + :param resource_id: The ARM uri of the Virtual Network. + :type resource_id: str + :param subnets: A List of subnets that access is allowed to on this Virtual Network. An empty + array (but not null) is interpreted to mean that all subnets are allowed within this Virtual + Network. + :type subnets: list[~azure.mgmt.web.v2020_06_01.models.PrivateAccessSubnet] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'int'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'subnets': {'key': 'subnets', 'type': '[PrivateAccessSubnet]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateAccessVirtualNetwork, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.key = kwargs.get('key', None) + self.resource_id = kwargs.get('resource_id', None) + self.subnets = kwargs.get('subnets', None) + + +class PrivateEndpointConnectionResource(ProxyOnlyResource): + """Private Endpoint Connection ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar provisioning_state: + :vartype provisioning_state: str + :param private_endpoint: PrivateEndpoint of a remote private endpoint connection. + :type private_endpoint: ~azure.mgmt.web.v2020_06_01.models.ArmIdWrapper + :param private_link_service_connection_state: The state of a private link connection. + :type private_link_service_connection_state: + ~azure.mgmt.web.v2020_06_01.models.PrivateLinkConnectionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'ArmIdWrapper'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkConnectionState'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionResource, self).__init__(**kwargs) + self.provisioning_state = None + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + + +class PrivateLinkConnectionApprovalRequestResource(ProxyOnlyResource): + """Private Endpoint Connection Approval ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param private_link_service_connection_state: The state of a private link connection. + :type private_link_service_connection_state: + ~azure.mgmt.web.v2020_06_01.models.PrivateLinkConnectionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkConnectionState'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkConnectionApprovalRequestResource, self).__init__(**kwargs) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + + +class PrivateLinkConnectionState(msrest.serialization.Model): + """The state of a private link connection. + + :param status: Status of a private link connection. + :type status: str + :param description: Description of a private link connection. + :type description: str + :param actions_required: ActionsRequired for a private link connection. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = kwargs.get('actions_required', None) + + +class PrivateLinkResource(msrest.serialization.Model): + """A private link resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. + :type id: str + :param name: Required. Name of a private link resource. + :type name: str + :param type: Required. + :type type: str + :param properties: Required. Properties of a private link resource. + :type properties: ~azure.mgmt.web.v2020_06_01.models.PrivateLinkResourceProperties + """ + + _validation = { + 'id': {'required': True}, + 'name': {'required': True}, + 'type': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateLinkResourceProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.id = kwargs['id'] + self.name = kwargs['name'] + self.type = kwargs['type'] + self.properties = kwargs['properties'] + + +class PrivateLinkResourceProperties(msrest.serialization.Model): + """Properties of a private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar group_id: GroupId of a private link resource. + :vartype group_id: str + :ivar required_members: RequiredMembers of a private link resource. + :vartype required_members: list[str] + :ivar required_zone_names: RequiredZoneNames of a private link resource. + :vartype required_zone_names: list[str] + """ + + _validation = { + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + 'required_zone_names': {'readonly': True}, + } + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourceProperties, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = None + + +class PrivateLinkResourcesWrapper(msrest.serialization.Model): + """Wrapper for a collection of private link resources. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. + :type value: list[~azure.mgmt.web.v2020_06_01.models.PrivateLinkResource] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourcesWrapper, self).__init__(**kwargs) + self.value = kwargs['value'] + + +class ProcessInfo(ProxyOnlyResource): + """Process Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar identifier: ARM Identifier for deployment. + :vartype identifier: int + :param deployment_name: Deployment name. + :type deployment_name: str + :param href: HRef URI. + :type href: str + :param minidump: Minidump URI. + :type minidump: str + :param is_profile_running: Is profile running?. + :type is_profile_running: bool + :param is_iis_profile_running: Is the IIS Profile running?. + :type is_iis_profile_running: bool + :param iis_profile_timeout_in_seconds: IIS Profile timeout (seconds). + :type iis_profile_timeout_in_seconds: float + :param parent: Parent process. + :type parent: str + :param children: Child process list. + :type children: list[str] + :param threads: Thread list. + :type threads: list[~azure.mgmt.web.v2020_06_01.models.ProcessThreadInfo] + :param open_file_handles: List of open files. + :type open_file_handles: list[str] + :param modules: List of modules. + :type modules: list[~azure.mgmt.web.v2020_06_01.models.ProcessModuleInfo] + :param file_name: File name of this process. + :type file_name: str + :param command_line: Command line. + :type command_line: str + :param user_name: User name. + :type user_name: str + :param handle_count: Handle count. + :type handle_count: int + :param module_count: Module count. + :type module_count: int + :param thread_count: Thread count. + :type thread_count: int + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param total_cpu_time: Total CPU time. + :type total_cpu_time: str + :param user_cpu_time: User CPU time. + :type user_cpu_time: str + :param privileged_cpu_time: Privileged CPU time. + :type privileged_cpu_time: str + :param working_set: Working set. + :type working_set: long + :param peak_working_set: Peak working set. + :type peak_working_set: long + :param private_memory: Private memory size. + :type private_memory: long + :param virtual_memory: Virtual memory size. + :type virtual_memory: long + :param peak_virtual_memory: Peak virtual memory usage. + :type peak_virtual_memory: long + :param paged_system_memory: Paged system memory. + :type paged_system_memory: long + :param non_paged_system_memory: Non-paged system memory. + :type non_paged_system_memory: long + :param paged_memory: Paged memory. + :type paged_memory: long + :param peak_paged_memory: Peak paged memory. + :type peak_paged_memory: long + :param time_stamp: Time stamp. + :type time_stamp: ~datetime.datetime + :param environment_variables: List of environment variables. + :type environment_variables: dict[str, str] + :param is_scm_site: Is this the SCM site?. + :type is_scm_site: bool + :param is_webjob: Is this a Web Job?. + :type is_webjob: bool + :param description: Description of process. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'identifier': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identifier': {'key': 'properties.identifier', 'type': 'int'}, + 'deployment_name': {'key': 'properties.deployment_name', 'type': 'str'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'minidump': {'key': 'properties.minidump', 'type': 'str'}, + 'is_profile_running': {'key': 'properties.is_profile_running', 'type': 'bool'}, + 'is_iis_profile_running': {'key': 'properties.is_iis_profile_running', 'type': 'bool'}, + 'iis_profile_timeout_in_seconds': {'key': 'properties.iis_profile_timeout_in_seconds', 'type': 'float'}, + 'parent': {'key': 'properties.parent', 'type': 'str'}, + 'children': {'key': 'properties.children', 'type': '[str]'}, + 'threads': {'key': 'properties.threads', 'type': '[ProcessThreadInfo]'}, + 'open_file_handles': {'key': 'properties.open_file_handles', 'type': '[str]'}, + 'modules': {'key': 'properties.modules', 'type': '[ProcessModuleInfo]'}, + 'file_name': {'key': 'properties.file_name', 'type': 'str'}, + 'command_line': {'key': 'properties.command_line', 'type': 'str'}, + 'user_name': {'key': 'properties.user_name', 'type': 'str'}, + 'handle_count': {'key': 'properties.handle_count', 'type': 'int'}, + 'module_count': {'key': 'properties.module_count', 'type': 'int'}, + 'thread_count': {'key': 'properties.thread_count', 'type': 'int'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'total_cpu_time': {'key': 'properties.total_cpu_time', 'type': 'str'}, + 'user_cpu_time': {'key': 'properties.user_cpu_time', 'type': 'str'}, + 'privileged_cpu_time': {'key': 'properties.privileged_cpu_time', 'type': 'str'}, + 'working_set': {'key': 'properties.working_set', 'type': 'long'}, + 'peak_working_set': {'key': 'properties.peak_working_set', 'type': 'long'}, + 'private_memory': {'key': 'properties.private_memory', 'type': 'long'}, + 'virtual_memory': {'key': 'properties.virtual_memory', 'type': 'long'}, + 'peak_virtual_memory': {'key': 'properties.peak_virtual_memory', 'type': 'long'}, + 'paged_system_memory': {'key': 'properties.paged_system_memory', 'type': 'long'}, + 'non_paged_system_memory': {'key': 'properties.non_paged_system_memory', 'type': 'long'}, + 'paged_memory': {'key': 'properties.paged_memory', 'type': 'long'}, + 'peak_paged_memory': {'key': 'properties.peak_paged_memory', 'type': 'long'}, + 'time_stamp': {'key': 'properties.time_stamp', 'type': 'iso-8601'}, + 'environment_variables': {'key': 'properties.environment_variables', 'type': '{str}'}, + 'is_scm_site': {'key': 'properties.is_scm_site', 'type': 'bool'}, + 'is_webjob': {'key': 'properties.is_webjob', 'type': 'bool'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProcessInfo, self).__init__(**kwargs) + self.identifier = None + self.deployment_name = kwargs.get('deployment_name', None) + self.href = kwargs.get('href', None) + self.minidump = kwargs.get('minidump', None) + self.is_profile_running = kwargs.get('is_profile_running', None) + self.is_iis_profile_running = kwargs.get('is_iis_profile_running', None) + self.iis_profile_timeout_in_seconds = kwargs.get('iis_profile_timeout_in_seconds', None) + self.parent = kwargs.get('parent', None) + self.children = kwargs.get('children', None) + self.threads = kwargs.get('threads', None) + self.open_file_handles = kwargs.get('open_file_handles', None) + self.modules = kwargs.get('modules', None) + self.file_name = kwargs.get('file_name', None) + self.command_line = kwargs.get('command_line', None) + self.user_name = kwargs.get('user_name', None) + self.handle_count = kwargs.get('handle_count', None) + self.module_count = kwargs.get('module_count', None) + self.thread_count = kwargs.get('thread_count', None) + self.start_time = kwargs.get('start_time', None) + self.total_cpu_time = kwargs.get('total_cpu_time', None) + self.user_cpu_time = kwargs.get('user_cpu_time', None) + self.privileged_cpu_time = kwargs.get('privileged_cpu_time', None) + self.working_set = kwargs.get('working_set', None) + self.peak_working_set = kwargs.get('peak_working_set', None) + self.private_memory = kwargs.get('private_memory', None) + self.virtual_memory = kwargs.get('virtual_memory', None) + self.peak_virtual_memory = kwargs.get('peak_virtual_memory', None) + self.paged_system_memory = kwargs.get('paged_system_memory', None) + self.non_paged_system_memory = kwargs.get('non_paged_system_memory', None) + self.paged_memory = kwargs.get('paged_memory', None) + self.peak_paged_memory = kwargs.get('peak_paged_memory', None) + self.time_stamp = kwargs.get('time_stamp', None) + self.environment_variables = kwargs.get('environment_variables', None) + self.is_scm_site = kwargs.get('is_scm_site', None) + self.is_webjob = kwargs.get('is_webjob', None) + self.description = kwargs.get('description', None) + + +class ProcessInfoCollection(msrest.serialization.Model): + """Collection of Kudu process information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.ProcessInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProcessInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProcessInfoCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class ProcessModuleInfo(ProxyOnlyResource): + """Process Module Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param base_address: Base address. Used as module identifier in ARM resource URI. + :type base_address: str + :param file_name: File name. + :type file_name: str + :param href: HRef URI. + :type href: str + :param file_path: File path. + :type file_path: str + :param module_memory_size: Module memory size. + :type module_memory_size: int + :param file_version: File version. + :type file_version: str + :param file_description: File description. + :type file_description: str + :param product: Product name. + :type product: str + :param product_version: Product version. + :type product_version: str + :param is_debug: Is debug?. + :type is_debug: bool + :param language: Module language (locale). + :type language: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'base_address': {'key': 'properties.base_address', 'type': 'str'}, + 'file_name': {'key': 'properties.file_name', 'type': 'str'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'file_path': {'key': 'properties.file_path', 'type': 'str'}, + 'module_memory_size': {'key': 'properties.module_memory_size', 'type': 'int'}, + 'file_version': {'key': 'properties.file_version', 'type': 'str'}, + 'file_description': {'key': 'properties.file_description', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'product_version': {'key': 'properties.product_version', 'type': 'str'}, + 'is_debug': {'key': 'properties.is_debug', 'type': 'bool'}, + 'language': {'key': 'properties.language', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProcessModuleInfo, self).__init__(**kwargs) + self.base_address = kwargs.get('base_address', None) + self.file_name = kwargs.get('file_name', None) + self.href = kwargs.get('href', None) + self.file_path = kwargs.get('file_path', None) + self.module_memory_size = kwargs.get('module_memory_size', None) + self.file_version = kwargs.get('file_version', None) + self.file_description = kwargs.get('file_description', None) + self.product = kwargs.get('product', None) + self.product_version = kwargs.get('product_version', None) + self.is_debug = kwargs.get('is_debug', None) + self.language = kwargs.get('language', None) + + +class ProcessModuleInfoCollection(msrest.serialization.Model): + """Collection of Kudu thread information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.ProcessModuleInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProcessModuleInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProcessModuleInfoCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class ProcessThreadInfo(ProxyOnlyResource): + """Process Thread Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar identifier: Site extension ID. + :vartype identifier: int + :param href: HRef URI. + :type href: str + :param process: Process URI. + :type process: str + :param start_address: Start address. + :type start_address: str + :param current_priority: Current thread priority. + :type current_priority: int + :param priority_level: Thread priority level. + :type priority_level: str + :param base_priority: Base priority. + :type base_priority: int + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param total_processor_time: Total processor time. + :type total_processor_time: str + :param user_processor_time: User processor time. + :type user_processor_time: str + :param state: Thread state. + :type state: str + :param wait_reason: Wait reason. + :type wait_reason: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'identifier': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identifier': {'key': 'properties.identifier', 'type': 'int'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'process': {'key': 'properties.process', 'type': 'str'}, + 'start_address': {'key': 'properties.start_address', 'type': 'str'}, + 'current_priority': {'key': 'properties.current_priority', 'type': 'int'}, + 'priority_level': {'key': 'properties.priority_level', 'type': 'str'}, + 'base_priority': {'key': 'properties.base_priority', 'type': 'int'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'total_processor_time': {'key': 'properties.total_processor_time', 'type': 'str'}, + 'user_processor_time': {'key': 'properties.user_processor_time', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'wait_reason': {'key': 'properties.wait_reason', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProcessThreadInfo, self).__init__(**kwargs) + self.identifier = None + self.href = kwargs.get('href', None) + self.process = kwargs.get('process', None) + self.start_address = kwargs.get('start_address', None) + self.current_priority = kwargs.get('current_priority', None) + self.priority_level = kwargs.get('priority_level', None) + self.base_priority = kwargs.get('base_priority', None) + self.start_time = kwargs.get('start_time', None) + self.total_processor_time = kwargs.get('total_processor_time', None) + self.user_processor_time = kwargs.get('user_processor_time', None) + self.state = kwargs.get('state', None) + self.wait_reason = kwargs.get('wait_reason', None) + + +class ProcessThreadInfoCollection(msrest.serialization.Model): + """Collection of Kudu thread information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.ProcessThreadInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProcessThreadInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProcessThreadInfoCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class PublicCertificate(ProxyOnlyResource): + """Public certificate object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param blob: Public Certificate byte array. + :type blob: bytearray + :param public_certificate_location: Public Certificate Location. Possible values include: + "CurrentUserMy", "LocalMachineMy", "Unknown". + :type public_certificate_location: str or + ~azure.mgmt.web.v2020_06_01.models.PublicCertificateLocation + :ivar thumbprint: Certificate Thumbprint. + :vartype thumbprint: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'thumbprint': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'blob': {'key': 'properties.blob', 'type': 'bytearray'}, + 'public_certificate_location': {'key': 'properties.publicCertificateLocation', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PublicCertificate, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.public_certificate_location = kwargs.get('public_certificate_location', None) + self.thumbprint = None + + +class PublicCertificateCollection(msrest.serialization.Model): + """Collection of public certificates. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.PublicCertificate] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PublicCertificate]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PublicCertificateCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class PushSettings(ProxyOnlyResource): + """Push settings for the App. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param is_push_enabled: Gets or sets a flag indicating whether the Push endpoint is enabled. + :type is_push_enabled: bool + :param tag_whitelist_json: Gets or sets a JSON string containing a list of tags that are + whitelisted for use by the push registration endpoint. + :type tag_whitelist_json: str + :param tags_requiring_auth: Gets or sets a JSON string containing a list of tags that require + user authentication to be used in the push registration endpoint. + Tags can consist of alphanumeric characters and the following: + '_', '@', '#', '.', ':', '-'. + Validation should be performed at the PushRequestHandler. + :type tags_requiring_auth: str + :param dynamic_tags_json: Gets or sets a JSON string containing a list of dynamic tags that + will be evaluated from user claims in the push registration endpoint. + :type dynamic_tags_json: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_push_enabled': {'key': 'properties.isPushEnabled', 'type': 'bool'}, + 'tag_whitelist_json': {'key': 'properties.tagWhitelistJson', 'type': 'str'}, + 'tags_requiring_auth': {'key': 'properties.tagsRequiringAuth', 'type': 'str'}, + 'dynamic_tags_json': {'key': 'properties.dynamicTagsJson', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PushSettings, self).__init__(**kwargs) + self.is_push_enabled = kwargs.get('is_push_enabled', None) + self.tag_whitelist_json = kwargs.get('tag_whitelist_json', None) + self.tags_requiring_auth = kwargs.get('tags_requiring_auth', None) + self.dynamic_tags_json = kwargs.get('dynamic_tags_json', None) + + +class RampUpRule(msrest.serialization.Model): + """Routing rules for ramp up testing. This rule allows to redirect static traffic % to a slot or to gradually change routing % based on performance. + + :param action_host_name: Hostname of a slot to which the traffic will be redirected if decided + to. E.g. myapp-stage.azurewebsites.net. + :type action_host_name: str + :param reroute_percentage: Percentage of the traffic which will be redirected to + :code:`ActionHostName`. + :type reroute_percentage: float + :param change_step: In auto ramp up scenario this is the step to add/remove from + :code:`ReroutePercentage` until it reaches + \n:code:`MinReroutePercentage` or + :code:`MaxReroutePercentage`. Site metrics are checked every N minutes specified + in :code:`ChangeIntervalInMinutes`.\nCustom decision algorithm + can be provided in TiPCallback site extension which URL can be specified in + :code:`ChangeDecisionCallbackUrl`. + :type change_step: float + :param change_interval_in_minutes: Specifies interval in minutes to reevaluate + ReroutePercentage. + :type change_interval_in_minutes: int + :param min_reroute_percentage: Specifies lower boundary above which ReroutePercentage will + stay. + :type min_reroute_percentage: float + :param max_reroute_percentage: Specifies upper boundary below which ReroutePercentage will + stay. + :type max_reroute_percentage: float + :param change_decision_callback_url: Custom decision algorithm can be provided in TiPCallback + site extension which URL can be specified. See TiPCallback site extension for the scaffold and + contracts. + https://www.siteextensions.net/packages/TiPCallback/. + :type change_decision_callback_url: str + :param name: Name of the routing rule. The recommended name would be to point to the slot which + will receive the traffic in the experiment. + :type name: str + """ + + _attribute_map = { + 'action_host_name': {'key': 'actionHostName', 'type': 'str'}, + 'reroute_percentage': {'key': 'reroutePercentage', 'type': 'float'}, + 'change_step': {'key': 'changeStep', 'type': 'float'}, + 'change_interval_in_minutes': {'key': 'changeIntervalInMinutes', 'type': 'int'}, + 'min_reroute_percentage': {'key': 'minReroutePercentage', 'type': 'float'}, + 'max_reroute_percentage': {'key': 'maxReroutePercentage', 'type': 'float'}, + 'change_decision_callback_url': {'key': 'changeDecisionCallbackUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RampUpRule, self).__init__(**kwargs) + self.action_host_name = kwargs.get('action_host_name', None) + self.reroute_percentage = kwargs.get('reroute_percentage', None) + self.change_step = kwargs.get('change_step', None) + self.change_interval_in_minutes = kwargs.get('change_interval_in_minutes', None) + self.min_reroute_percentage = kwargs.get('min_reroute_percentage', None) + self.max_reroute_percentage = kwargs.get('max_reroute_percentage', None) + self.change_decision_callback_url = kwargs.get('change_decision_callback_url', None) + self.name = kwargs.get('name', None) + + +class Recommendation(ProxyOnlyResource): + """Represents a recommendation result generated by the recommendation engine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param creation_time: Timestamp when this instance was created. + :type creation_time: ~datetime.datetime + :param recommendation_id: A GUID value that each recommendation object is associated with. + :type recommendation_id: str + :param resource_id: Full ARM resource ID string that this recommendation object is associated + with. + :type resource_id: str + :param resource_scope: Name of a resource type this recommendation applies, e.g. Subscription, + ServerFarm, Site. Possible values include: "ServerFarm", "Subscription", "WebSite". + :type resource_scope: str or ~azure.mgmt.web.v2020_06_01.models.ResourceScopeType + :param rule_name: Unique name of the rule. + :type rule_name: str + :param display_name: UI friendly name of the rule (may not be unique). + :type display_name: str + :param message: Recommendation text. + :type message: str + :param level: Level indicating how critical this recommendation can impact. Possible values + include: "Critical", "Warning", "Information", "NonUrgentSuggestion". + :type level: str or ~azure.mgmt.web.v2020_06_01.models.NotificationLevel + :param channels: List of channels that this recommendation can apply. Possible values include: + "Notification", "Api", "Email", "Webhook", "All". + :type channels: str or ~azure.mgmt.web.v2020_06_01.models.Channels + :ivar category_tags: The list of category tags that this recommendation belongs to. + :vartype category_tags: list[str] + :param action_name: Name of action recommended by this object. + :type action_name: str + :param enabled: True if this recommendation is still valid (i.e. "actionable"). False if it is + invalid. + :type enabled: int + :param states: The list of states of this recommendation. If it's null then it should be + considered "Active". + :type states: list[str] + :param start_time: The beginning time in UTC of a range that the recommendation refers to. + :type start_time: ~datetime.datetime + :param end_time: The end time in UTC of a range that the recommendation refers to. + :type end_time: ~datetime.datetime + :param next_notification_time: When to notify this recommendation next in UTC. Null means that + this will never be notified anymore. + :type next_notification_time: ~datetime.datetime + :param notification_expiration_time: Date and time in UTC when this notification expires. + :type notification_expiration_time: ~datetime.datetime + :param notified_time: Last timestamp in UTC this instance was actually notified. Null means + that this recommendation hasn't been notified yet. + :type notified_time: ~datetime.datetime + :param score: A metric value measured by the rule. + :type score: float + :param is_dynamic: True if this is associated with a dynamically added rule. + :type is_dynamic: bool + :param extension_name: Extension name of the portal if exists. + :type extension_name: str + :param blade_name: Deep link to a blade on the portal. + :type blade_name: str + :param forward_link: Forward link to an external document associated with the rule. + :type forward_link: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'category_tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'recommendation_id': {'key': 'properties.recommendationId', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'resource_scope': {'key': 'properties.resourceScope', 'type': 'str'}, + 'rule_name': {'key': 'properties.ruleName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'level': {'key': 'properties.level', 'type': 'str'}, + 'channels': {'key': 'properties.channels', 'type': 'str'}, + 'category_tags': {'key': 'properties.categoryTags', 'type': '[str]'}, + 'action_name': {'key': 'properties.actionName', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'int'}, + 'states': {'key': 'properties.states', 'type': '[str]'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'next_notification_time': {'key': 'properties.nextNotificationTime', 'type': 'iso-8601'}, + 'notification_expiration_time': {'key': 'properties.notificationExpirationTime', 'type': 'iso-8601'}, + 'notified_time': {'key': 'properties.notifiedTime', 'type': 'iso-8601'}, + 'score': {'key': 'properties.score', 'type': 'float'}, + 'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'}, + 'extension_name': {'key': 'properties.extensionName', 'type': 'str'}, + 'blade_name': {'key': 'properties.bladeName', 'type': 'str'}, + 'forward_link': {'key': 'properties.forwardLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Recommendation, self).__init__(**kwargs) + self.creation_time = kwargs.get('creation_time', None) + self.recommendation_id = kwargs.get('recommendation_id', None) + self.resource_id = kwargs.get('resource_id', None) + self.resource_scope = kwargs.get('resource_scope', None) + self.rule_name = kwargs.get('rule_name', None) + self.display_name = kwargs.get('display_name', None) + self.message = kwargs.get('message', None) + self.level = kwargs.get('level', None) + self.channels = kwargs.get('channels', None) + self.category_tags = None + self.action_name = kwargs.get('action_name', None) + self.enabled = kwargs.get('enabled', None) + self.states = kwargs.get('states', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.next_notification_time = kwargs.get('next_notification_time', None) + self.notification_expiration_time = kwargs.get('notification_expiration_time', None) + self.notified_time = kwargs.get('notified_time', None) + self.score = kwargs.get('score', None) + self.is_dynamic = kwargs.get('is_dynamic', None) + self.extension_name = kwargs.get('extension_name', None) + self.blade_name = kwargs.get('blade_name', None) + self.forward_link = kwargs.get('forward_link', None) + + +class RecommendationCollection(msrest.serialization.Model): + """Collection of recommendations. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.Recommendation] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Recommendation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RecommendationCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class RecommendationRule(ProxyOnlyResource): + """Represents a recommendation rule that the recommendation engine can perform. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param recommendation_name: Unique name of the rule. + :type recommendation_name: str + :param display_name: UI friendly name of the rule. + :type display_name: str + :param message: Localized name of the rule (Good for UI). + :type message: str + :param recommendation_id: Recommendation ID of an associated recommendation object tied to the + rule, if exists. + If such an object doesn't exist, it is set to null. + :type recommendation_id: str + :param description: Localized detailed description of the rule. + :type description: str + :param action_name: Name of action that is recommended by this rule in string. + :type action_name: str + :param level: Level of impact indicating how critical this rule is. Possible values include: + "Critical", "Warning", "Information", "NonUrgentSuggestion". + :type level: str or ~azure.mgmt.web.v2020_06_01.models.NotificationLevel + :param channels: List of available channels that this rule applies. Possible values include: + "Notification", "Api", "Email", "Webhook", "All". + :type channels: str or ~azure.mgmt.web.v2020_06_01.models.Channels + :ivar category_tags: The list of category tags that this recommendation rule belongs to. + :vartype category_tags: list[str] + :param is_dynamic: True if this is associated with a dynamically added rule. + :type is_dynamic: bool + :param extension_name: Extension name of the portal if exists. Applicable to dynamic rule only. + :type extension_name: str + :param blade_name: Deep link to a blade on the portal. Applicable to dynamic rule only. + :type blade_name: str + :param forward_link: Forward link to an external document associated with the rule. Applicable + to dynamic rule only. + :type forward_link: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'category_tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recommendation_name': {'key': 'properties.recommendationName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'recommendation_id': {'key': 'properties.recommendationId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'action_name': {'key': 'properties.actionName', 'type': 'str'}, + 'level': {'key': 'properties.level', 'type': 'str'}, + 'channels': {'key': 'properties.channels', 'type': 'str'}, + 'category_tags': {'key': 'properties.categoryTags', 'type': '[str]'}, + 'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'}, + 'extension_name': {'key': 'properties.extensionName', 'type': 'str'}, + 'blade_name': {'key': 'properties.bladeName', 'type': 'str'}, + 'forward_link': {'key': 'properties.forwardLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RecommendationRule, self).__init__(**kwargs) + self.recommendation_name = kwargs.get('recommendation_name', None) + self.display_name = kwargs.get('display_name', None) + self.message = kwargs.get('message', None) + self.recommendation_id = kwargs.get('recommendation_id', None) + self.description = kwargs.get('description', None) + self.action_name = kwargs.get('action_name', None) + self.level = kwargs.get('level', None) + self.channels = kwargs.get('channels', None) + self.category_tags = None + self.is_dynamic = kwargs.get('is_dynamic', None) + self.extension_name = kwargs.get('extension_name', None) + self.blade_name = kwargs.get('blade_name', None) + self.forward_link = kwargs.get('forward_link', None) + + +class ReissueCertificateOrderRequest(ProxyOnlyResource): + """Class representing certificate reissue request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param key_size: Certificate Key Size. + :type key_size: int + :param delay_existing_revoke_in_hours: Delay in hours to revoke existing certificate after the + new certificate is issued. + :type delay_existing_revoke_in_hours: int + :param csr: Csr to be used for re-key operation. + :type csr: str + :param is_private_key_external: Should we change the ASC type (from managed private key to + external private key and vice versa). + :type is_private_key_external: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'delay_existing_revoke_in_hours': {'key': 'properties.delayExistingRevokeInHours', 'type': 'int'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ReissueCertificateOrderRequest, self).__init__(**kwargs) + self.key_size = kwargs.get('key_size', None) + self.delay_existing_revoke_in_hours = kwargs.get('delay_existing_revoke_in_hours', None) + self.csr = kwargs.get('csr', None) + self.is_private_key_external = kwargs.get('is_private_key_external', None) + + +class RelayServiceConnectionEntity(ProxyOnlyResource): + """Hybrid Connection for an App Service app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param entity_name: + :type entity_name: str + :param entity_connection_string: + :type entity_connection_string: str + :param resource_type: + :type resource_type: str + :param resource_connection_string: + :type resource_connection_string: str + :param hostname: + :type hostname: str + :param port: + :type port: int + :param biztalk_uri: + :type biztalk_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'entity_name': {'key': 'properties.entityName', 'type': 'str'}, + 'entity_connection_string': {'key': 'properties.entityConnectionString', 'type': 'str'}, + 'resource_type': {'key': 'properties.resourceType', 'type': 'str'}, + 'resource_connection_string': {'key': 'properties.resourceConnectionString', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'biztalk_uri': {'key': 'properties.biztalkUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RelayServiceConnectionEntity, self).__init__(**kwargs) + self.entity_name = kwargs.get('entity_name', None) + self.entity_connection_string = kwargs.get('entity_connection_string', None) + self.resource_type = kwargs.get('resource_type', None) + self.resource_connection_string = kwargs.get('resource_connection_string', None) + self.hostname = kwargs.get('hostname', None) + self.port = kwargs.get('port', None) + self.biztalk_uri = kwargs.get('biztalk_uri', None) + + +class Rendering(msrest.serialization.Model): + """Instructions for rendering the data. + + :param type: Rendering Type. Possible values include: "NoGraph", "Table", "TimeSeries", + "TimeSeriesPerInstance". + :type type: str or ~azure.mgmt.web.v2020_06_01.models.RenderingType + :param title: Title of data. + :type title: str + :param description: Description of the data that will help it be interpreted. + :type description: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Rendering, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.title = kwargs.get('title', None) + self.description = kwargs.get('description', None) + + +class RenewCertificateOrderRequest(ProxyOnlyResource): + """Class representing certificate renew request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param key_size: Certificate Key Size. + :type key_size: int + :param csr: Csr to be used for re-key operation. + :type csr: str + :param is_private_key_external: Should we change the ASC type (from managed private key to + external private key and vice versa). + :type is_private_key_external: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(RenewCertificateOrderRequest, self).__init__(**kwargs) + self.key_size = kwargs.get('key_size', None) + self.csr = kwargs.get('csr', None) + self.is_private_key_external = kwargs.get('is_private_key_external', None) + + +class RequestsBasedTrigger(msrest.serialization.Model): + """Trigger based on total requests. + + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RequestsBasedTrigger, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.time_interval = kwargs.get('time_interval', None) + + +class ResourceCollection(msrest.serialization.Model): + """Collection of resources. + + 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. + + :param value: Required. Collection of resources. + :type value: list[str] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[str]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class ResourceHealthMetadata(ProxyOnlyResource): + """Used for getting ResourceHealthCheck settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param category: The category that the resource matches in the RHC Policy File. + :type category: str + :param signal_availability: Is there a health signal for the resource. + :type signal_availability: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'signal_availability': {'key': 'properties.signalAvailability', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceHealthMetadata, self).__init__(**kwargs) + self.category = kwargs.get('category', None) + self.signal_availability = kwargs.get('signal_availability', None) + + +class ResourceHealthMetadataCollection(msrest.serialization.Model): + """Collection of resource health metadata. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.ResourceHealthMetadata] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceHealthMetadata]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceHealthMetadataCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class ResourceMetricAvailability(msrest.serialization.Model): + """Metrics availability and retention. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar time_grain: Time grain . + :vartype time_grain: str + :ivar retention: Retention period for the current time grain. + :vartype retention: str + """ + + _validation = { + 'time_grain': {'readonly': True}, + 'retention': {'readonly': True}, + } + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'retention': {'key': 'retention', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceMetricAvailability, self).__init__(**kwargs) + self.time_grain = None + self.retention = None + + +class ResourceMetricDefinition(ProxyOnlyResource): + """Metadata for the metrics. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar unit: Unit of the metric. + :vartype unit: str + :ivar primary_aggregation_type: Primary aggregation type. + :vartype primary_aggregation_type: str + :ivar metric_availabilities: List of time grains supported for the metric together with + retention period. + :vartype metric_availabilities: + list[~azure.mgmt.web.v2020_06_01.models.ResourceMetricAvailability] + :ivar resource_uri: Resource URI. + :vartype resource_uri: str + :ivar properties: Resource metric definition properties. + :vartype properties: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'unit': {'readonly': True}, + 'primary_aggregation_type': {'readonly': True}, + 'metric_availabilities': {'readonly': True}, + 'resource_uri': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'unit': {'key': 'properties.unit', 'type': 'str'}, + 'primary_aggregation_type': {'key': 'properties.primaryAggregationType', 'type': 'str'}, + 'metric_availabilities': {'key': 'properties.metricAvailabilities', 'type': '[ResourceMetricAvailability]'}, + 'resource_uri': {'key': 'properties.resourceUri', 'type': 'str'}, + 'properties': {'key': 'properties.properties', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceMetricDefinition, self).__init__(**kwargs) + self.unit = None + self.primary_aggregation_type = None + self.metric_availabilities = None + self.resource_uri = None + self.properties = None + + +class ResourceMetricDefinitionCollection(msrest.serialization.Model): + """Collection of metric definitions. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.ResourceMetricDefinition] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceMetricDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceMetricDefinitionCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class ResourceNameAvailability(msrest.serialization.Model): + """Information regarding availability of a resource name. + + :param name_available: :code:`true` indicates name is valid and available. + :code:`false` indicates the name is invalid, unavailable, or both. + :type name_available: bool + :param reason: :code:`Invalid` indicates the name provided does not match Azure + App Service naming requirements. :code:`AlreadyExists` indicates that the name is + already in use and is therefore unavailable. Possible values include: "Invalid", + "AlreadyExists". + :type reason: str or ~azure.mgmt.web.v2020_06_01.models.InAvailabilityReasonType + :param message: If reason == invalid, provide the user with the reason why the given name is + invalid, and provide the resource naming requirements so that the user can select a valid name. + If reason == AlreadyExists, explain that resource name is already in use, and direct them to + select a different name. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceNameAvailability, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) + + +class ResourceNameAvailabilityRequest(msrest.serialization.Model): + """Resource name availability request content. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name to verify. + :type name: str + :param type: Required. Resource type used for verification. Possible values include: "Site", + "Slot", "HostingEnvironment", "PublishingUser", "Microsoft.Web/sites", + "Microsoft.Web/sites/slots", "Microsoft.Web/hostingEnvironments", + "Microsoft.Web/publishingUsers". + :type type: str or ~azure.mgmt.web.v2020_06_01.models.CheckNameResourceTypes + :param is_fqdn: Is fully qualified domain name. + :type is_fqdn: bool + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_fqdn': {'key': 'isFqdn', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceNameAvailabilityRequest, self).__init__(**kwargs) + self.name = kwargs['name'] + self.type = kwargs['type'] + self.is_fqdn = kwargs.get('is_fqdn', None) + + +class ResponseMetaData(msrest.serialization.Model): + """ResponseMetaData. + + :param data_source: Source of the Data. + :type data_source: ~azure.mgmt.web.v2020_06_01.models.DataSource + """ + + _attribute_map = { + 'data_source': {'key': 'dataSource', 'type': 'DataSource'}, + } + + def __init__( + self, + **kwargs + ): + super(ResponseMetaData, self).__init__(**kwargs) + self.data_source = kwargs.get('data_source', None) + + +class RestoreRequest(ProxyOnlyResource): + """Description of a restore request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param storage_account_url: SAS URL to the container. + :type storage_account_url: str + :param blob_name: Name of a blob which contains the backup. + :type blob_name: str + :param overwrite: :code:`true` if the restore operation can overwrite target app; + otherwise, :code:`false`. :code:`true` is needed if trying to restore + over an existing app. + :type overwrite: bool + :param site_name: Name of an app. + :type site_name: str + :param databases: Collection of databases which should be restored. This list has to match the + list of databases included in the backup. + :type databases: list[~azure.mgmt.web.v2020_06_01.models.DatabaseBackupSetting] + :param ignore_conflicting_host_names: Changes a logic when restoring an app with custom + domains. :code:`true` to remove custom domains automatically. If + :code:`false`, custom domains are added to + the app's object when it is being restored, but that might fail due to conflicts during the + operation. + :type ignore_conflicting_host_names: bool + :param ignore_databases: Ignore the databases and only restore the site content. + :type ignore_databases: bool + :param app_service_plan: Specify app service plan that will own restored site. + :type app_service_plan: str + :param operation_type: Operation type. Possible values include: "Default", "Clone", + "Relocation", "Snapshot", "CloudFS". Default value: "Default". + :type operation_type: str or ~azure.mgmt.web.v2020_06_01.models.BackupRestoreOperationType + :param adjust_connection_strings: :code:`true` if SiteConfig.ConnectionStrings + should be set in new app; otherwise, :code:`false`. + :type adjust_connection_strings: bool + :param hosting_environment: App Service Environment name, if needed (only when restoring an app + to an App Service Environment). + :type hosting_environment: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'storage_account_url': {'key': 'properties.storageAccountUrl', 'type': 'str'}, + 'blob_name': {'key': 'properties.blobName', 'type': 'str'}, + 'overwrite': {'key': 'properties.overwrite', 'type': 'bool'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'databases': {'key': 'properties.databases', 'type': '[DatabaseBackupSetting]'}, + 'ignore_conflicting_host_names': {'key': 'properties.ignoreConflictingHostNames', 'type': 'bool'}, + 'ignore_databases': {'key': 'properties.ignoreDatabases', 'type': 'bool'}, + 'app_service_plan': {'key': 'properties.appServicePlan', 'type': 'str'}, + 'operation_type': {'key': 'properties.operationType', 'type': 'str'}, + 'adjust_connection_strings': {'key': 'properties.adjustConnectionStrings', 'type': 'bool'}, + 'hosting_environment': {'key': 'properties.hostingEnvironment', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RestoreRequest, self).__init__(**kwargs) + self.storage_account_url = kwargs.get('storage_account_url', None) + self.blob_name = kwargs.get('blob_name', None) + self.overwrite = kwargs.get('overwrite', None) + self.site_name = kwargs.get('site_name', None) + self.databases = kwargs.get('databases', None) + self.ignore_conflicting_host_names = kwargs.get('ignore_conflicting_host_names', False) + self.ignore_databases = kwargs.get('ignore_databases', False) + self.app_service_plan = kwargs.get('app_service_plan', None) + self.operation_type = kwargs.get('operation_type', "Default") + self.adjust_connection_strings = kwargs.get('adjust_connection_strings', None) + self.hosting_environment = kwargs.get('hosting_environment', None) + + +class ServiceSpecification(msrest.serialization.Model): + """Resource metrics service provided by Microsoft.Insights resource provider. + + :param metric_specifications: + :type metric_specifications: list[~azure.mgmt.web.v2020_06_01.models.MetricSpecification] + :param log_specifications: + :type log_specifications: list[~azure.mgmt.web.v2020_06_01.models.LogSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + self.log_specifications = kwargs.get('log_specifications', None) + + +class Site(Resource): + """A web app, a mobile app backend, or an API app. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param identity: Managed service identity. + :type identity: ~azure.mgmt.web.v2020_06_01.models.ManagedServiceIdentity + :ivar state: Current state of the app. + :vartype state: str + :ivar host_names: Hostnames associated with the app. + :vartype host_names: list[str] + :ivar repository_site_name: Name of the repository site. + :vartype repository_site_name: str + :ivar usage_state: State indicating whether the app has exceeded its quota usage. Read-only. + Possible values include: "Normal", "Exceeded". + :vartype usage_state: str or ~azure.mgmt.web.v2020_06_01.models.UsageState + :param enabled: :code:`true` if the app is enabled; otherwise, + :code:`false`. Setting this value to false disables the app (takes the app + offline). + :type enabled: bool + :ivar enabled_host_names: Enabled hostnames for the app.Hostnames need to be assigned (see + HostNames) AND enabled. Otherwise, + the app is not served on those hostnames. + :vartype enabled_host_names: list[str] + :ivar availability_state: Management information availability state for the app. Possible + values include: "Normal", "Limited", "DisasterRecoveryMode". + :vartype availability_state: str or ~azure.mgmt.web.v2020_06_01.models.SiteAvailabilityState + :param host_name_ssl_states: Hostname SSL states are used to manage the SSL bindings for app's + hostnames. + :type host_name_ssl_states: list[~azure.mgmt.web.v2020_06_01.models.HostNameSslState] + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param reserved: :code:`true` if reserved; otherwise, :code:`false`. + :type reserved: bool + :param is_xenon: Obsolete: Hyper-V sandbox. + :type is_xenon: bool + :param hyper_v: Hyper-V sandbox. + :type hyper_v: bool + :ivar last_modified_time_utc: Last time the app was modified, in UTC. Read-only. + :vartype last_modified_time_utc: ~datetime.datetime + :param site_config: Configuration of the app. + :type site_config: ~azure.mgmt.web.v2020_06_01.models.SiteConfig + :ivar traffic_manager_host_names: Azure Traffic Manager hostnames associated with the app. + Read-only. + :vartype traffic_manager_host_names: list[str] + :param scm_site_also_stopped: :code:`true` to stop SCM (KUDU) site when the app is + stopped; otherwise, :code:`false`. The default is :code:`false`. + :type scm_site_also_stopped: bool + :ivar target_swap_slot: Specifies which deployment slot this app will swap into. Read-only. + :vartype target_swap_slot: str + :param hosting_environment_profile: App Service Environment to use for the app. + :type hosting_environment_profile: ~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentProfile + :param client_affinity_enabled: :code:`true` to enable client affinity; + :code:`false` to stop sending session affinity cookies, which route client + requests in the same session to the same instance. Default is :code:`true`. + :type client_affinity_enabled: bool + :param client_cert_enabled: :code:`true` to enable client certificate + authentication (TLS mutual authentication); otherwise, :code:`false`. Default is + :code:`false`. + :type client_cert_enabled: bool + :param client_cert_mode: This composes with ClientCertEnabled setting. + + + * ClientCertEnabled: false means ClientCert is ignored. + * ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + * ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or + accepted. Possible values include: "Required", "Optional". + :type client_cert_mode: str or ~azure.mgmt.web.v2020_06_01.models.ClientCertMode + :param client_cert_exclusion_paths: client certificate authentication comma-separated exclusion + paths. + :type client_cert_exclusion_paths: str + :param host_names_disabled: :code:`true` to disable the public hostnames of the + app; otherwise, :code:`false`. + If :code:`true`, the app is only accessible via API management process. + :type host_names_disabled: bool + :param custom_domain_verification_id: Unique identifier that verifies the custom domains + assigned to the app. Customer will add this id to a txt record for verification. + :type custom_domain_verification_id: str + :ivar outbound_ip_addresses: List of IP addresses that the app uses for outbound connections + (e.g. database access). Includes VIPs from tenants that site can be hosted with current + settings. Read-only. + :vartype outbound_ip_addresses: str + :ivar possible_outbound_ip_addresses: List of IP addresses that the app uses for outbound + connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read- + only. + :vartype possible_outbound_ip_addresses: str + :param container_size: Size of the function container. + :type container_size: int + :param daily_memory_time_quota: Maximum allowed daily memory-time quota (applicable on dynamic + apps only). + :type daily_memory_time_quota: int + :ivar suspended_till: App suspended till in case memory-time quota is exceeded. + :vartype suspended_till: ~datetime.datetime + :ivar max_number_of_workers: Maximum number of workers. + This only applies to Functions container. + :vartype max_number_of_workers: int + :param cloning_info: If specified during app creation, the app is cloned from a source app. + :type cloning_info: ~azure.mgmt.web.v2020_06_01.models.CloningInfo + :ivar resource_group: Name of the resource group the app belongs to. Read-only. + :vartype resource_group: str + :ivar is_default_container: :code:`true` if the app is a default container; + otherwise, :code:`false`. + :vartype is_default_container: bool + :ivar default_host_name: Default hostname of the app. Read-only. + :vartype default_host_name: str + :ivar slot_swap_status: Status of the last deployment slot swap operation. + :vartype slot_swap_status: ~azure.mgmt.web.v2020_06_01.models.SlotSwapStatus + :param https_only: HttpsOnly: configures a web site to accept only https requests. Issues + redirect for + http requests. + :type https_only: bool + :param redundancy_mode: Site redundancy mode. Possible values include: "None", "Manual", + "Failover", "ActiveActive", "GeoRedundant". + :type redundancy_mode: str or ~azure.mgmt.web.v2020_06_01.models.RedundancyMode + :ivar in_progress_operation_id: Specifies an operation id if this site has a pending operation. + :vartype in_progress_operation_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'host_names': {'readonly': True}, + 'repository_site_name': {'readonly': True}, + 'usage_state': {'readonly': True}, + 'enabled_host_names': {'readonly': True}, + 'availability_state': {'readonly': True}, + 'last_modified_time_utc': {'readonly': True}, + 'traffic_manager_host_names': {'readonly': True}, + 'target_swap_slot': {'readonly': True}, + 'outbound_ip_addresses': {'readonly': True}, + 'possible_outbound_ip_addresses': {'readonly': True}, + 'suspended_till': {'readonly': True}, + 'max_number_of_workers': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'is_default_container': {'readonly': True}, + 'default_host_name': {'readonly': True}, + 'slot_swap_status': {'readonly': True}, + 'in_progress_operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'repository_site_name': {'key': 'properties.repositorySiteName', 'type': 'str'}, + 'usage_state': {'key': 'properties.usageState', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'enabled_host_names': {'key': 'properties.enabledHostNames', 'type': '[str]'}, + 'availability_state': {'key': 'properties.availabilityState', 'type': 'str'}, + 'host_name_ssl_states': {'key': 'properties.hostNameSslStates', 'type': '[HostNameSslState]'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'last_modified_time_utc': {'key': 'properties.lastModifiedTimeUtc', 'type': 'iso-8601'}, + 'site_config': {'key': 'properties.siteConfig', 'type': 'SiteConfig'}, + 'traffic_manager_host_names': {'key': 'properties.trafficManagerHostNames', 'type': '[str]'}, + 'scm_site_also_stopped': {'key': 'properties.scmSiteAlsoStopped', 'type': 'bool'}, + 'target_swap_slot': {'key': 'properties.targetSwapSlot', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'client_affinity_enabled': {'key': 'properties.clientAffinityEnabled', 'type': 'bool'}, + 'client_cert_enabled': {'key': 'properties.clientCertEnabled', 'type': 'bool'}, + 'client_cert_mode': {'key': 'properties.clientCertMode', 'type': 'str'}, + 'client_cert_exclusion_paths': {'key': 'properties.clientCertExclusionPaths', 'type': 'str'}, + 'host_names_disabled': {'key': 'properties.hostNamesDisabled', 'type': 'bool'}, + 'custom_domain_verification_id': {'key': 'properties.customDomainVerificationId', 'type': 'str'}, + 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': 'str'}, + 'possible_outbound_ip_addresses': {'key': 'properties.possibleOutboundIpAddresses', 'type': 'str'}, + 'container_size': {'key': 'properties.containerSize', 'type': 'int'}, + 'daily_memory_time_quota': {'key': 'properties.dailyMemoryTimeQuota', 'type': 'int'}, + 'suspended_till': {'key': 'properties.suspendedTill', 'type': 'iso-8601'}, + 'max_number_of_workers': {'key': 'properties.maxNumberOfWorkers', 'type': 'int'}, + 'cloning_info': {'key': 'properties.cloningInfo', 'type': 'CloningInfo'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'is_default_container': {'key': 'properties.isDefaultContainer', 'type': 'bool'}, + 'default_host_name': {'key': 'properties.defaultHostName', 'type': 'str'}, + 'slot_swap_status': {'key': 'properties.slotSwapStatus', 'type': 'SlotSwapStatus'}, + 'https_only': {'key': 'properties.httpsOnly', 'type': 'bool'}, + 'redundancy_mode': {'key': 'properties.redundancyMode', 'type': 'str'}, + 'in_progress_operation_id': {'key': 'properties.inProgressOperationId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Site, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.state = None + self.host_names = None + self.repository_site_name = None + self.usage_state = None + self.enabled = kwargs.get('enabled', None) + self.enabled_host_names = None + self.availability_state = None + self.host_name_ssl_states = kwargs.get('host_name_ssl_states', None) + self.server_farm_id = kwargs.get('server_farm_id', None) + self.reserved = kwargs.get('reserved', False) + self.is_xenon = kwargs.get('is_xenon', False) + self.hyper_v = kwargs.get('hyper_v', False) + self.last_modified_time_utc = None + self.site_config = kwargs.get('site_config', None) + self.traffic_manager_host_names = None + self.scm_site_also_stopped = kwargs.get('scm_site_also_stopped', False) + self.target_swap_slot = None + self.hosting_environment_profile = kwargs.get('hosting_environment_profile', None) + self.client_affinity_enabled = kwargs.get('client_affinity_enabled', None) + self.client_cert_enabled = kwargs.get('client_cert_enabled', None) + self.client_cert_mode = kwargs.get('client_cert_mode', None) + self.client_cert_exclusion_paths = kwargs.get('client_cert_exclusion_paths', None) + self.host_names_disabled = kwargs.get('host_names_disabled', None) + self.custom_domain_verification_id = kwargs.get('custom_domain_verification_id', None) + self.outbound_ip_addresses = None + self.possible_outbound_ip_addresses = None + self.container_size = kwargs.get('container_size', None) + self.daily_memory_time_quota = kwargs.get('daily_memory_time_quota', None) + self.suspended_till = None + self.max_number_of_workers = None + self.cloning_info = kwargs.get('cloning_info', None) + self.resource_group = None + self.is_default_container = None + self.default_host_name = None + self.slot_swap_status = None + self.https_only = kwargs.get('https_only', None) + self.redundancy_mode = kwargs.get('redundancy_mode', None) + self.in_progress_operation_id = None + + +class SiteAuthSettings(ProxyOnlyResource): + """Configuration settings for the Azure App Service Authentication / Authorization feature. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: :code:`true` if the Authentication / Authorization feature is + enabled for the current app; otherwise, :code:`false`. + :type enabled: bool + :param runtime_version: The RuntimeVersion of the Authentication / Authorization feature in use + for the current app. + The setting in this value can control the behavior of certain features in the Authentication / + Authorization module. + :type runtime_version: str + :param unauthenticated_client_action: The action to take when an unauthenticated client + attempts to access the app. Possible values include: "RedirectToLoginPage", "AllowAnonymous". + :type unauthenticated_client_action: str or + ~azure.mgmt.web.v2020_06_01.models.UnauthenticatedClientAction + :param token_store_enabled: :code:`true` to durably store platform-specific + security tokens that are obtained during login flows; otherwise, :code:`false`. + The default is :code:`false`. + :type token_store_enabled: bool + :param allowed_external_redirect_urls: External URLs that can be redirected to as part of + logging in or logging out of the app. Note that the query string part of the URL is ignored. + This is an advanced setting typically only needed by Windows Store application backends. + Note that URLs within the current domain are always implicitly allowed. + :type allowed_external_redirect_urls: list[str] + :param default_provider: The default authentication provider to use when multiple providers are + configured. + This setting is only needed if multiple providers are configured and the unauthenticated + client + action is set to "RedirectToLoginPage". Possible values include: "AzureActiveDirectory", + "Facebook", "Google", "MicrosoftAccount", "Twitter", "Github". + :type default_provider: str or ~azure.mgmt.web.v2020_06_01.models.BuiltInAuthenticationProvider + :param token_refresh_extension_hours: The number of hours after session token expiration that a + session token can be used to + call the token refresh API. The default is 72 hours. + :type token_refresh_extension_hours: float + :param client_id: The Client ID of this relying party application, known as the client_id. + This setting is required for enabling OpenID Connection authentication with Azure Active + Directory or + other 3rd party OpenID Connect providers. + More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. + :type client_id: str + :param client_secret: The Client Secret of this relying party application (in Azure Active + Directory, this is also referred to as the Key). + This setting is optional. If no client secret is configured, the OpenID Connect implicit auth + flow is used to authenticate end users. + Otherwise, the OpenID Connect Authorization Code Flow is used to authenticate end users. + More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. + :type client_secret: str + :param client_secret_setting_name: The app setting name that contains the client secret of the + relying party application. + :type client_secret_setting_name: str + :param client_secret_certificate_thumbprint: An alternative to the client secret, that is the + thumbprint of a certificate used for signing purposes. This property acts as + a replacement for the Client Secret. It is also optional. + :type client_secret_certificate_thumbprint: str + :param issuer: The OpenID Connect Issuer URI that represents the entity which issues access + tokens for this application. + When using Azure Active Directory, this value is the URI of the directory tenant, e.g. + https://sts.windows.net/{tenant-guid}/. + This URI is a case-sensitive identifier for the token issuer. + More information on OpenID Connect Discovery: http://openid.net/specs/openid-connect- + discovery-1_0.html. + :type issuer: str + :param validate_issuer: Gets a value indicating whether the issuer should be a valid HTTPS url + and be validated as such. + :type validate_issuer: bool + :param allowed_audiences: Allowed audience values to consider when validating JWTs issued by + Azure Active Directory. Note that the :code:`ClientID` value is always considered + an + allowed audience, regardless of this setting. + :type allowed_audiences: list[str] + :param additional_login_params: Login parameters to send to the OpenID Connect authorization + endpoint when + a user logs in. Each parameter must be in the form "key=value". + :type additional_login_params: list[str] + :param aad_claims_authorization: Gets a JSON string containing the Azure AD Acl settings. + :type aad_claims_authorization: str + :param google_client_id: The OpenID Connect Client ID for the Google web application. + This setting is required for enabling Google Sign-In. + Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + :type google_client_id: str + :param google_client_secret: The client secret associated with the Google web application. + This setting is required for enabling Google Sign-In. + Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + :type google_client_secret: str + :param google_client_secret_setting_name: The app setting name that contains the client secret + associated with + the Google web application. + :type google_client_secret_setting_name: str + :param google_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of Google + Sign-In authentication. + This setting is optional. If not specified, "openid", "profile", and "email" are used as + default scopes. + Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + :type google_o_auth_scopes: list[str] + :param facebook_app_id: The App ID of the Facebook app used for login. + This setting is required for enabling Facebook Login. + Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + :type facebook_app_id: str + :param facebook_app_secret: The App Secret of the Facebook app used for Facebook Login. + This setting is required for enabling Facebook Login. + Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + :type facebook_app_secret: str + :param facebook_app_secret_setting_name: The app setting name that contains the app secret used + for Facebook Login. + :type facebook_app_secret_setting_name: str + :param facebook_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of Facebook + Login authentication. + This setting is optional. + Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + :type facebook_o_auth_scopes: list[str] + :param git_hub_client_id: The Client Id of the GitHub app used for login. + This setting is required for enabling Github login. + :type git_hub_client_id: str + :param git_hub_client_secret: The Client Secret of the GitHub app used for Github Login. + This setting is required for enabling Github login. + :type git_hub_client_secret: str + :param git_hub_client_secret_setting_name: The app setting name that contains the client secret + of the Github + app used for GitHub Login. + :type git_hub_client_secret_setting_name: str + :param git_hub_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of GitHub + Login authentication. + This setting is optional. + :type git_hub_o_auth_scopes: list[str] + :param twitter_consumer_key: The OAuth 1.0a consumer key of the Twitter application used for + sign-in. + This setting is required for enabling Twitter Sign-In. + Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. + :type twitter_consumer_key: str + :param twitter_consumer_secret: The OAuth 1.0a consumer secret of the Twitter application used + for sign-in. + This setting is required for enabling Twitter Sign-In. + Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. + :type twitter_consumer_secret: str + :param twitter_consumer_secret_setting_name: The app setting name that contains the OAuth 1.0a + consumer secret of the Twitter + application used for sign-in. + :type twitter_consumer_secret_setting_name: str + :param microsoft_account_client_id: The OAuth 2.0 client ID that was created for the app used + for authentication. + This setting is required for enabling Microsoft Account authentication. + Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm. + :type microsoft_account_client_id: str + :param microsoft_account_client_secret: The OAuth 2.0 client secret that was created for the + app used for authentication. + This setting is required for enabling Microsoft Account authentication. + Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm. + :type microsoft_account_client_secret: str + :param microsoft_account_client_secret_setting_name: The app setting name containing the OAuth + 2.0 client secret that was created for the + app used for authentication. + :type microsoft_account_client_secret_setting_name: str + :param microsoft_account_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of + Microsoft Account authentication. + This setting is optional. If not specified, "wl.basic" is used as the default scope. + Microsoft Account Scopes and permissions documentation: https://msdn.microsoft.com/en- + us/library/dn631845.aspx. + :type microsoft_account_o_auth_scopes: list[str] + :param is_auth_from_file: "true" if the auth config settings should be read from a file, + "false" otherwise. + :type is_auth_from_file: str + :param auth_file_path: The path of the config file containing auth settings. + If the path is relative, base will the site's root directory. + :type auth_file_path: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'runtime_version': {'key': 'properties.runtimeVersion', 'type': 'str'}, + 'unauthenticated_client_action': {'key': 'properties.unauthenticatedClientAction', 'type': 'str'}, + 'token_store_enabled': {'key': 'properties.tokenStoreEnabled', 'type': 'bool'}, + 'allowed_external_redirect_urls': {'key': 'properties.allowedExternalRedirectUrls', 'type': '[str]'}, + 'default_provider': {'key': 'properties.defaultProvider', 'type': 'str'}, + 'token_refresh_extension_hours': {'key': 'properties.tokenRefreshExtensionHours', 'type': 'float'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_secret_certificate_thumbprint': {'key': 'properties.clientSecretCertificateThumbprint', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'validate_issuer': {'key': 'properties.validateIssuer', 'type': 'bool'}, + 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + 'additional_login_params': {'key': 'properties.additionalLoginParams', 'type': '[str]'}, + 'aad_claims_authorization': {'key': 'properties.aadClaimsAuthorization', 'type': 'str'}, + 'google_client_id': {'key': 'properties.googleClientId', 'type': 'str'}, + 'google_client_secret': {'key': 'properties.googleClientSecret', 'type': 'str'}, + 'google_client_secret_setting_name': {'key': 'properties.googleClientSecretSettingName', 'type': 'str'}, + 'google_o_auth_scopes': {'key': 'properties.googleOAuthScopes', 'type': '[str]'}, + 'facebook_app_id': {'key': 'properties.facebookAppId', 'type': 'str'}, + 'facebook_app_secret': {'key': 'properties.facebookAppSecret', 'type': 'str'}, + 'facebook_app_secret_setting_name': {'key': 'properties.facebookAppSecretSettingName', 'type': 'str'}, + 'facebook_o_auth_scopes': {'key': 'properties.facebookOAuthScopes', 'type': '[str]'}, + 'git_hub_client_id': {'key': 'properties.gitHubClientId', 'type': 'str'}, + 'git_hub_client_secret': {'key': 'properties.gitHubClientSecret', 'type': 'str'}, + 'git_hub_client_secret_setting_name': {'key': 'properties.gitHubClientSecretSettingName', 'type': 'str'}, + 'git_hub_o_auth_scopes': {'key': 'properties.gitHubOAuthScopes', 'type': '[str]'}, + 'twitter_consumer_key': {'key': 'properties.twitterConsumerKey', 'type': 'str'}, + 'twitter_consumer_secret': {'key': 'properties.twitterConsumerSecret', 'type': 'str'}, + 'twitter_consumer_secret_setting_name': {'key': 'properties.twitterConsumerSecretSettingName', 'type': 'str'}, + 'microsoft_account_client_id': {'key': 'properties.microsoftAccountClientId', 'type': 'str'}, + 'microsoft_account_client_secret': {'key': 'properties.microsoftAccountClientSecret', 'type': 'str'}, + 'microsoft_account_client_secret_setting_name': {'key': 'properties.microsoftAccountClientSecretSettingName', 'type': 'str'}, + 'microsoft_account_o_auth_scopes': {'key': 'properties.microsoftAccountOAuthScopes', 'type': '[str]'}, + 'is_auth_from_file': {'key': 'properties.isAuthFromFile', 'type': 'str'}, + 'auth_file_path': {'key': 'properties.authFilePath', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteAuthSettings, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.runtime_version = kwargs.get('runtime_version', None) + self.unauthenticated_client_action = kwargs.get('unauthenticated_client_action', None) + self.token_store_enabled = kwargs.get('token_store_enabled', None) + self.allowed_external_redirect_urls = kwargs.get('allowed_external_redirect_urls', None) + self.default_provider = kwargs.get('default_provider', None) + self.token_refresh_extension_hours = kwargs.get('token_refresh_extension_hours', None) + self.client_id = kwargs.get('client_id', None) + self.client_secret = kwargs.get('client_secret', None) + self.client_secret_setting_name = kwargs.get('client_secret_setting_name', None) + self.client_secret_certificate_thumbprint = kwargs.get('client_secret_certificate_thumbprint', None) + self.issuer = kwargs.get('issuer', None) + self.validate_issuer = kwargs.get('validate_issuer', None) + self.allowed_audiences = kwargs.get('allowed_audiences', None) + self.additional_login_params = kwargs.get('additional_login_params', None) + self.aad_claims_authorization = kwargs.get('aad_claims_authorization', None) + self.google_client_id = kwargs.get('google_client_id', None) + self.google_client_secret = kwargs.get('google_client_secret', None) + self.google_client_secret_setting_name = kwargs.get('google_client_secret_setting_name', None) + self.google_o_auth_scopes = kwargs.get('google_o_auth_scopes', None) + self.facebook_app_id = kwargs.get('facebook_app_id', None) + self.facebook_app_secret = kwargs.get('facebook_app_secret', None) + self.facebook_app_secret_setting_name = kwargs.get('facebook_app_secret_setting_name', None) + self.facebook_o_auth_scopes = kwargs.get('facebook_o_auth_scopes', None) + self.git_hub_client_id = kwargs.get('git_hub_client_id', None) + self.git_hub_client_secret = kwargs.get('git_hub_client_secret', None) + self.git_hub_client_secret_setting_name = kwargs.get('git_hub_client_secret_setting_name', None) + self.git_hub_o_auth_scopes = kwargs.get('git_hub_o_auth_scopes', None) + self.twitter_consumer_key = kwargs.get('twitter_consumer_key', None) + self.twitter_consumer_secret = kwargs.get('twitter_consumer_secret', None) + self.twitter_consumer_secret_setting_name = kwargs.get('twitter_consumer_secret_setting_name', None) + self.microsoft_account_client_id = kwargs.get('microsoft_account_client_id', None) + self.microsoft_account_client_secret = kwargs.get('microsoft_account_client_secret', None) + self.microsoft_account_client_secret_setting_name = kwargs.get('microsoft_account_client_secret_setting_name', None) + self.microsoft_account_o_auth_scopes = kwargs.get('microsoft_account_o_auth_scopes', None) + self.is_auth_from_file = kwargs.get('is_auth_from_file', None) + self.auth_file_path = kwargs.get('auth_file_path', None) + + +class SiteAuthSettingsV2(ProxyOnlyResource): + """SiteAuthSettingsV2. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param platform: + :type platform: ~azure.mgmt.web.v2020_06_01.models.AuthPlatform + :param global_validation: + :type global_validation: ~azure.mgmt.web.v2020_06_01.models.GlobalValidation + :param identity_providers: + :type identity_providers: ~azure.mgmt.web.v2020_06_01.models.IdentityProviders + :param login: + :type login: ~azure.mgmt.web.v2020_06_01.models.Login + :param http_settings: + :type http_settings: ~azure.mgmt.web.v2020_06_01.models.HttpSettings + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'platform': {'key': 'properties.platform', 'type': 'AuthPlatform'}, + 'global_validation': {'key': 'properties.globalValidation', 'type': 'GlobalValidation'}, + 'identity_providers': {'key': 'properties.identityProviders', 'type': 'IdentityProviders'}, + 'login': {'key': 'properties.login', 'type': 'Login'}, + 'http_settings': {'key': 'properties.httpSettings', 'type': 'HttpSettings'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteAuthSettingsV2, self).__init__(**kwargs) + self.platform = kwargs.get('platform', None) + self.global_validation = kwargs.get('global_validation', None) + self.identity_providers = kwargs.get('identity_providers', None) + self.login = kwargs.get('login', None) + self.http_settings = kwargs.get('http_settings', None) + + +class SiteCloneability(msrest.serialization.Model): + """Represents whether or not an app is cloneable. + + :param result: Name of app. Possible values include: "Cloneable", "PartiallyCloneable", + "NotCloneable". + :type result: str or ~azure.mgmt.web.v2020_06_01.models.CloneAbilityResult + :param blocking_features: List of features enabled on app that prevent cloning. + :type blocking_features: list[~azure.mgmt.web.v2020_06_01.models.SiteCloneabilityCriterion] + :param unsupported_features: List of features enabled on app that are non-blocking but cannot + be cloned. The app can still be cloned + but the features in this list will not be set up on cloned app. + :type unsupported_features: list[~azure.mgmt.web.v2020_06_01.models.SiteCloneabilityCriterion] + :param blocking_characteristics: List of blocking application characteristics. + :type blocking_characteristics: + list[~azure.mgmt.web.v2020_06_01.models.SiteCloneabilityCriterion] + """ + + _attribute_map = { + 'result': {'key': 'result', 'type': 'str'}, + 'blocking_features': {'key': 'blockingFeatures', 'type': '[SiteCloneabilityCriterion]'}, + 'unsupported_features': {'key': 'unsupportedFeatures', 'type': '[SiteCloneabilityCriterion]'}, + 'blocking_characteristics': {'key': 'blockingCharacteristics', 'type': '[SiteCloneabilityCriterion]'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteCloneability, self).__init__(**kwargs) + self.result = kwargs.get('result', None) + self.blocking_features = kwargs.get('blocking_features', None) + self.unsupported_features = kwargs.get('unsupported_features', None) + self.blocking_characteristics = kwargs.get('blocking_characteristics', None) + + +class SiteCloneabilityCriterion(msrest.serialization.Model): + """An app cloneability criterion. + + :param name: Name of criterion. + :type name: str + :param description: Description of criterion. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteCloneabilityCriterion, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + + +class SiteConfig(msrest.serialization.Model): + """Configuration of an App Service app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param number_of_workers: Number of workers. + :type number_of_workers: int + :param default_documents: Default documents. + :type default_documents: list[str] + :param net_framework_version: .NET Framework version. + :type net_framework_version: str + :param php_version: Version of PHP. + :type php_version: str + :param python_version: Version of Python. + :type python_version: str + :param node_version: Version of Node.js. + :type node_version: str + :param power_shell_version: Version of PowerShell. + :type power_shell_version: str + :param linux_fx_version: Linux App Framework and version. + :type linux_fx_version: str + :param windows_fx_version: Xenon App Framework and version. + :type windows_fx_version: str + :param request_tracing_enabled: :code:`true` if request tracing is enabled; + otherwise, :code:`false`. + :type request_tracing_enabled: bool + :param request_tracing_expiration_time: Request tracing expiration time. + :type request_tracing_expiration_time: ~datetime.datetime + :param remote_debugging_enabled: :code:`true` if remote debugging is enabled; + otherwise, :code:`false`. + :type remote_debugging_enabled: bool + :param remote_debugging_version: Remote debugging version. + :type remote_debugging_version: str + :param http_logging_enabled: :code:`true` if HTTP logging is enabled; otherwise, + :code:`false`. + :type http_logging_enabled: bool + :param logs_directory_size_limit: HTTP logs directory size limit. + :type logs_directory_size_limit: int + :param detailed_error_logging_enabled: :code:`true` if detailed error logging is + enabled; otherwise, :code:`false`. + :type detailed_error_logging_enabled: bool + :param publishing_username: Publishing user name. + :type publishing_username: str + :param app_settings: Application settings. + :type app_settings: list[~azure.mgmt.web.v2020_06_01.models.NameValuePair] + :param connection_strings: Connection strings. + :type connection_strings: list[~azure.mgmt.web.v2020_06_01.models.ConnStringInfo] + :ivar machine_key: Site MachineKey. + :vartype machine_key: ~azure.mgmt.web.v2020_06_01.models.SiteMachineKey + :param handler_mappings: Handler mappings. + :type handler_mappings: list[~azure.mgmt.web.v2020_06_01.models.HandlerMapping] + :param document_root: Document root. + :type document_root: str + :param scm_type: SCM type. Possible values include: "None", "Dropbox", "Tfs", "LocalGit", + "GitHub", "CodePlexGit", "CodePlexHg", "BitbucketGit", "BitbucketHg", "ExternalGit", + "ExternalHg", "OneDrive", "VSO", "VSTSRM". + :type scm_type: str or ~azure.mgmt.web.v2020_06_01.models.ScmType + :param use32_bit_worker_process: :code:`true` to use 32-bit worker process; + otherwise, :code:`false`. + :type use32_bit_worker_process: bool + :param web_sockets_enabled: :code:`true` if WebSocket is enabled; otherwise, + :code:`false`. + :type web_sockets_enabled: bool + :param always_on: :code:`true` if Always On is enabled; otherwise, + :code:`false`. + :type always_on: bool + :param java_version: Java version. + :type java_version: str + :param java_container: Java container. + :type java_container: str + :param java_container_version: Java container version. + :type java_container_version: str + :param app_command_line: App command line to launch. + :type app_command_line: str + :param managed_pipeline_mode: Managed pipeline mode. Possible values include: "Integrated", + "Classic". + :type managed_pipeline_mode: str or ~azure.mgmt.web.v2020_06_01.models.ManagedPipelineMode + :param virtual_applications: Virtual applications. + :type virtual_applications: list[~azure.mgmt.web.v2020_06_01.models.VirtualApplication] + :param load_balancing: Site load balancing. Possible values include: "WeightedRoundRobin", + "LeastRequests", "LeastResponseTime", "WeightedTotalTraffic", "RequestHash". + :type load_balancing: str or ~azure.mgmt.web.v2020_06_01.models.SiteLoadBalancing + :param experiments: This is work around for polymorphic types. + :type experiments: ~azure.mgmt.web.v2020_06_01.models.Experiments + :param limits: Site limits. + :type limits: ~azure.mgmt.web.v2020_06_01.models.SiteLimits + :param auto_heal_enabled: :code:`true` if Auto Heal is enabled; otherwise, + :code:`false`. + :type auto_heal_enabled: bool + :param auto_heal_rules: Auto Heal rules. + :type auto_heal_rules: ~azure.mgmt.web.v2020_06_01.models.AutoHealRules + :param tracing_options: Tracing options. + :type tracing_options: str + :param vnet_name: Virtual Network name. + :type vnet_name: str + :param vnet_route_all_enabled: Virtual Network Route All enabled. This causes all outbound + traffic to have Virtual Network Security Groups and User Defined Routes applied. + :type vnet_route_all_enabled: bool + :param vnet_private_ports_count: The number of private ports assigned to this app. These will + be assigned dynamically on runtime. + :type vnet_private_ports_count: int + :param cors: Cross-Origin Resource Sharing (CORS) settings. + :type cors: ~azure.mgmt.web.v2020_06_01.models.CorsSettings + :param push: Push endpoint settings. + :type push: ~azure.mgmt.web.v2020_06_01.models.PushSettings + :param api_definition: Information about the formal API definition for the app. + :type api_definition: ~azure.mgmt.web.v2020_06_01.models.ApiDefinitionInfo + :param api_management_config: Azure API management settings linked to the app. + :type api_management_config: ~azure.mgmt.web.v2020_06_01.models.ApiManagementConfig + :param auto_swap_slot_name: Auto-swap slot name. + :type auto_swap_slot_name: str + :param local_my_sql_enabled: :code:`true` to enable local MySQL; otherwise, + :code:`false`. + :type local_my_sql_enabled: bool + :param managed_service_identity_id: Managed Service Identity Id. + :type managed_service_identity_id: int + :param x_managed_service_identity_id: Explicit Managed Service Identity Id. + :type x_managed_service_identity_id: int + :param ip_security_restrictions: IP security restrictions for main. + :type ip_security_restrictions: list[~azure.mgmt.web.v2020_06_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions: IP security restrictions for scm. + :type scm_ip_security_restrictions: + list[~azure.mgmt.web.v2020_06_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions_use_main: IP security restrictions for scm to use main. + :type scm_ip_security_restrictions_use_main: bool + :param http20_enabled: Http20Enabled: configures a web site to allow clients to connect over + http2.0. + :type http20_enabled: bool + :param min_tls_version: MinTlsVersion: configures the minimum version of TLS required for SSL + requests. Possible values include: "1.0", "1.1", "1.2". + :type min_tls_version: str or ~azure.mgmt.web.v2020_06_01.models.SupportedTlsVersions + :param scm_min_tls_version: ScmMinTlsVersion: configures the minimum version of TLS required + for SSL requests for SCM site. Possible values include: "1.0", "1.1", "1.2". + :type scm_min_tls_version: str or ~azure.mgmt.web.v2020_06_01.models.SupportedTlsVersions + :param ftps_state: State of FTP / FTPS service. Possible values include: "AllAllowed", + "FtpsOnly", "Disabled". + :type ftps_state: str or ~azure.mgmt.web.v2020_06_01.models.FtpsState + :param pre_warmed_instance_count: Number of preWarmed instances. + This setting only applies to the Consumption and Elastic Plans. + :type pre_warmed_instance_count: int + :param health_check_path: Health check path. + :type health_check_path: str + """ + + _validation = { + 'machine_key': {'readonly': True}, + 'pre_warmed_instance_count': {'maximum': 10, 'minimum': 0}, + } + + _attribute_map = { + 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, + 'default_documents': {'key': 'defaultDocuments', 'type': '[str]'}, + 'net_framework_version': {'key': 'netFrameworkVersion', 'type': 'str'}, + 'php_version': {'key': 'phpVersion', 'type': 'str'}, + 'python_version': {'key': 'pythonVersion', 'type': 'str'}, + 'node_version': {'key': 'nodeVersion', 'type': 'str'}, + 'power_shell_version': {'key': 'powerShellVersion', 'type': 'str'}, + 'linux_fx_version': {'key': 'linuxFxVersion', 'type': 'str'}, + 'windows_fx_version': {'key': 'windowsFxVersion', 'type': 'str'}, + 'request_tracing_enabled': {'key': 'requestTracingEnabled', 'type': 'bool'}, + 'request_tracing_expiration_time': {'key': 'requestTracingExpirationTime', 'type': 'iso-8601'}, + 'remote_debugging_enabled': {'key': 'remoteDebuggingEnabled', 'type': 'bool'}, + 'remote_debugging_version': {'key': 'remoteDebuggingVersion', 'type': 'str'}, + 'http_logging_enabled': {'key': 'httpLoggingEnabled', 'type': 'bool'}, + 'logs_directory_size_limit': {'key': 'logsDirectorySizeLimit', 'type': 'int'}, + 'detailed_error_logging_enabled': {'key': 'detailedErrorLoggingEnabled', 'type': 'bool'}, + 'publishing_username': {'key': 'publishingUsername', 'type': 'str'}, + 'app_settings': {'key': 'appSettings', 'type': '[NameValuePair]'}, + 'connection_strings': {'key': 'connectionStrings', 'type': '[ConnStringInfo]'}, + 'machine_key': {'key': 'machineKey', 'type': 'SiteMachineKey'}, + 'handler_mappings': {'key': 'handlerMappings', 'type': '[HandlerMapping]'}, + 'document_root': {'key': 'documentRoot', 'type': 'str'}, + 'scm_type': {'key': 'scmType', 'type': 'str'}, + 'use32_bit_worker_process': {'key': 'use32BitWorkerProcess', 'type': 'bool'}, + 'web_sockets_enabled': {'key': 'webSocketsEnabled', 'type': 'bool'}, + 'always_on': {'key': 'alwaysOn', 'type': 'bool'}, + 'java_version': {'key': 'javaVersion', 'type': 'str'}, + 'java_container': {'key': 'javaContainer', 'type': 'str'}, + 'java_container_version': {'key': 'javaContainerVersion', 'type': 'str'}, + 'app_command_line': {'key': 'appCommandLine', 'type': 'str'}, + 'managed_pipeline_mode': {'key': 'managedPipelineMode', 'type': 'str'}, + 'virtual_applications': {'key': 'virtualApplications', 'type': '[VirtualApplication]'}, + 'load_balancing': {'key': 'loadBalancing', 'type': 'str'}, + 'experiments': {'key': 'experiments', 'type': 'Experiments'}, + 'limits': {'key': 'limits', 'type': 'SiteLimits'}, + 'auto_heal_enabled': {'key': 'autoHealEnabled', 'type': 'bool'}, + 'auto_heal_rules': {'key': 'autoHealRules', 'type': 'AutoHealRules'}, + 'tracing_options': {'key': 'tracingOptions', 'type': 'str'}, + 'vnet_name': {'key': 'vnetName', 'type': 'str'}, + 'vnet_route_all_enabled': {'key': 'vnetRouteAllEnabled', 'type': 'bool'}, + 'vnet_private_ports_count': {'key': 'vnetPrivatePortsCount', 'type': 'int'}, + 'cors': {'key': 'cors', 'type': 'CorsSettings'}, + 'push': {'key': 'push', 'type': 'PushSettings'}, + 'api_definition': {'key': 'apiDefinition', 'type': 'ApiDefinitionInfo'}, + 'api_management_config': {'key': 'apiManagementConfig', 'type': 'ApiManagementConfig'}, + 'auto_swap_slot_name': {'key': 'autoSwapSlotName', 'type': 'str'}, + 'local_my_sql_enabled': {'key': 'localMySqlEnabled', 'type': 'bool'}, + 'managed_service_identity_id': {'key': 'managedServiceIdentityId', 'type': 'int'}, + 'x_managed_service_identity_id': {'key': 'xManagedServiceIdentityId', 'type': 'int'}, + 'ip_security_restrictions': {'key': 'ipSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions': {'key': 'scmIpSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions_use_main': {'key': 'scmIpSecurityRestrictionsUseMain', 'type': 'bool'}, + 'http20_enabled': {'key': 'http20Enabled', 'type': 'bool'}, + 'min_tls_version': {'key': 'minTlsVersion', 'type': 'str'}, + 'scm_min_tls_version': {'key': 'scmMinTlsVersion', 'type': 'str'}, + 'ftps_state': {'key': 'ftpsState', 'type': 'str'}, + 'pre_warmed_instance_count': {'key': 'preWarmedInstanceCount', 'type': 'int'}, + 'health_check_path': {'key': 'healthCheckPath', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteConfig, self).__init__(**kwargs) + self.number_of_workers = kwargs.get('number_of_workers', None) + self.default_documents = kwargs.get('default_documents', None) + self.net_framework_version = kwargs.get('net_framework_version', "v4.6") + self.php_version = kwargs.get('php_version', None) + self.python_version = kwargs.get('python_version', None) + self.node_version = kwargs.get('node_version', None) + self.power_shell_version = kwargs.get('power_shell_version', None) + self.linux_fx_version = kwargs.get('linux_fx_version', None) + self.windows_fx_version = kwargs.get('windows_fx_version', None) + self.request_tracing_enabled = kwargs.get('request_tracing_enabled', None) + self.request_tracing_expiration_time = kwargs.get('request_tracing_expiration_time', None) + self.remote_debugging_enabled = kwargs.get('remote_debugging_enabled', None) + self.remote_debugging_version = kwargs.get('remote_debugging_version', None) + self.http_logging_enabled = kwargs.get('http_logging_enabled', None) + self.logs_directory_size_limit = kwargs.get('logs_directory_size_limit', None) + self.detailed_error_logging_enabled = kwargs.get('detailed_error_logging_enabled', None) + self.publishing_username = kwargs.get('publishing_username', None) + self.app_settings = kwargs.get('app_settings', None) + self.connection_strings = kwargs.get('connection_strings', None) + self.machine_key = None + self.handler_mappings = kwargs.get('handler_mappings', None) + self.document_root = kwargs.get('document_root', None) + self.scm_type = kwargs.get('scm_type', None) + self.use32_bit_worker_process = kwargs.get('use32_bit_worker_process', None) + self.web_sockets_enabled = kwargs.get('web_sockets_enabled', None) + self.always_on = kwargs.get('always_on', None) + self.java_version = kwargs.get('java_version', None) + self.java_container = kwargs.get('java_container', None) + self.java_container_version = kwargs.get('java_container_version', None) + self.app_command_line = kwargs.get('app_command_line', None) + self.managed_pipeline_mode = kwargs.get('managed_pipeline_mode', None) + self.virtual_applications = kwargs.get('virtual_applications', None) + self.load_balancing = kwargs.get('load_balancing', None) + self.experiments = kwargs.get('experiments', None) + self.limits = kwargs.get('limits', None) + self.auto_heal_enabled = kwargs.get('auto_heal_enabled', None) + self.auto_heal_rules = kwargs.get('auto_heal_rules', None) + self.tracing_options = kwargs.get('tracing_options', None) + self.vnet_name = kwargs.get('vnet_name', None) + self.vnet_route_all_enabled = kwargs.get('vnet_route_all_enabled', None) + self.vnet_private_ports_count = kwargs.get('vnet_private_ports_count', None) + self.cors = kwargs.get('cors', None) + self.push = kwargs.get('push', None) + self.api_definition = kwargs.get('api_definition', None) + self.api_management_config = kwargs.get('api_management_config', None) + self.auto_swap_slot_name = kwargs.get('auto_swap_slot_name', None) + self.local_my_sql_enabled = kwargs.get('local_my_sql_enabled', False) + self.managed_service_identity_id = kwargs.get('managed_service_identity_id', None) + self.x_managed_service_identity_id = kwargs.get('x_managed_service_identity_id', None) + self.ip_security_restrictions = kwargs.get('ip_security_restrictions', None) + self.scm_ip_security_restrictions = kwargs.get('scm_ip_security_restrictions', None) + self.scm_ip_security_restrictions_use_main = kwargs.get('scm_ip_security_restrictions_use_main', None) + self.http20_enabled = kwargs.get('http20_enabled', True) + self.min_tls_version = kwargs.get('min_tls_version', None) + self.scm_min_tls_version = kwargs.get('scm_min_tls_version', None) + self.ftps_state = kwargs.get('ftps_state', None) + self.pre_warmed_instance_count = kwargs.get('pre_warmed_instance_count', None) + self.health_check_path = kwargs.get('health_check_path', None) + + +class SiteConfigResource(ProxyOnlyResource): + """Web app configuration ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param number_of_workers: Number of workers. + :type number_of_workers: int + :param default_documents: Default documents. + :type default_documents: list[str] + :param net_framework_version: .NET Framework version. + :type net_framework_version: str + :param php_version: Version of PHP. + :type php_version: str + :param python_version: Version of Python. + :type python_version: str + :param node_version: Version of Node.js. + :type node_version: str + :param power_shell_version: Version of PowerShell. + :type power_shell_version: str + :param linux_fx_version: Linux App Framework and version. + :type linux_fx_version: str + :param windows_fx_version: Xenon App Framework and version. + :type windows_fx_version: str + :param request_tracing_enabled: :code:`true` if request tracing is enabled; + otherwise, :code:`false`. + :type request_tracing_enabled: bool + :param request_tracing_expiration_time: Request tracing expiration time. + :type request_tracing_expiration_time: ~datetime.datetime + :param remote_debugging_enabled: :code:`true` if remote debugging is enabled; + otherwise, :code:`false`. + :type remote_debugging_enabled: bool + :param remote_debugging_version: Remote debugging version. + :type remote_debugging_version: str + :param http_logging_enabled: :code:`true` if HTTP logging is enabled; otherwise, + :code:`false`. + :type http_logging_enabled: bool + :param logs_directory_size_limit: HTTP logs directory size limit. + :type logs_directory_size_limit: int + :param detailed_error_logging_enabled: :code:`true` if detailed error logging is + enabled; otherwise, :code:`false`. + :type detailed_error_logging_enabled: bool + :param publishing_username: Publishing user name. + :type publishing_username: str + :param app_settings: Application settings. + :type app_settings: list[~azure.mgmt.web.v2020_06_01.models.NameValuePair] + :param connection_strings: Connection strings. + :type connection_strings: list[~azure.mgmt.web.v2020_06_01.models.ConnStringInfo] + :ivar machine_key: Site MachineKey. + :vartype machine_key: ~azure.mgmt.web.v2020_06_01.models.SiteMachineKey + :param handler_mappings: Handler mappings. + :type handler_mappings: list[~azure.mgmt.web.v2020_06_01.models.HandlerMapping] + :param document_root: Document root. + :type document_root: str + :param scm_type: SCM type. Possible values include: "None", "Dropbox", "Tfs", "LocalGit", + "GitHub", "CodePlexGit", "CodePlexHg", "BitbucketGit", "BitbucketHg", "ExternalGit", + "ExternalHg", "OneDrive", "VSO", "VSTSRM". + :type scm_type: str or ~azure.mgmt.web.v2020_06_01.models.ScmType + :param use32_bit_worker_process: :code:`true` to use 32-bit worker process; + otherwise, :code:`false`. + :type use32_bit_worker_process: bool + :param web_sockets_enabled: :code:`true` if WebSocket is enabled; otherwise, + :code:`false`. + :type web_sockets_enabled: bool + :param always_on: :code:`true` if Always On is enabled; otherwise, + :code:`false`. + :type always_on: bool + :param java_version: Java version. + :type java_version: str + :param java_container: Java container. + :type java_container: str + :param java_container_version: Java container version. + :type java_container_version: str + :param app_command_line: App command line to launch. + :type app_command_line: str + :param managed_pipeline_mode: Managed pipeline mode. Possible values include: "Integrated", + "Classic". + :type managed_pipeline_mode: str or ~azure.mgmt.web.v2020_06_01.models.ManagedPipelineMode + :param virtual_applications: Virtual applications. + :type virtual_applications: list[~azure.mgmt.web.v2020_06_01.models.VirtualApplication] + :param load_balancing: Site load balancing. Possible values include: "WeightedRoundRobin", + "LeastRequests", "LeastResponseTime", "WeightedTotalTraffic", "RequestHash". + :type load_balancing: str or ~azure.mgmt.web.v2020_06_01.models.SiteLoadBalancing + :param experiments: This is work around for polymorphic types. + :type experiments: ~azure.mgmt.web.v2020_06_01.models.Experiments + :param limits: Site limits. + :type limits: ~azure.mgmt.web.v2020_06_01.models.SiteLimits + :param auto_heal_enabled: :code:`true` if Auto Heal is enabled; otherwise, + :code:`false`. + :type auto_heal_enabled: bool + :param auto_heal_rules: Auto Heal rules. + :type auto_heal_rules: ~azure.mgmt.web.v2020_06_01.models.AutoHealRules + :param tracing_options: Tracing options. + :type tracing_options: str + :param vnet_name: Virtual Network name. + :type vnet_name: str + :param vnet_route_all_enabled: Virtual Network Route All enabled. This causes all outbound + traffic to have Virtual Network Security Groups and User Defined Routes applied. + :type vnet_route_all_enabled: bool + :param vnet_private_ports_count: The number of private ports assigned to this app. These will + be assigned dynamically on runtime. + :type vnet_private_ports_count: int + :param cors: Cross-Origin Resource Sharing (CORS) settings. + :type cors: ~azure.mgmt.web.v2020_06_01.models.CorsSettings + :param push: Push endpoint settings. + :type push: ~azure.mgmt.web.v2020_06_01.models.PushSettings + :param api_definition: Information about the formal API definition for the app. + :type api_definition: ~azure.mgmt.web.v2020_06_01.models.ApiDefinitionInfo + :param api_management_config: Azure API management settings linked to the app. + :type api_management_config: ~azure.mgmt.web.v2020_06_01.models.ApiManagementConfig + :param auto_swap_slot_name: Auto-swap slot name. + :type auto_swap_slot_name: str + :param local_my_sql_enabled: :code:`true` to enable local MySQL; otherwise, + :code:`false`. + :type local_my_sql_enabled: bool + :param managed_service_identity_id: Managed Service Identity Id. + :type managed_service_identity_id: int + :param x_managed_service_identity_id: Explicit Managed Service Identity Id. + :type x_managed_service_identity_id: int + :param ip_security_restrictions: IP security restrictions for main. + :type ip_security_restrictions: list[~azure.mgmt.web.v2020_06_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions: IP security restrictions for scm. + :type scm_ip_security_restrictions: + list[~azure.mgmt.web.v2020_06_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions_use_main: IP security restrictions for scm to use main. + :type scm_ip_security_restrictions_use_main: bool + :param http20_enabled: Http20Enabled: configures a web site to allow clients to connect over + http2.0. + :type http20_enabled: bool + :param min_tls_version: MinTlsVersion: configures the minimum version of TLS required for SSL + requests. Possible values include: "1.0", "1.1", "1.2". + :type min_tls_version: str or ~azure.mgmt.web.v2020_06_01.models.SupportedTlsVersions + :param scm_min_tls_version: ScmMinTlsVersion: configures the minimum version of TLS required + for SSL requests for SCM site. Possible values include: "1.0", "1.1", "1.2". + :type scm_min_tls_version: str or ~azure.mgmt.web.v2020_06_01.models.SupportedTlsVersions + :param ftps_state: State of FTP / FTPS service. Possible values include: "AllAllowed", + "FtpsOnly", "Disabled". + :type ftps_state: str or ~azure.mgmt.web.v2020_06_01.models.FtpsState + :param pre_warmed_instance_count: Number of preWarmed instances. + This setting only applies to the Consumption and Elastic Plans. + :type pre_warmed_instance_count: int + :param health_check_path: Health check path. + :type health_check_path: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'machine_key': {'readonly': True}, + 'pre_warmed_instance_count': {'maximum': 10, 'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'number_of_workers': {'key': 'properties.numberOfWorkers', 'type': 'int'}, + 'default_documents': {'key': 'properties.defaultDocuments', 'type': '[str]'}, + 'net_framework_version': {'key': 'properties.netFrameworkVersion', 'type': 'str'}, + 'php_version': {'key': 'properties.phpVersion', 'type': 'str'}, + 'python_version': {'key': 'properties.pythonVersion', 'type': 'str'}, + 'node_version': {'key': 'properties.nodeVersion', 'type': 'str'}, + 'power_shell_version': {'key': 'properties.powerShellVersion', 'type': 'str'}, + 'linux_fx_version': {'key': 'properties.linuxFxVersion', 'type': 'str'}, + 'windows_fx_version': {'key': 'properties.windowsFxVersion', 'type': 'str'}, + 'request_tracing_enabled': {'key': 'properties.requestTracingEnabled', 'type': 'bool'}, + 'request_tracing_expiration_time': {'key': 'properties.requestTracingExpirationTime', 'type': 'iso-8601'}, + 'remote_debugging_enabled': {'key': 'properties.remoteDebuggingEnabled', 'type': 'bool'}, + 'remote_debugging_version': {'key': 'properties.remoteDebuggingVersion', 'type': 'str'}, + 'http_logging_enabled': {'key': 'properties.httpLoggingEnabled', 'type': 'bool'}, + 'logs_directory_size_limit': {'key': 'properties.logsDirectorySizeLimit', 'type': 'int'}, + 'detailed_error_logging_enabled': {'key': 'properties.detailedErrorLoggingEnabled', 'type': 'bool'}, + 'publishing_username': {'key': 'properties.publishingUsername', 'type': 'str'}, + 'app_settings': {'key': 'properties.appSettings', 'type': '[NameValuePair]'}, + 'connection_strings': {'key': 'properties.connectionStrings', 'type': '[ConnStringInfo]'}, + 'machine_key': {'key': 'properties.machineKey', 'type': 'SiteMachineKey'}, + 'handler_mappings': {'key': 'properties.handlerMappings', 'type': '[HandlerMapping]'}, + 'document_root': {'key': 'properties.documentRoot', 'type': 'str'}, + 'scm_type': {'key': 'properties.scmType', 'type': 'str'}, + 'use32_bit_worker_process': {'key': 'properties.use32BitWorkerProcess', 'type': 'bool'}, + 'web_sockets_enabled': {'key': 'properties.webSocketsEnabled', 'type': 'bool'}, + 'always_on': {'key': 'properties.alwaysOn', 'type': 'bool'}, + 'java_version': {'key': 'properties.javaVersion', 'type': 'str'}, + 'java_container': {'key': 'properties.javaContainer', 'type': 'str'}, + 'java_container_version': {'key': 'properties.javaContainerVersion', 'type': 'str'}, + 'app_command_line': {'key': 'properties.appCommandLine', 'type': 'str'}, + 'managed_pipeline_mode': {'key': 'properties.managedPipelineMode', 'type': 'str'}, + 'virtual_applications': {'key': 'properties.virtualApplications', 'type': '[VirtualApplication]'}, + 'load_balancing': {'key': 'properties.loadBalancing', 'type': 'str'}, + 'experiments': {'key': 'properties.experiments', 'type': 'Experiments'}, + 'limits': {'key': 'properties.limits', 'type': 'SiteLimits'}, + 'auto_heal_enabled': {'key': 'properties.autoHealEnabled', 'type': 'bool'}, + 'auto_heal_rules': {'key': 'properties.autoHealRules', 'type': 'AutoHealRules'}, + 'tracing_options': {'key': 'properties.tracingOptions', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_route_all_enabled': {'key': 'properties.vnetRouteAllEnabled', 'type': 'bool'}, + 'vnet_private_ports_count': {'key': 'properties.vnetPrivatePortsCount', 'type': 'int'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsSettings'}, + 'push': {'key': 'properties.push', 'type': 'PushSettings'}, + 'api_definition': {'key': 'properties.apiDefinition', 'type': 'ApiDefinitionInfo'}, + 'api_management_config': {'key': 'properties.apiManagementConfig', 'type': 'ApiManagementConfig'}, + 'auto_swap_slot_name': {'key': 'properties.autoSwapSlotName', 'type': 'str'}, + 'local_my_sql_enabled': {'key': 'properties.localMySqlEnabled', 'type': 'bool'}, + 'managed_service_identity_id': {'key': 'properties.managedServiceIdentityId', 'type': 'int'}, + 'x_managed_service_identity_id': {'key': 'properties.xManagedServiceIdentityId', 'type': 'int'}, + 'ip_security_restrictions': {'key': 'properties.ipSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions': {'key': 'properties.scmIpSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions_use_main': {'key': 'properties.scmIpSecurityRestrictionsUseMain', 'type': 'bool'}, + 'http20_enabled': {'key': 'properties.http20Enabled', 'type': 'bool'}, + 'min_tls_version': {'key': 'properties.minTlsVersion', 'type': 'str'}, + 'scm_min_tls_version': {'key': 'properties.scmMinTlsVersion', 'type': 'str'}, + 'ftps_state': {'key': 'properties.ftpsState', 'type': 'str'}, + 'pre_warmed_instance_count': {'key': 'properties.preWarmedInstanceCount', 'type': 'int'}, + 'health_check_path': {'key': 'properties.healthCheckPath', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteConfigResource, self).__init__(**kwargs) + self.number_of_workers = kwargs.get('number_of_workers', None) + self.default_documents = kwargs.get('default_documents', None) + self.net_framework_version = kwargs.get('net_framework_version', "v4.6") + self.php_version = kwargs.get('php_version', None) + self.python_version = kwargs.get('python_version', None) + self.node_version = kwargs.get('node_version', None) + self.power_shell_version = kwargs.get('power_shell_version', None) + self.linux_fx_version = kwargs.get('linux_fx_version', None) + self.windows_fx_version = kwargs.get('windows_fx_version', None) + self.request_tracing_enabled = kwargs.get('request_tracing_enabled', None) + self.request_tracing_expiration_time = kwargs.get('request_tracing_expiration_time', None) + self.remote_debugging_enabled = kwargs.get('remote_debugging_enabled', None) + self.remote_debugging_version = kwargs.get('remote_debugging_version', None) + self.http_logging_enabled = kwargs.get('http_logging_enabled', None) + self.logs_directory_size_limit = kwargs.get('logs_directory_size_limit', None) + self.detailed_error_logging_enabled = kwargs.get('detailed_error_logging_enabled', None) + self.publishing_username = kwargs.get('publishing_username', None) + self.app_settings = kwargs.get('app_settings', None) + self.connection_strings = kwargs.get('connection_strings', None) + self.machine_key = None + self.handler_mappings = kwargs.get('handler_mappings', None) + self.document_root = kwargs.get('document_root', None) + self.scm_type = kwargs.get('scm_type', None) + self.use32_bit_worker_process = kwargs.get('use32_bit_worker_process', None) + self.web_sockets_enabled = kwargs.get('web_sockets_enabled', None) + self.always_on = kwargs.get('always_on', None) + self.java_version = kwargs.get('java_version', None) + self.java_container = kwargs.get('java_container', None) + self.java_container_version = kwargs.get('java_container_version', None) + self.app_command_line = kwargs.get('app_command_line', None) + self.managed_pipeline_mode = kwargs.get('managed_pipeline_mode', None) + self.virtual_applications = kwargs.get('virtual_applications', None) + self.load_balancing = kwargs.get('load_balancing', None) + self.experiments = kwargs.get('experiments', None) + self.limits = kwargs.get('limits', None) + self.auto_heal_enabled = kwargs.get('auto_heal_enabled', None) + self.auto_heal_rules = kwargs.get('auto_heal_rules', None) + self.tracing_options = kwargs.get('tracing_options', None) + self.vnet_name = kwargs.get('vnet_name', None) + self.vnet_route_all_enabled = kwargs.get('vnet_route_all_enabled', None) + self.vnet_private_ports_count = kwargs.get('vnet_private_ports_count', None) + self.cors = kwargs.get('cors', None) + self.push = kwargs.get('push', None) + self.api_definition = kwargs.get('api_definition', None) + self.api_management_config = kwargs.get('api_management_config', None) + self.auto_swap_slot_name = kwargs.get('auto_swap_slot_name', None) + self.local_my_sql_enabled = kwargs.get('local_my_sql_enabled', False) + self.managed_service_identity_id = kwargs.get('managed_service_identity_id', None) + self.x_managed_service_identity_id = kwargs.get('x_managed_service_identity_id', None) + self.ip_security_restrictions = kwargs.get('ip_security_restrictions', None) + self.scm_ip_security_restrictions = kwargs.get('scm_ip_security_restrictions', None) + self.scm_ip_security_restrictions_use_main = kwargs.get('scm_ip_security_restrictions_use_main', None) + self.http20_enabled = kwargs.get('http20_enabled', True) + self.min_tls_version = kwargs.get('min_tls_version', None) + self.scm_min_tls_version = kwargs.get('scm_min_tls_version', None) + self.ftps_state = kwargs.get('ftps_state', None) + self.pre_warmed_instance_count = kwargs.get('pre_warmed_instance_count', None) + self.health_check_path = kwargs.get('health_check_path', None) + + +class SiteConfigResourceCollection(msrest.serialization.Model): + """Collection of site configurations. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.SiteConfigResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SiteConfigResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteConfigResourceCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class SiteConfigurationSnapshotInfo(ProxyOnlyResource): + """A snapshot of a web app configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar time: The time the snapshot was taken. + :vartype time: ~datetime.datetime + :ivar snapshot_id: The id of the snapshot. + :vartype snapshot_id: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'time': {'readonly': True}, + 'snapshot_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'iso-8601'}, + 'snapshot_id': {'key': 'properties.snapshotId', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteConfigurationSnapshotInfo, self).__init__(**kwargs) + self.time = None + self.snapshot_id = None + + +class SiteConfigurationSnapshotInfoCollection(msrest.serialization.Model): + """Collection of metadata for the app configuration snapshots that can be restored. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.SiteConfigurationSnapshotInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SiteConfigurationSnapshotInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteConfigurationSnapshotInfoCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class SiteExtensionInfo(ProxyOnlyResource): + """Site Extension Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param extension_id: Site extension ID. + :type extension_id: str + :param title: + :type title: str + :param extension_type: Site extension type. Possible values include: "Gallery", "WebRoot". + :type extension_type: str or ~azure.mgmt.web.v2020_06_01.models.SiteExtensionType + :param summary: Summary description. + :type summary: str + :param description: Detailed description. + :type description: str + :param version: Version information. + :type version: str + :param extension_url: Extension URL. + :type extension_url: str + :param project_url: Project URL. + :type project_url: str + :param icon_url: Icon URL. + :type icon_url: str + :param license_url: License URL. + :type license_url: str + :param feed_url: Feed URL. + :type feed_url: str + :param authors: List of authors. + :type authors: list[str] + :param installer_command_line_params: Installer command line parameters. + :type installer_command_line_params: str + :param published_date_time: Published timestamp. + :type published_date_time: ~datetime.datetime + :param download_count: Count of downloads. + :type download_count: int + :param local_is_latest_version: :code:`true` if the local version is the latest + version; :code:`false` otherwise. + :type local_is_latest_version: bool + :param local_path: Local path. + :type local_path: str + :param installed_date_time: Installed timestamp. + :type installed_date_time: ~datetime.datetime + :param provisioning_state: Provisioning state. + :type provisioning_state: str + :param comment: Site Extension comment. + :type comment: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'extension_id': {'key': 'properties.extension_id', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'extension_type': {'key': 'properties.extension_type', 'type': 'str'}, + 'summary': {'key': 'properties.summary', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'extension_url': {'key': 'properties.extension_url', 'type': 'str'}, + 'project_url': {'key': 'properties.project_url', 'type': 'str'}, + 'icon_url': {'key': 'properties.icon_url', 'type': 'str'}, + 'license_url': {'key': 'properties.license_url', 'type': 'str'}, + 'feed_url': {'key': 'properties.feed_url', 'type': 'str'}, + 'authors': {'key': 'properties.authors', 'type': '[str]'}, + 'installer_command_line_params': {'key': 'properties.installer_command_line_params', 'type': 'str'}, + 'published_date_time': {'key': 'properties.published_date_time', 'type': 'iso-8601'}, + 'download_count': {'key': 'properties.download_count', 'type': 'int'}, + 'local_is_latest_version': {'key': 'properties.local_is_latest_version', 'type': 'bool'}, + 'local_path': {'key': 'properties.local_path', 'type': 'str'}, + 'installed_date_time': {'key': 'properties.installed_date_time', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'comment': {'key': 'properties.comment', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteExtensionInfo, self).__init__(**kwargs) + self.extension_id = kwargs.get('extension_id', None) + self.title = kwargs.get('title', None) + self.extension_type = kwargs.get('extension_type', None) + self.summary = kwargs.get('summary', None) + self.description = kwargs.get('description', None) + self.version = kwargs.get('version', None) + self.extension_url = kwargs.get('extension_url', None) + self.project_url = kwargs.get('project_url', None) + self.icon_url = kwargs.get('icon_url', None) + self.license_url = kwargs.get('license_url', None) + self.feed_url = kwargs.get('feed_url', None) + self.authors = kwargs.get('authors', None) + self.installer_command_line_params = kwargs.get('installer_command_line_params', None) + self.published_date_time = kwargs.get('published_date_time', None) + self.download_count = kwargs.get('download_count', None) + self.local_is_latest_version = kwargs.get('local_is_latest_version', None) + self.local_path = kwargs.get('local_path', None) + self.installed_date_time = kwargs.get('installed_date_time', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.comment = kwargs.get('comment', None) + + +class SiteExtensionInfoCollection(msrest.serialization.Model): + """Collection of Kudu site extension information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.SiteExtensionInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SiteExtensionInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteExtensionInfoCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class SiteLimits(msrest.serialization.Model): + """Metric limits set on an app. + + :param max_percentage_cpu: Maximum allowed CPU usage percentage. + :type max_percentage_cpu: float + :param max_memory_in_mb: Maximum allowed memory usage in MB. + :type max_memory_in_mb: long + :param max_disk_size_in_mb: Maximum allowed disk size usage in MB. + :type max_disk_size_in_mb: long + """ + + _attribute_map = { + 'max_percentage_cpu': {'key': 'maxPercentageCpu', 'type': 'float'}, + 'max_memory_in_mb': {'key': 'maxMemoryInMb', 'type': 'long'}, + 'max_disk_size_in_mb': {'key': 'maxDiskSizeInMb', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteLimits, self).__init__(**kwargs) + self.max_percentage_cpu = kwargs.get('max_percentage_cpu', None) + self.max_memory_in_mb = kwargs.get('max_memory_in_mb', None) + self.max_disk_size_in_mb = kwargs.get('max_disk_size_in_mb', None) + + +class SiteLogsConfig(ProxyOnlyResource): + """Configuration of App Service site logs. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param application_logs: Application logs configuration. + :type application_logs: ~azure.mgmt.web.v2020_06_01.models.ApplicationLogsConfig + :param http_logs: HTTP logs configuration. + :type http_logs: ~azure.mgmt.web.v2020_06_01.models.HttpLogsConfig + :param failed_requests_tracing: Failed requests tracing configuration. + :type failed_requests_tracing: ~azure.mgmt.web.v2020_06_01.models.EnabledConfig + :param detailed_error_messages: Detailed error messages configuration. + :type detailed_error_messages: ~azure.mgmt.web.v2020_06_01.models.EnabledConfig + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'application_logs': {'key': 'properties.applicationLogs', 'type': 'ApplicationLogsConfig'}, + 'http_logs': {'key': 'properties.httpLogs', 'type': 'HttpLogsConfig'}, + 'failed_requests_tracing': {'key': 'properties.failedRequestsTracing', 'type': 'EnabledConfig'}, + 'detailed_error_messages': {'key': 'properties.detailedErrorMessages', 'type': 'EnabledConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteLogsConfig, self).__init__(**kwargs) + self.application_logs = kwargs.get('application_logs', None) + self.http_logs = kwargs.get('http_logs', None) + self.failed_requests_tracing = kwargs.get('failed_requests_tracing', None) + self.detailed_error_messages = kwargs.get('detailed_error_messages', None) + + +class SiteMachineKey(msrest.serialization.Model): + """MachineKey of an app. + + :param validation: MachineKey validation. + :type validation: str + :param validation_key: Validation key. + :type validation_key: str + :param decryption: Algorithm used for decryption. + :type decryption: str + :param decryption_key: Decryption key. + :type decryption_key: str + """ + + _attribute_map = { + 'validation': {'key': 'validation', 'type': 'str'}, + 'validation_key': {'key': 'validationKey', 'type': 'str'}, + 'decryption': {'key': 'decryption', 'type': 'str'}, + 'decryption_key': {'key': 'decryptionKey', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteMachineKey, self).__init__(**kwargs) + self.validation = kwargs.get('validation', None) + self.validation_key = kwargs.get('validation_key', None) + self.decryption = kwargs.get('decryption', None) + self.decryption_key = kwargs.get('decryption_key', None) + + +class SitePatchResource(ProxyOnlyResource): + """ARM resource for a site. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param identity: Managed service identity. + :type identity: ~azure.mgmt.web.v2020_06_01.models.ManagedServiceIdentity + :ivar state: Current state of the app. + :vartype state: str + :ivar host_names: Hostnames associated with the app. + :vartype host_names: list[str] + :ivar repository_site_name: Name of the repository site. + :vartype repository_site_name: str + :ivar usage_state: State indicating whether the app has exceeded its quota usage. Read-only. + Possible values include: "Normal", "Exceeded". + :vartype usage_state: str or ~azure.mgmt.web.v2020_06_01.models.UsageState + :param enabled: :code:`true` if the app is enabled; otherwise, + :code:`false`. Setting this value to false disables the app (takes the app + offline). + :type enabled: bool + :ivar enabled_host_names: Enabled hostnames for the app.Hostnames need to be assigned (see + HostNames) AND enabled. Otherwise, + the app is not served on those hostnames. + :vartype enabled_host_names: list[str] + :ivar availability_state: Management information availability state for the app. Possible + values include: "Normal", "Limited", "DisasterRecoveryMode". + :vartype availability_state: str or ~azure.mgmt.web.v2020_06_01.models.SiteAvailabilityState + :param host_name_ssl_states: Hostname SSL states are used to manage the SSL bindings for app's + hostnames. + :type host_name_ssl_states: list[~azure.mgmt.web.v2020_06_01.models.HostNameSslState] + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param reserved: :code:`true` if reserved; otherwise, :code:`false`. + :type reserved: bool + :param is_xenon: Obsolete: Hyper-V sandbox. + :type is_xenon: bool + :param hyper_v: Hyper-V sandbox. + :type hyper_v: bool + :ivar last_modified_time_utc: Last time the app was modified, in UTC. Read-only. + :vartype last_modified_time_utc: ~datetime.datetime + :param site_config: Configuration of the app. + :type site_config: ~azure.mgmt.web.v2020_06_01.models.SiteConfig + :ivar traffic_manager_host_names: Azure Traffic Manager hostnames associated with the app. + Read-only. + :vartype traffic_manager_host_names: list[str] + :param scm_site_also_stopped: :code:`true` to stop SCM (KUDU) site when the app is + stopped; otherwise, :code:`false`. The default is :code:`false`. + :type scm_site_also_stopped: bool + :ivar target_swap_slot: Specifies which deployment slot this app will swap into. Read-only. + :vartype target_swap_slot: str + :param hosting_environment_profile: App Service Environment to use for the app. + :type hosting_environment_profile: ~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentProfile + :param client_affinity_enabled: :code:`true` to enable client affinity; + :code:`false` to stop sending session affinity cookies, which route client + requests in the same session to the same instance. Default is :code:`true`. + :type client_affinity_enabled: bool + :param client_cert_enabled: :code:`true` to enable client certificate + authentication (TLS mutual authentication); otherwise, :code:`false`. Default is + :code:`false`. + :type client_cert_enabled: bool + :param client_cert_mode: This composes with ClientCertEnabled setting. + + + * ClientCertEnabled: false means ClientCert is ignored. + * ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + * ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or + accepted. Possible values include: "Required", "Optional". + :type client_cert_mode: str or ~azure.mgmt.web.v2020_06_01.models.ClientCertMode + :param client_cert_exclusion_paths: client certificate authentication comma-separated exclusion + paths. + :type client_cert_exclusion_paths: str + :param host_names_disabled: :code:`true` to disable the public hostnames of the + app; otherwise, :code:`false`. + If :code:`true`, the app is only accessible via API management process. + :type host_names_disabled: bool + :param custom_domain_verification_id: Unique identifier that verifies the custom domains + assigned to the app. Customer will add this id to a txt record for verification. + :type custom_domain_verification_id: str + :ivar outbound_ip_addresses: List of IP addresses that the app uses for outbound connections + (e.g. database access). Includes VIPs from tenants that site can be hosted with current + settings. Read-only. + :vartype outbound_ip_addresses: str + :ivar possible_outbound_ip_addresses: List of IP addresses that the app uses for outbound + connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read- + only. + :vartype possible_outbound_ip_addresses: str + :param container_size: Size of the function container. + :type container_size: int + :param daily_memory_time_quota: Maximum allowed daily memory-time quota (applicable on dynamic + apps only). + :type daily_memory_time_quota: int + :ivar suspended_till: App suspended till in case memory-time quota is exceeded. + :vartype suspended_till: ~datetime.datetime + :ivar max_number_of_workers: Maximum number of workers. + This only applies to Functions container. + :vartype max_number_of_workers: int + :param cloning_info: If specified during app creation, the app is cloned from a source app. + :type cloning_info: ~azure.mgmt.web.v2020_06_01.models.CloningInfo + :ivar resource_group: Name of the resource group the app belongs to. Read-only. + :vartype resource_group: str + :ivar is_default_container: :code:`true` if the app is a default container; + otherwise, :code:`false`. + :vartype is_default_container: bool + :ivar default_host_name: Default hostname of the app. Read-only. + :vartype default_host_name: str + :ivar slot_swap_status: Status of the last deployment slot swap operation. + :vartype slot_swap_status: ~azure.mgmt.web.v2020_06_01.models.SlotSwapStatus + :param https_only: HttpsOnly: configures a web site to accept only https requests. Issues + redirect for + http requests. + :type https_only: bool + :param redundancy_mode: Site redundancy mode. Possible values include: "None", "Manual", + "Failover", "ActiveActive", "GeoRedundant". + :type redundancy_mode: str or ~azure.mgmt.web.v2020_06_01.models.RedundancyMode + :ivar in_progress_operation_id: Specifies an operation id if this site has a pending operation. + :vartype in_progress_operation_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'host_names': {'readonly': True}, + 'repository_site_name': {'readonly': True}, + 'usage_state': {'readonly': True}, + 'enabled_host_names': {'readonly': True}, + 'availability_state': {'readonly': True}, + 'last_modified_time_utc': {'readonly': True}, + 'traffic_manager_host_names': {'readonly': True}, + 'target_swap_slot': {'readonly': True}, + 'outbound_ip_addresses': {'readonly': True}, + 'possible_outbound_ip_addresses': {'readonly': True}, + 'suspended_till': {'readonly': True}, + 'max_number_of_workers': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'is_default_container': {'readonly': True}, + 'default_host_name': {'readonly': True}, + 'slot_swap_status': {'readonly': True}, + 'in_progress_operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'repository_site_name': {'key': 'properties.repositorySiteName', 'type': 'str'}, + 'usage_state': {'key': 'properties.usageState', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'enabled_host_names': {'key': 'properties.enabledHostNames', 'type': '[str]'}, + 'availability_state': {'key': 'properties.availabilityState', 'type': 'str'}, + 'host_name_ssl_states': {'key': 'properties.hostNameSslStates', 'type': '[HostNameSslState]'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'last_modified_time_utc': {'key': 'properties.lastModifiedTimeUtc', 'type': 'iso-8601'}, + 'site_config': {'key': 'properties.siteConfig', 'type': 'SiteConfig'}, + 'traffic_manager_host_names': {'key': 'properties.trafficManagerHostNames', 'type': '[str]'}, + 'scm_site_also_stopped': {'key': 'properties.scmSiteAlsoStopped', 'type': 'bool'}, + 'target_swap_slot': {'key': 'properties.targetSwapSlot', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'client_affinity_enabled': {'key': 'properties.clientAffinityEnabled', 'type': 'bool'}, + 'client_cert_enabled': {'key': 'properties.clientCertEnabled', 'type': 'bool'}, + 'client_cert_mode': {'key': 'properties.clientCertMode', 'type': 'str'}, + 'client_cert_exclusion_paths': {'key': 'properties.clientCertExclusionPaths', 'type': 'str'}, + 'host_names_disabled': {'key': 'properties.hostNamesDisabled', 'type': 'bool'}, + 'custom_domain_verification_id': {'key': 'properties.customDomainVerificationId', 'type': 'str'}, + 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': 'str'}, + 'possible_outbound_ip_addresses': {'key': 'properties.possibleOutboundIpAddresses', 'type': 'str'}, + 'container_size': {'key': 'properties.containerSize', 'type': 'int'}, + 'daily_memory_time_quota': {'key': 'properties.dailyMemoryTimeQuota', 'type': 'int'}, + 'suspended_till': {'key': 'properties.suspendedTill', 'type': 'iso-8601'}, + 'max_number_of_workers': {'key': 'properties.maxNumberOfWorkers', 'type': 'int'}, + 'cloning_info': {'key': 'properties.cloningInfo', 'type': 'CloningInfo'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'is_default_container': {'key': 'properties.isDefaultContainer', 'type': 'bool'}, + 'default_host_name': {'key': 'properties.defaultHostName', 'type': 'str'}, + 'slot_swap_status': {'key': 'properties.slotSwapStatus', 'type': 'SlotSwapStatus'}, + 'https_only': {'key': 'properties.httpsOnly', 'type': 'bool'}, + 'redundancy_mode': {'key': 'properties.redundancyMode', 'type': 'str'}, + 'in_progress_operation_id': {'key': 'properties.inProgressOperationId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SitePatchResource, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.state = None + self.host_names = None + self.repository_site_name = None + self.usage_state = None + self.enabled = kwargs.get('enabled', None) + self.enabled_host_names = None + self.availability_state = None + self.host_name_ssl_states = kwargs.get('host_name_ssl_states', None) + self.server_farm_id = kwargs.get('server_farm_id', None) + self.reserved = kwargs.get('reserved', False) + self.is_xenon = kwargs.get('is_xenon', False) + self.hyper_v = kwargs.get('hyper_v', False) + self.last_modified_time_utc = None + self.site_config = kwargs.get('site_config', None) + self.traffic_manager_host_names = None + self.scm_site_also_stopped = kwargs.get('scm_site_also_stopped', False) + self.target_swap_slot = None + self.hosting_environment_profile = kwargs.get('hosting_environment_profile', None) + self.client_affinity_enabled = kwargs.get('client_affinity_enabled', None) + self.client_cert_enabled = kwargs.get('client_cert_enabled', None) + self.client_cert_mode = kwargs.get('client_cert_mode', None) + self.client_cert_exclusion_paths = kwargs.get('client_cert_exclusion_paths', None) + self.host_names_disabled = kwargs.get('host_names_disabled', None) + self.custom_domain_verification_id = kwargs.get('custom_domain_verification_id', None) + self.outbound_ip_addresses = None + self.possible_outbound_ip_addresses = None + self.container_size = kwargs.get('container_size', None) + self.daily_memory_time_quota = kwargs.get('daily_memory_time_quota', None) + self.suspended_till = None + self.max_number_of_workers = None + self.cloning_info = kwargs.get('cloning_info', None) + self.resource_group = None + self.is_default_container = None + self.default_host_name = None + self.slot_swap_status = None + self.https_only = kwargs.get('https_only', None) + self.redundancy_mode = kwargs.get('redundancy_mode', None) + self.in_progress_operation_id = None + + +class SitePhpErrorLogFlag(ProxyOnlyResource): + """Used for getting PHP error logging flag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param local_log_errors: Local log_errors setting. + :type local_log_errors: str + :param master_log_errors: Master log_errors setting. + :type master_log_errors: str + :param local_log_errors_max_length: Local log_errors_max_len setting. + :type local_log_errors_max_length: str + :param master_log_errors_max_length: Master log_errors_max_len setting. + :type master_log_errors_max_length: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'local_log_errors': {'key': 'properties.localLogErrors', 'type': 'str'}, + 'master_log_errors': {'key': 'properties.masterLogErrors', 'type': 'str'}, + 'local_log_errors_max_length': {'key': 'properties.localLogErrorsMaxLength', 'type': 'str'}, + 'master_log_errors_max_length': {'key': 'properties.masterLogErrorsMaxLength', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SitePhpErrorLogFlag, self).__init__(**kwargs) + self.local_log_errors = kwargs.get('local_log_errors', None) + self.master_log_errors = kwargs.get('master_log_errors', None) + self.local_log_errors_max_length = kwargs.get('local_log_errors_max_length', None) + self.master_log_errors_max_length = kwargs.get('master_log_errors_max_length', None) + + +class SiteSeal(msrest.serialization.Model): + """Site seal. + + All required parameters must be populated in order to send to Azure. + + :param html: Required. HTML snippet. + :type html: str + """ + + _validation = { + 'html': {'required': True}, + } + + _attribute_map = { + 'html': {'key': 'html', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteSeal, self).__init__(**kwargs) + self.html = kwargs['html'] + + +class SiteSealRequest(msrest.serialization.Model): + """Site seal request. + + :param light_theme: If :code:`true` use the light color theme for site seal; + otherwise, use the default color theme. + :type light_theme: bool + :param locale: Locale of site seal. + :type locale: str + """ + + _attribute_map = { + 'light_theme': {'key': 'lightTheme', 'type': 'bool'}, + 'locale': {'key': 'locale', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteSealRequest, self).__init__(**kwargs) + self.light_theme = kwargs.get('light_theme', None) + self.locale = kwargs.get('locale', None) + + +class SiteSourceControl(ProxyOnlyResource): + """Source control configuration for an app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param repo_url: Repository or source control URL. + :type repo_url: str + :param branch: Name of branch to use for deployment. + :type branch: str + :param is_manual_integration: :code:`true` to limit to manual integration; + :code:`false` to enable continuous integration (which configures webhooks into + online repos like GitHub). + :type is_manual_integration: bool + :param is_git_hub_action: :code:`true` if this is deployed via GitHub action. + :type is_git_hub_action: bool + :param deployment_rollback_enabled: :code:`true` to enable deployment rollback; + otherwise, :code:`false`. + :type deployment_rollback_enabled: bool + :param is_mercurial: :code:`true` for a Mercurial repository; + :code:`false` for a Git repository. + :type is_mercurial: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repo_url': {'key': 'properties.repoUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'is_manual_integration': {'key': 'properties.isManualIntegration', 'type': 'bool'}, + 'is_git_hub_action': {'key': 'properties.isGitHubAction', 'type': 'bool'}, + 'deployment_rollback_enabled': {'key': 'properties.deploymentRollbackEnabled', 'type': 'bool'}, + 'is_mercurial': {'key': 'properties.isMercurial', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteSourceControl, self).__init__(**kwargs) + self.repo_url = kwargs.get('repo_url', None) + self.branch = kwargs.get('branch', None) + self.is_manual_integration = kwargs.get('is_manual_integration', None) + self.is_git_hub_action = kwargs.get('is_git_hub_action', None) + self.deployment_rollback_enabled = kwargs.get('deployment_rollback_enabled', None) + self.is_mercurial = kwargs.get('is_mercurial', None) + + +class SkuCapacity(msrest.serialization.Model): + """Description of the App Service plan scale options. + + :param minimum: Minimum number of workers for this App Service plan SKU. + :type minimum: int + :param maximum: Maximum number of workers for this App Service plan SKU. + :type maximum: int + :param default: Default number of workers for this App Service plan SKU. + :type default: int + :param scale_type: Available scale configurations for an App Service plan. + :type scale_type: str + """ + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuCapacity, self).__init__(**kwargs) + self.minimum = kwargs.get('minimum', None) + self.maximum = kwargs.get('maximum', None) + self.default = kwargs.get('default', None) + self.scale_type = kwargs.get('scale_type', None) + + +class SkuDescription(msrest.serialization.Model): + """Description of a SKU for a scalable resource. + + :param name: Name of the resource SKU. + :type name: str + :param tier: Service tier of the resource SKU. + :type tier: str + :param size: Size specifier of the resource SKU. + :type size: str + :param family: Family code of the resource SKU. + :type family: str + :param capacity: Current number of instances assigned to the resource. + :type capacity: int + :param sku_capacity: Min, max, and default scale values of the SKU. + :type sku_capacity: ~azure.mgmt.web.v2020_06_01.models.SkuCapacity + :param locations: Locations of the SKU. + :type locations: list[str] + :param capabilities: Capabilities of the SKU, e.g., is traffic manager enabled?. + :type capabilities: list[~azure.mgmt.web.v2020_06_01.models.Capability] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'sku_capacity': {'key': 'skuCapacity', 'type': 'SkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[Capability]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuDescription, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.capacity = kwargs.get('capacity', None) + self.sku_capacity = kwargs.get('sku_capacity', None) + self.locations = kwargs.get('locations', None) + self.capabilities = kwargs.get('capabilities', None) + + +class SkuInfo(msrest.serialization.Model): + """SKU discovery information. + + :param resource_type: Resource type that this SKU applies to. + :type resource_type: str + :param sku: Name and tier of the SKU. + :type sku: ~azure.mgmt.web.v2020_06_01.models.SkuDescription + :param capacity: Min, max, and default scale values of the SKU. + :type capacity: ~azure.mgmt.web.v2020_06_01.models.SkuCapacity + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInfo, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.sku = kwargs.get('sku', None) + self.capacity = kwargs.get('capacity', None) + + +class SkuInfoCollection(msrest.serialization.Model): + """Collection of SKU information. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.SkuInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SkuInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInfoCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class SkuInfos(msrest.serialization.Model): + """Collection of SKU information. + + :param resource_type: Resource type that this SKU applies to. + :type resource_type: str + :param skus: List of SKUs the subscription is able to use. + :type skus: list[~azure.mgmt.web.v2020_06_01.models.GlobalCsmSkuDescription] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'skus': {'key': 'skus', 'type': '[GlobalCsmSkuDescription]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInfos, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.skus = kwargs.get('skus', None) + + +class SlotConfigNamesResource(ProxyOnlyResource): + """Slot Config names azure resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param connection_string_names: List of connection string names. + :type connection_string_names: list[str] + :param app_setting_names: List of application settings names. + :type app_setting_names: list[str] + :param azure_storage_config_names: List of external Azure storage account identifiers. + :type azure_storage_config_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'connection_string_names': {'key': 'properties.connectionStringNames', 'type': '[str]'}, + 'app_setting_names': {'key': 'properties.appSettingNames', 'type': '[str]'}, + 'azure_storage_config_names': {'key': 'properties.azureStorageConfigNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SlotConfigNamesResource, self).__init__(**kwargs) + self.connection_string_names = kwargs.get('connection_string_names', None) + self.app_setting_names = kwargs.get('app_setting_names', None) + self.azure_storage_config_names = kwargs.get('azure_storage_config_names', None) + + +class SlotDifference(ProxyOnlyResource): + """A setting difference between two deployment slots of an app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar level: Level of the difference: Information, Warning or Error. + :vartype level: str + :ivar setting_type: The type of the setting: General, AppSetting or ConnectionString. + :vartype setting_type: str + :ivar diff_rule: Rule that describes how to process the setting difference during a slot swap. + :vartype diff_rule: str + :ivar setting_name: Name of the setting. + :vartype setting_name: str + :ivar value_in_current_slot: Value of the setting in the current slot. + :vartype value_in_current_slot: str + :ivar value_in_target_slot: Value of the setting in the target slot. + :vartype value_in_target_slot: str + :ivar description: Description of the setting difference. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'level': {'readonly': True}, + 'setting_type': {'readonly': True}, + 'diff_rule': {'readonly': True}, + 'setting_name': {'readonly': True}, + 'value_in_current_slot': {'readonly': True}, + 'value_in_target_slot': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'level': {'key': 'properties.level', 'type': 'str'}, + 'setting_type': {'key': 'properties.settingType', 'type': 'str'}, + 'diff_rule': {'key': 'properties.diffRule', 'type': 'str'}, + 'setting_name': {'key': 'properties.settingName', 'type': 'str'}, + 'value_in_current_slot': {'key': 'properties.valueInCurrentSlot', 'type': 'str'}, + 'value_in_target_slot': {'key': 'properties.valueInTargetSlot', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SlotDifference, self).__init__(**kwargs) + self.level = None + self.setting_type = None + self.diff_rule = None + self.setting_name = None + self.value_in_current_slot = None + self.value_in_target_slot = None + self.description = None + + +class SlotDifferenceCollection(msrest.serialization.Model): + """Collection of slot differences. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.SlotDifference] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SlotDifference]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SlotDifferenceCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class SlotSwapStatus(msrest.serialization.Model): + """The status of the last successful slot swap operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar timestamp_utc: The time the last successful slot swap completed. + :vartype timestamp_utc: ~datetime.datetime + :ivar source_slot_name: The source slot of the last swap operation. + :vartype source_slot_name: str + :ivar destination_slot_name: The destination slot of the last swap operation. + :vartype destination_slot_name: str + """ + + _validation = { + 'timestamp_utc': {'readonly': True}, + 'source_slot_name': {'readonly': True}, + 'destination_slot_name': {'readonly': True}, + } + + _attribute_map = { + 'timestamp_utc': {'key': 'timestampUtc', 'type': 'iso-8601'}, + 'source_slot_name': {'key': 'sourceSlotName', 'type': 'str'}, + 'destination_slot_name': {'key': 'destinationSlotName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SlotSwapStatus, self).__init__(**kwargs) + self.timestamp_utc = None + self.source_slot_name = None + self.destination_slot_name = None + + +class SlowRequestsBasedTrigger(msrest.serialization.Model): + """Trigger based on request execution time. + + :param time_taken: Time taken. + :type time_taken: str + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + """ + + _attribute_map = { + 'time_taken': {'key': 'timeTaken', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SlowRequestsBasedTrigger, self).__init__(**kwargs) + self.time_taken = kwargs.get('time_taken', None) + self.count = kwargs.get('count', None) + self.time_interval = kwargs.get('time_interval', None) + + +class Snapshot(ProxyOnlyResource): + """A snapshot of an app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar time: The time the snapshot was taken. + :vartype time: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Snapshot, self).__init__(**kwargs) + self.time = None + + +class SnapshotCollection(msrest.serialization.Model): + """Collection of snapshots which can be used to revert an app to a previous time. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.Snapshot] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Snapshot]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SnapshotCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class SnapshotRecoverySource(msrest.serialization.Model): + """Specifies the web app that snapshot contents will be retrieved from. + + :param location: Geographical location of the source web app, e.g. SouthEastAsia, + SouthCentralUS. + :type location: str + :param id: ARM resource ID of the source app. + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + for production slots and + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + for other slots. + :type id: str + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SnapshotRecoverySource, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.id = kwargs.get('id', None) + + +class SnapshotRestoreRequest(ProxyOnlyResource): + """Details about app recovery operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param snapshot_time: Point in time in which the app restore should be done, formatted as a + DateTime string. + :type snapshot_time: str + :param recovery_source: Optional. Specifies the web app that snapshot contents will be + retrieved from. + If empty, the targeted web app will be used as the source. + :type recovery_source: ~azure.mgmt.web.v2020_06_01.models.SnapshotRecoverySource + :param overwrite: If :code:`true` the restore operation can overwrite source app; + otherwise, :code:`false`. + :type overwrite: bool + :param recover_configuration: If true, site configuration, in addition to content, will be + reverted. + :type recover_configuration: bool + :param ignore_conflicting_host_names: If true, custom hostname conflicts will be ignored when + recovering to a target web app. + This setting is only necessary when RecoverConfiguration is enabled. + :type ignore_conflicting_host_names: bool + :param use_dr_secondary: If true, the snapshot is retrieved from DRSecondary endpoint. + :type use_dr_secondary: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'str'}, + 'recovery_source': {'key': 'properties.recoverySource', 'type': 'SnapshotRecoverySource'}, + 'overwrite': {'key': 'properties.overwrite', 'type': 'bool'}, + 'recover_configuration': {'key': 'properties.recoverConfiguration', 'type': 'bool'}, + 'ignore_conflicting_host_names': {'key': 'properties.ignoreConflictingHostNames', 'type': 'bool'}, + 'use_dr_secondary': {'key': 'properties.useDRSecondary', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(SnapshotRestoreRequest, self).__init__(**kwargs) + self.snapshot_time = kwargs.get('snapshot_time', None) + self.recovery_source = kwargs.get('recovery_source', None) + self.overwrite = kwargs.get('overwrite', None) + self.recover_configuration = kwargs.get('recover_configuration', None) + self.ignore_conflicting_host_names = kwargs.get('ignore_conflicting_host_names', None) + self.use_dr_secondary = kwargs.get('use_dr_secondary', None) + + +class Solution(msrest.serialization.Model): + """Class Representing Solution for problems detected. + + :param id: Solution Id. + :type id: float + :param display_name: Display Name of the solution. + :type display_name: str + :param order: Order of the solution. + :type order: float + :param description: Description of the solution. + :type description: str + :param type: Type of Solution. Possible values include: "QuickSolution", "DeepInvestigation", + "BestPractices". + :type type: str or ~azure.mgmt.web.v2020_06_01.models.SolutionType + :param data: Solution Data. + :type data: list[list[~azure.mgmt.web.v2020_06_01.models.NameValuePair]] + :param metadata: Solution Metadata. + :type metadata: list[list[~azure.mgmt.web.v2020_06_01.models.NameValuePair]] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'float'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'float'}, + 'description': {'key': 'description', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data': {'key': 'data', 'type': '[[NameValuePair]]'}, + 'metadata': {'key': 'metadata', 'type': '[[NameValuePair]]'}, + } + + def __init__( + self, + **kwargs + ): + super(Solution, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.display_name = kwargs.get('display_name', None) + self.order = kwargs.get('order', None) + self.description = kwargs.get('description', None) + self.type = kwargs.get('type', None) + self.data = kwargs.get('data', None) + self.metadata = kwargs.get('metadata', None) + + +class SourceControl(ProxyOnlyResource): + """The source control OAuth token. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param token: OAuth access token. + :type token: str + :param token_secret: OAuth access token secret. + :type token_secret: str + :param refresh_token: OAuth refresh token. + :type refresh_token: str + :param expiration_time: OAuth token expiration. + :type expiration_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'token': {'key': 'properties.token', 'type': 'str'}, + 'token_secret': {'key': 'properties.tokenSecret', 'type': 'str'}, + 'refresh_token': {'key': 'properties.refreshToken', 'type': 'str'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControl, self).__init__(**kwargs) + self.token = kwargs.get('token', None) + self.token_secret = kwargs.get('token_secret', None) + self.refresh_token = kwargs.get('refresh_token', None) + self.expiration_time = kwargs.get('expiration_time', None) + + +class SourceControlCollection(msrest.serialization.Model): + """Collection of source controls. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.SourceControl] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SourceControl]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StackMajorVersion(msrest.serialization.Model): + """Application stack major version. + + :param display_version: Application stack major version (display only). + :type display_version: str + :param runtime_version: Application stack major version (runtime only). + :type runtime_version: str + :param is_default: :code:`true` if this is the default major version; otherwise, + :code:`false`. + :type is_default: bool + :param minor_versions: Minor versions associated with the major version. + :type minor_versions: list[~azure.mgmt.web.v2020_06_01.models.StackMinorVersion] + :param application_insights: :code:`true` if this supports Application Insights; + otherwise, :code:`false`. + :type application_insights: bool + :param is_preview: :code:`true` if this stack is in Preview, otherwise + :code:`false`. + :type is_preview: bool + :param is_deprecated: :code:`true` if this stack has been deprecated, otherwise + :code:`false`. + :type is_deprecated: bool + :param is_hidden: :code:`true` if this stack should be hidden for new customers on + portal, otherwise :code:`false`. + :type is_hidden: bool + """ + + _attribute_map = { + 'display_version': {'key': 'displayVersion', 'type': 'str'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'minor_versions': {'key': 'minorVersions', 'type': '[StackMinorVersion]'}, + 'application_insights': {'key': 'applicationInsights', 'type': 'bool'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + 'is_deprecated': {'key': 'isDeprecated', 'type': 'bool'}, + 'is_hidden': {'key': 'isHidden', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(StackMajorVersion, self).__init__(**kwargs) + self.display_version = kwargs.get('display_version', None) + self.runtime_version = kwargs.get('runtime_version', None) + self.is_default = kwargs.get('is_default', None) + self.minor_versions = kwargs.get('minor_versions', None) + self.application_insights = kwargs.get('application_insights', None) + self.is_preview = kwargs.get('is_preview', None) + self.is_deprecated = kwargs.get('is_deprecated', None) + self.is_hidden = kwargs.get('is_hidden', None) + + +class StackMinorVersion(msrest.serialization.Model): + """Application stack minor version. + + :param display_version: Application stack minor version (display only). + :type display_version: str + :param runtime_version: Application stack minor version (runtime only). + :type runtime_version: str + :param is_default: :code:`true` if this is the default minor version; otherwise, + :code:`false`. + :type is_default: bool + :param is_remote_debugging_enabled: :code:`true` if this supports Remote + Debugging, otherwise :code:`false`. + :type is_remote_debugging_enabled: bool + """ + + _attribute_map = { + 'display_version': {'key': 'displayVersion', 'type': 'str'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'is_remote_debugging_enabled': {'key': 'isRemoteDebuggingEnabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(StackMinorVersion, self).__init__(**kwargs) + self.display_version = kwargs.get('display_version', None) + self.runtime_version = kwargs.get('runtime_version', None) + self.is_default = kwargs.get('is_default', None) + self.is_remote_debugging_enabled = kwargs.get('is_remote_debugging_enabled', None) + + +class StampCapacity(msrest.serialization.Model): + """Stamp capacity information. + + :param name: Name of the stamp. + :type name: str + :param available_capacity: Available capacity (# of machines, bytes of storage etc...). + :type available_capacity: long + :param total_capacity: Total capacity (# of machines, bytes of storage etc...). + :type total_capacity: long + :param unit: Name of the unit. + :type unit: str + :param compute_mode: Shared/dedicated workers. Possible values include: "Shared", "Dedicated", + "Dynamic". + :type compute_mode: str or ~azure.mgmt.web.v2020_06_01.models.ComputeModeOptions + :param worker_size: Size of the machines. Possible values include: "Small", "Medium", "Large", + "D1", "D2", "D3", "NestedSmall", "Default". + :type worker_size: str or ~azure.mgmt.web.v2020_06_01.models.WorkerSizeOptions + :param worker_size_id: Size ID of machines: + 0 - Small + 1 - Medium + 2 - Large. + :type worker_size_id: int + :param exclude_from_capacity_allocation: If :code:`true`, it includes basic apps. + Basic apps are not used for capacity allocation. + :type exclude_from_capacity_allocation: bool + :param is_applicable_for_all_compute_modes: :code:`true` if capacity is applicable + for all apps; otherwise, :code:`false`. + :type is_applicable_for_all_compute_modes: bool + :param site_mode: Shared or Dedicated. + :type site_mode: str + :param is_linux: Is this a linux stamp capacity. + :type is_linux: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'available_capacity': {'key': 'availableCapacity', 'type': 'long'}, + 'total_capacity': {'key': 'totalCapacity', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'compute_mode': {'key': 'computeMode', 'type': 'str'}, + 'worker_size': {'key': 'workerSize', 'type': 'str'}, + 'worker_size_id': {'key': 'workerSizeId', 'type': 'int'}, + 'exclude_from_capacity_allocation': {'key': 'excludeFromCapacityAllocation', 'type': 'bool'}, + 'is_applicable_for_all_compute_modes': {'key': 'isApplicableForAllComputeModes', 'type': 'bool'}, + 'site_mode': {'key': 'siteMode', 'type': 'str'}, + 'is_linux': {'key': 'isLinux', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(StampCapacity, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.available_capacity = kwargs.get('available_capacity', None) + self.total_capacity = kwargs.get('total_capacity', None) + self.unit = kwargs.get('unit', None) + self.compute_mode = kwargs.get('compute_mode', None) + self.worker_size = kwargs.get('worker_size', None) + self.worker_size_id = kwargs.get('worker_size_id', None) + self.exclude_from_capacity_allocation = kwargs.get('exclude_from_capacity_allocation', None) + self.is_applicable_for_all_compute_modes = kwargs.get('is_applicable_for_all_compute_modes', None) + self.site_mode = kwargs.get('site_mode', None) + self.is_linux = kwargs.get('is_linux', None) + + +class StampCapacityCollection(msrest.serialization.Model): + """Collection of stamp capacities. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.StampCapacity] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StampCapacity]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StampCapacityCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StaticSiteARMResource(Resource): + """Static Site ARM 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: Description of a SKU for a scalable resource. + :type sku: ~azure.mgmt.web.v2020_06_01.models.SkuDescription + :ivar default_hostname: The default autogenerated hostname for the static site. + :vartype default_hostname: str + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :ivar custom_domains: The custom domains associated with this static site. + :vartype custom_domains: list[str] + :param repository_token: A user's github repository token. This is used to setup the Github + Actions workflow file and API secrets. + :type repository_token: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: ~azure.mgmt.web.v2020_06_01.models.StaticSiteBuildProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'default_hostname': {'readonly': True}, + 'custom_domains': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'default_hostname': {'key': 'properties.defaultHostname', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'custom_domains': {'key': 'properties.customDomains', 'type': '[str]'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteARMResource, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.default_hostname = None + self.repository_url = kwargs.get('repository_url', None) + self.branch = kwargs.get('branch', None) + self.custom_domains = None + self.repository_token = kwargs.get('repository_token', None) + self.build_properties = kwargs.get('build_properties', None) + + +class StaticSiteBuildARMResource(ProxyOnlyResource): + """Static Site Build ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar build_id: An identifier for the static site build. + :vartype build_id: str + :ivar source_branch: The source branch. + :vartype source_branch: str + :ivar pull_request_title: The title of a pull request that a static site build is related to. + :vartype pull_request_title: str + :ivar hostname: The hostname for a static site build. + :vartype hostname: str + :ivar created_time_utc: When this build was created. + :vartype created_time_utc: ~datetime.datetime + :ivar last_updated_on: When this build was updated. + :vartype last_updated_on: ~datetime.datetime + :ivar status: The status of the static site build. Possible values include: + "WaitingForDeployment", "Uploading", "Deploying", "Ready", "Failed", "Deleting", "Detached". + :vartype status: str or ~azure.mgmt.web.v2020_06_01.models.BuildStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'build_id': {'readonly': True}, + 'source_branch': {'readonly': True}, + 'pull_request_title': {'readonly': True}, + 'hostname': {'readonly': True}, + 'created_time_utc': {'readonly': True}, + 'last_updated_on': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'build_id': {'key': 'properties.buildId', 'type': 'str'}, + 'source_branch': {'key': 'properties.sourceBranch', 'type': 'str'}, + 'pull_request_title': {'key': 'properties.pullRequestTitle', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'created_time_utc': {'key': 'properties.createdTimeUtc', 'type': 'iso-8601'}, + 'last_updated_on': {'key': 'properties.lastUpdatedOn', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteBuildARMResource, self).__init__(**kwargs) + self.build_id = None + self.source_branch = None + self.pull_request_title = None + self.hostname = None + self.created_time_utc = None + self.last_updated_on = None + self.status = None + + +class StaticSiteBuildCollection(msrest.serialization.Model): + """Collection of static site builds. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.StaticSiteBuildARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteBuildARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteBuildCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StaticSiteBuildProperties(msrest.serialization.Model): + """Build properties for the static site. + + :param app_location: The path to the app code within the repository. + :type app_location: str + :param api_location: The path to the api code within the repository. + :type api_location: str + :param app_artifact_location: The path of the app artifacts after building. + :type app_artifact_location: str + """ + + _attribute_map = { + 'app_location': {'key': 'appLocation', 'type': 'str'}, + 'api_location': {'key': 'apiLocation', 'type': 'str'}, + 'app_artifact_location': {'key': 'appArtifactLocation', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteBuildProperties, self).__init__(**kwargs) + self.app_location = kwargs.get('app_location', None) + self.api_location = kwargs.get('api_location', None) + self.app_artifact_location = kwargs.get('app_artifact_location', None) + + +class StaticSiteCollection(msrest.serialization.Model): + """Collection of static sites. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.StaticSiteARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StaticSiteCustomDomainOverviewARMResource(ProxyOnlyResource): + """Static Site Custom Domain Overview ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar domain_name: The domain name for the static site custom domain. + :vartype domain_name: str + :ivar created_on: The date and time on which the custom domain was created for the static site. + :vartype created_on: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'domain_name': {'readonly': True}, + 'created_on': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'domain_name': {'key': 'properties.domainName', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteCustomDomainOverviewARMResource, self).__init__(**kwargs) + self.domain_name = None + self.created_on = None + + +class StaticSiteCustomDomainOverviewCollection(msrest.serialization.Model): + """Collection of static site custom domains. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.StaticSiteCustomDomainOverviewARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteCustomDomainOverviewARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteCustomDomainOverviewCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StaticSiteFunctionOverviewARMResource(ProxyOnlyResource): + """Static Site Function Overview ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar function_name: The name for the function. + :vartype function_name: str + :ivar trigger_type: The trigger type of the function. Possible values include: "HttpTrigger", + "Unknown". + :vartype trigger_type: str or ~azure.mgmt.web.v2020_06_01.models.TriggerTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'function_name': {'readonly': True}, + 'trigger_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'function_name': {'key': 'properties.functionName', 'type': 'str'}, + 'trigger_type': {'key': 'properties.triggerType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteFunctionOverviewARMResource, self).__init__(**kwargs) + self.function_name = None + self.trigger_type = None + + +class StaticSiteFunctionOverviewCollection(msrest.serialization.Model): + """Collection of static site functions. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.StaticSiteFunctionOverviewARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteFunctionOverviewARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteFunctionOverviewCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StaticSitePatchResource(ProxyOnlyResource): + """ARM resource for a static site when patching. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar default_hostname: The default autogenerated hostname for the static site. + :vartype default_hostname: str + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :ivar custom_domains: The custom domains associated with this static site. + :vartype custom_domains: list[str] + :param repository_token: A user's github repository token. This is used to setup the Github + Actions workflow file and API secrets. + :type repository_token: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: ~azure.mgmt.web.v2020_06_01.models.StaticSiteBuildProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'default_hostname': {'readonly': True}, + 'custom_domains': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'default_hostname': {'key': 'properties.defaultHostname', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'custom_domains': {'key': 'properties.customDomains', 'type': '[str]'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSitePatchResource, self).__init__(**kwargs) + self.default_hostname = None + self.repository_url = kwargs.get('repository_url', None) + self.branch = kwargs.get('branch', None) + self.custom_domains = None + self.repository_token = kwargs.get('repository_token', None) + self.build_properties = kwargs.get('build_properties', None) + + +class StaticSiteResetPropertiesARMResource(ProxyOnlyResource): + """Static Site Reset Properties ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param repository_token: The token which proves admin privileges to the repository. + :type repository_token: str + :param should_update_repository: Determines whether the repository should be updated with the + new properties. + :type should_update_repository: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'should_update_repository': {'key': 'properties.shouldUpdateRepository', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteResetPropertiesARMResource, self).__init__(**kwargs) + self.repository_token = kwargs.get('repository_token', None) + self.should_update_repository = kwargs.get('should_update_repository', None) + + +class StaticSitesWorkflowPreview(ProxyOnlyResource): + """Preview for the Static Site Workflow to be generated. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar path: The path for the workflow file to be generated. + :vartype path: str + :ivar contents: The contents for the workflow file to be generated. + :vartype contents: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'path': {'readonly': True}, + 'contents': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'contents': {'key': 'properties.contents', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSitesWorkflowPreview, self).__init__(**kwargs) + self.path = None + self.contents = None + + +class StaticSitesWorkflowPreviewRequest(ProxyOnlyResource): + """Request entity for previewing the Static Site workflow. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: ~azure.mgmt.web.v2020_06_01.models.StaticSiteBuildProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSitesWorkflowPreviewRequest, self).__init__(**kwargs) + self.repository_url = kwargs.get('repository_url', None) + self.branch = kwargs.get('branch', None) + self.build_properties = kwargs.get('build_properties', None) + + +class StaticSiteUserARMResource(ProxyOnlyResource): + """Static Site User ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar provider: The identity provider for the static site user. + :vartype provider: str + :ivar user_id: The user id for the static site user. + :vartype user_id: str + :ivar display_name: The display name for the static site user. + :vartype display_name: str + :param roles: The roles for the static site user, in free-form string format. + :type roles: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provider': {'readonly': True}, + 'user_id': {'readonly': True}, + 'display_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteUserARMResource, self).__init__(**kwargs) + self.provider = None + self.user_id = None + self.display_name = None + self.roles = kwargs.get('roles', None) + + +class StaticSiteUserCollection(msrest.serialization.Model): + """Collection of static site custom users. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.StaticSiteUserARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteUserARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteUserCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StaticSiteUserInvitationRequestResource(ProxyOnlyResource): + """Static sites user roles invitation resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param domain: The domain name for the static site custom domain. + :type domain: str + :param provider: The identity provider for the static site user. + :type provider: str + :param user_details: The user id for the static site user. + :type user_details: str + :param roles: The roles for the static site user, in free-form string format. + :type roles: str + :param num_hours_to_expiration: The number of hours the sas token stays valid. + :type num_hours_to_expiration: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'domain': {'key': 'properties.domain', 'type': 'str'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + 'user_details': {'key': 'properties.userDetails', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': 'str'}, + 'num_hours_to_expiration': {'key': 'properties.numHoursToExpiration', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteUserInvitationRequestResource, self).__init__(**kwargs) + self.domain = kwargs.get('domain', None) + self.provider = kwargs.get('provider', None) + self.user_details = kwargs.get('user_details', None) + self.roles = kwargs.get('roles', None) + self.num_hours_to_expiration = kwargs.get('num_hours_to_expiration', None) + + +class StaticSiteUserInvitationResponseResource(ProxyOnlyResource): + """Static sites user roles invitation link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar expires_on: The expiration time of the invitation. + :vartype expires_on: ~datetime.datetime + :ivar invitation_url: The url for the invitation link. + :vartype invitation_url: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'expires_on': {'readonly': True}, + 'invitation_url': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'expires_on': {'key': 'properties.expiresOn', 'type': 'iso-8601'}, + 'invitation_url': {'key': 'properties.invitationUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteUserInvitationResponseResource, self).__init__(**kwargs) + self.expires_on = None + self.invitation_url = None + + +class StatusCodesBasedTrigger(msrest.serialization.Model): + """Trigger based on status code. + + :param status: HTTP status code. + :type status: int + :param sub_status: Request Sub Status. + :type sub_status: int + :param win32_status: Win32 error code. + :type win32_status: int + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'int'}, + 'sub_status': {'key': 'subStatus', 'type': 'int'}, + 'win32_status': {'key': 'win32Status', 'type': 'int'}, + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StatusCodesBasedTrigger, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.sub_status = kwargs.get('sub_status', None) + self.win32_status = kwargs.get('win32_status', None) + self.count = kwargs.get('count', None) + self.time_interval = kwargs.get('time_interval', None) + + +class StorageMigrationOptions(ProxyOnlyResource): + """Options for app content migration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param azurefiles_connection_string: AzureFiles connection string. + :type azurefiles_connection_string: str + :param azurefiles_share: AzureFiles share. + :type azurefiles_share: str + :param switch_site_after_migration: :code:`true`if the app should be switched + over; otherwise, :code:`false`. + :type switch_site_after_migration: bool + :param block_write_access_to_site: :code:`true` if the app should be read only + during copy operation; otherwise, :code:`false`. + :type block_write_access_to_site: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'azurefiles_connection_string': {'key': 'properties.azurefilesConnectionString', 'type': 'str'}, + 'azurefiles_share': {'key': 'properties.azurefilesShare', 'type': 'str'}, + 'switch_site_after_migration': {'key': 'properties.switchSiteAfterMigration', 'type': 'bool'}, + 'block_write_access_to_site': {'key': 'properties.blockWriteAccessToSite', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageMigrationOptions, self).__init__(**kwargs) + self.azurefiles_connection_string = kwargs.get('azurefiles_connection_string', None) + self.azurefiles_share = kwargs.get('azurefiles_share', None) + self.switch_site_after_migration = kwargs.get('switch_site_after_migration', False) + self.block_write_access_to_site = kwargs.get('block_write_access_to_site', False) + + +class StorageMigrationResponse(ProxyOnlyResource): + """Response for a migration of app content request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar operation_id: When server starts the migration process, it will return an operation ID + identifying that particular migration operation. + :vartype operation_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'operation_id': {'key': 'properties.operationId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageMigrationResponse, self).__init__(**kwargs) + self.operation_id = None + + +class StringDictionary(ProxyOnlyResource): + """String dictionary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param properties: Settings. + :type properties: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(StringDictionary, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class SwiftVirtualNetwork(ProxyOnlyResource): + """Swift Virtual Network Contract. This is used to enable the new Swift way of doing virtual network integration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param subnet_resource_id: The Virtual Network subnet's resource ID. This is the subnet that + this Web App will join. This subnet must have a delegation to Microsoft.Web/serverFarms defined + first. + :type subnet_resource_id: str + :param swift_supported: A flag that specifies if the scale unit this Web App is on supports + Swift integration. + :type swift_supported: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'subnet_resource_id': {'key': 'properties.subnetResourceId', 'type': 'str'}, + 'swift_supported': {'key': 'properties.swiftSupported', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(SwiftVirtualNetwork, self).__init__(**kwargs) + self.subnet_resource_id = kwargs.get('subnet_resource_id', None) + self.swift_supported = kwargs.get('swift_supported', None) + + +class TldLegalAgreement(msrest.serialization.Model): + """Legal agreement for a top level domain. + + All required parameters must be populated in order to send to Azure. + + :param agreement_key: Required. Unique identifier for the agreement. + :type agreement_key: str + :param title: Required. Agreement title. + :type title: str + :param content: Required. Agreement details. + :type content: str + :param url: URL where a copy of the agreement details is hosted. + :type url: str + """ + + _validation = { + 'agreement_key': {'required': True}, + 'title': {'required': True}, + 'content': {'required': True}, + } + + _attribute_map = { + 'agreement_key': {'key': 'agreementKey', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'}, + 'content': {'key': 'content', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TldLegalAgreement, self).__init__(**kwargs) + self.agreement_key = kwargs['agreement_key'] + self.title = kwargs['title'] + self.content = kwargs['content'] + self.url = kwargs.get('url', None) + + +class TldLegalAgreementCollection(msrest.serialization.Model): + """Collection of top-level domain legal agreements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.TldLegalAgreement] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TldLegalAgreement]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TldLegalAgreementCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class TokenStore(ProxyOnlyResource): + """TokenStore. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: + :type enabled: bool + :param token_refresh_extension_hours: + :type token_refresh_extension_hours: float + :param file_system: + :type file_system: ~azure.mgmt.web.v2020_06_01.models.FileSystemTokenStore + :param azure_blob_storage: + :type azure_blob_storage: ~azure.mgmt.web.v2020_06_01.models.BlobStorageTokenStore + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'token_refresh_extension_hours': {'key': 'properties.tokenRefreshExtensionHours', 'type': 'float'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'FileSystemTokenStore'}, + 'azure_blob_storage': {'key': 'properties.azureBlobStorage', 'type': 'BlobStorageTokenStore'}, + } + + def __init__( + self, + **kwargs + ): + super(TokenStore, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.token_refresh_extension_hours = kwargs.get('token_refresh_extension_hours', None) + self.file_system = kwargs.get('file_system', None) + self.azure_blob_storage = kwargs.get('azure_blob_storage', None) + + +class TopLevelDomain(ProxyOnlyResource): + """A top level domain object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param privacy: If :code:`true`, then the top level domain supports domain + privacy; otherwise, :code:`false`. + :type privacy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(TopLevelDomain, self).__init__(**kwargs) + self.privacy = kwargs.get('privacy', None) + + +class TopLevelDomainAgreementOption(msrest.serialization.Model): + """Options for retrieving the list of top level domain legal agreements. + + :param include_privacy: If :code:`true`, then the list of agreements will include + agreements for domain privacy as well; otherwise, :code:`false`. + :type include_privacy: bool + :param for_transfer: If :code:`true`, then the list of agreements will include + agreements for domain transfer as well; otherwise, :code:`false`. + :type for_transfer: bool + """ + + _attribute_map = { + 'include_privacy': {'key': 'includePrivacy', 'type': 'bool'}, + 'for_transfer': {'key': 'forTransfer', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(TopLevelDomainAgreementOption, self).__init__(**kwargs) + self.include_privacy = kwargs.get('include_privacy', None) + self.for_transfer = kwargs.get('for_transfer', None) + + +class TopLevelDomainCollection(msrest.serialization.Model): + """Collection of Top-level domains. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.TopLevelDomain] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TopLevelDomain]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TopLevelDomainCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class TriggeredJobHistory(ProxyOnlyResource): + """Triggered Web Job History. List of Triggered Web Job Run Information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param runs: List of triggered web job runs. + :type runs: list[~azure.mgmt.web.v2020_06_01.models.TriggeredJobRun] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'runs': {'key': 'properties.runs', 'type': '[TriggeredJobRun]'}, + } + + def __init__( + self, + **kwargs + ): + super(TriggeredJobHistory, self).__init__(**kwargs) + self.runs = kwargs.get('runs', None) + + +class TriggeredJobHistoryCollection(msrest.serialization.Model): + """Collection of Kudu continuous web job information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.TriggeredJobHistory] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TriggeredJobHistory]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TriggeredJobHistoryCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class TriggeredJobRun(ProxyOnlyResource): + """Triggered Web Job Run Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param web_job_id: Job ID. + :type web_job_id: str + :param web_job_name: Job name. + :type web_job_name: str + :param status: Job status. Possible values include: "Success", "Failed", "Error". + :type status: str or ~azure.mgmt.web.v2020_06_01.models.TriggeredWebJobStatus + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param end_time: End time. + :type end_time: ~datetime.datetime + :param duration: Job duration. + :type duration: str + :param output_url: Output URL. + :type output_url: str + :param error_url: Error URL. + :type error_url: str + :param url: Job URL. + :type url: str + :param job_name: Job name. + :type job_name: str + :param trigger: Job trigger. + :type trigger: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'web_job_id': {'key': 'properties.web_job_id', 'type': 'str'}, + 'web_job_name': {'key': 'properties.web_job_name', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.end_time', 'type': 'iso-8601'}, + 'duration': {'key': 'properties.duration', 'type': 'str'}, + 'output_url': {'key': 'properties.output_url', 'type': 'str'}, + 'error_url': {'key': 'properties.error_url', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'job_name': {'key': 'properties.job_name', 'type': 'str'}, + 'trigger': {'key': 'properties.trigger', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TriggeredJobRun, self).__init__(**kwargs) + self.web_job_id = kwargs.get('web_job_id', None) + self.web_job_name = kwargs.get('web_job_name', None) + self.status = kwargs.get('status', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.duration = kwargs.get('duration', None) + self.output_url = kwargs.get('output_url', None) + self.error_url = kwargs.get('error_url', None) + self.url = kwargs.get('url', None) + self.job_name = kwargs.get('job_name', None) + self.trigger = kwargs.get('trigger', None) + + +class TriggeredWebJob(ProxyOnlyResource): + """Triggered Web Job Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param latest_run: Latest job run information. + :type latest_run: ~azure.mgmt.web.v2020_06_01.models.TriggeredJobRun + :param history_url: History URL. + :type history_url: str + :param scheduler_logs_url: Scheduler Logs URL. + :type scheduler_logs_url: str + :param run_command: Run command. + :type run_command: str + :param url: Job URL. + :type url: str + :param extra_info_url: Extra Info URL. + :type extra_info_url: str + :param web_job_type: Job type. Possible values include: "Continuous", "Triggered". + :type web_job_type: str or ~azure.mgmt.web.v2020_06_01.models.WebJobType + :param error: Error information. + :type error: str + :param using_sdk: Using SDK?. + :type using_sdk: bool + :param settings: Job settings. + :type settings: dict[str, object] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'latest_run': {'key': 'properties.latest_run', 'type': 'TriggeredJobRun'}, + 'history_url': {'key': 'properties.history_url', 'type': 'str'}, + 'scheduler_logs_url': {'key': 'properties.scheduler_logs_url', 'type': 'str'}, + 'run_command': {'key': 'properties.run_command', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'extra_info_url': {'key': 'properties.extra_info_url', 'type': 'str'}, + 'web_job_type': {'key': 'properties.web_job_type', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'str'}, + 'using_sdk': {'key': 'properties.using_sdk', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(TriggeredWebJob, self).__init__(**kwargs) + self.latest_run = kwargs.get('latest_run', None) + self.history_url = kwargs.get('history_url', None) + self.scheduler_logs_url = kwargs.get('scheduler_logs_url', None) + self.run_command = kwargs.get('run_command', None) + self.url = kwargs.get('url', None) + self.extra_info_url = kwargs.get('extra_info_url', None) + self.web_job_type = kwargs.get('web_job_type', None) + self.error = kwargs.get('error', None) + self.using_sdk = kwargs.get('using_sdk', None) + self.settings = kwargs.get('settings', None) + + +class TriggeredWebJobCollection(msrest.serialization.Model): + """Collection of Kudu continuous web job information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.TriggeredWebJob] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TriggeredWebJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TriggeredWebJobCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class Twitter(ProxyOnlyResource): + """Twitter. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_06_01.models.TwitterRegistration + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'TwitterRegistration'}, + } + + def __init__( + self, + **kwargs + ): + super(Twitter, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.registration = kwargs.get('registration', None) + + +class TwitterRegistration(ProxyOnlyResource): + """TwitterRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param consumer_key: + :type consumer_key: str + :param consumer_secret_setting_name: + :type consumer_secret_setting_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'consumer_key': {'key': 'properties.consumerKey', 'type': 'str'}, + 'consumer_secret_setting_name': {'key': 'properties.consumerSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TwitterRegistration, self).__init__(**kwargs) + self.consumer_key = kwargs.get('consumer_key', None) + self.consumer_secret_setting_name = kwargs.get('consumer_secret_setting_name', None) + + +class Usage(ProxyOnlyResource): + """Usage of the quota resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: Friendly name shown in the UI. + :vartype display_name: str + :ivar resource_name: Name of the quota resource. + :vartype resource_name: str + :ivar unit: Units of measurement for the quota resource. + :vartype unit: str + :ivar current_value: The current value of the resource counter. + :vartype current_value: long + :ivar limit: The resource limit. + :vartype limit: long + :ivar next_reset_time: Next reset time for the resource counter. + :vartype next_reset_time: ~datetime.datetime + :ivar compute_mode: Compute mode used for this usage. Possible values include: "Shared", + "Dedicated", "Dynamic". + :vartype compute_mode: str or ~azure.mgmt.web.v2020_06_01.models.ComputeModeOptions + :ivar site_mode: Site mode used for this usage. + :vartype site_mode: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'resource_name': {'readonly': True}, + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'next_reset_time': {'readonly': True}, + 'compute_mode': {'readonly': True}, + 'site_mode': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'resource_name': {'key': 'properties.resourceName', 'type': 'str'}, + 'unit': {'key': 'properties.unit', 'type': 'str'}, + 'current_value': {'key': 'properties.currentValue', 'type': 'long'}, + 'limit': {'key': 'properties.limit', 'type': 'long'}, + 'next_reset_time': {'key': 'properties.nextResetTime', 'type': 'iso-8601'}, + 'compute_mode': {'key': 'properties.computeMode', 'type': 'str'}, + 'site_mode': {'key': 'properties.siteMode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Usage, self).__init__(**kwargs) + self.display_name = None + self.resource_name = None + self.unit = None + self.current_value = None + self.limit = None + self.next_reset_time = None + self.compute_mode = None + self.site_mode = None + + +class UsageCollection(msrest.serialization.Model): + """Collection of usages. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.Usage] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UsageCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class User(ProxyOnlyResource): + """User credentials used for publishing activity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param publishing_user_name: Username used for publishing. + :type publishing_user_name: str + :param publishing_password: Password used for publishing. + :type publishing_password: str + :param publishing_password_hash: Password hash used for publishing. + :type publishing_password_hash: str + :param publishing_password_hash_salt: Password hash salt used for publishing. + :type publishing_password_hash_salt: str + :param scm_uri: Url of SCM site. + :type scm_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'publishing_user_name': {'key': 'properties.publishingUserName', 'type': 'str'}, + 'publishing_password': {'key': 'properties.publishingPassword', 'type': 'str'}, + 'publishing_password_hash': {'key': 'properties.publishingPasswordHash', 'type': 'str'}, + 'publishing_password_hash_salt': {'key': 'properties.publishingPasswordHashSalt', 'type': 'str'}, + 'scm_uri': {'key': 'properties.scmUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(User, self).__init__(**kwargs) + self.publishing_user_name = kwargs.get('publishing_user_name', None) + self.publishing_password = kwargs.get('publishing_password', None) + self.publishing_password_hash = kwargs.get('publishing_password_hash', None) + self.publishing_password_hash_salt = kwargs.get('publishing_password_hash_salt', None) + self.scm_uri = kwargs.get('scm_uri', None) + + +class ValidateRequest(msrest.serialization.Model): + """Resource validation request content. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name to verify. + :type name: str + :param type: Required. Resource type used for verification. Possible values include: + "ServerFarm", "Site". + :type type: str or ~azure.mgmt.web.v2020_06_01.models.ValidateResourceTypes + :param location: Required. Expected location of the resource. + :type location: str + :param server_farm_id: ARM resource ID of an App Service plan that would host the app. + :type server_farm_id: str + :param sku_name: Name of the target SKU for the App Service plan. + :type sku_name: str + :param need_linux_workers: :code:`true` if App Service plan is for Linux workers; + otherwise, :code:`false`. + :type need_linux_workers: bool + :param is_spot: :code:`true` if App Service plan is for Spot instances; otherwise, + :code:`false`. + :type is_spot: bool + :param capacity: Target capacity of the App Service plan (number of VMs). + :type capacity: int + :param hosting_environment: Name of App Service Environment where app or App Service plan + should be created. + :type hosting_environment: str + :param is_xenon: :code:`true` if App Service plan is running as a windows + container. + :type is_xenon: bool + :param container_registry_base_url: Base URL of the container registry. + :type container_registry_base_url: str + :param container_registry_username: Username for to access the container registry. + :type container_registry_username: str + :param container_registry_password: Password for to access the container registry. + :type container_registry_password: str + :param container_image_repository: Repository name (image name). + :type container_image_repository: str + :param container_image_tag: Image tag. + :type container_image_tag: str + :param container_image_platform: Platform (windows or linux). + :type container_image_platform: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + 'location': {'required': True}, + 'capacity': {'minimum': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'sku_name': {'key': 'properties.skuName', 'type': 'str'}, + 'need_linux_workers': {'key': 'properties.needLinuxWorkers', 'type': 'bool'}, + 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, + 'capacity': {'key': 'properties.capacity', 'type': 'int'}, + 'hosting_environment': {'key': 'properties.hostingEnvironment', 'type': 'str'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'container_registry_base_url': {'key': 'properties.containerRegistryBaseUrl', 'type': 'str'}, + 'container_registry_username': {'key': 'properties.containerRegistryUsername', 'type': 'str'}, + 'container_registry_password': {'key': 'properties.containerRegistryPassword', 'type': 'str'}, + 'container_image_repository': {'key': 'properties.containerImageRepository', 'type': 'str'}, + 'container_image_tag': {'key': 'properties.containerImageTag', 'type': 'str'}, + 'container_image_platform': {'key': 'properties.containerImagePlatform', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ValidateRequest, self).__init__(**kwargs) + self.name = kwargs['name'] + self.type = kwargs['type'] + self.location = kwargs['location'] + self.server_farm_id = kwargs.get('server_farm_id', None) + self.sku_name = kwargs.get('sku_name', None) + self.need_linux_workers = kwargs.get('need_linux_workers', None) + self.is_spot = kwargs.get('is_spot', None) + self.capacity = kwargs.get('capacity', None) + self.hosting_environment = kwargs.get('hosting_environment', None) + self.is_xenon = kwargs.get('is_xenon', None) + self.container_registry_base_url = kwargs.get('container_registry_base_url', None) + self.container_registry_username = kwargs.get('container_registry_username', None) + self.container_registry_password = kwargs.get('container_registry_password', None) + self.container_image_repository = kwargs.get('container_image_repository', None) + self.container_image_tag = kwargs.get('container_image_tag', None) + self.container_image_platform = kwargs.get('container_image_platform', None) + + +class ValidateResponse(msrest.serialization.Model): + """Describes the result of resource validation. + + :param status: Result of validation. + :type status: str + :param error: Error details for the case when validation fails. + :type error: ~azure.mgmt.web.v2020_06_01.models.ValidateResponseError + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ValidateResponseError'}, + } + + def __init__( + self, + **kwargs + ): + super(ValidateResponse, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) + + +class ValidateResponseError(msrest.serialization.Model): + """Error details for when validation fails. + + :param code: Validation error code. + :type code: str + :param message: Validation error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ValidateResponseError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class VirtualApplication(msrest.serialization.Model): + """Virtual application in an app. + + :param virtual_path: Virtual path. + :type virtual_path: str + :param physical_path: Physical path. + :type physical_path: str + :param preload_enabled: :code:`true` if preloading is enabled; otherwise, + :code:`false`. + :type preload_enabled: bool + :param virtual_directories: Virtual directories for virtual application. + :type virtual_directories: list[~azure.mgmt.web.v2020_06_01.models.VirtualDirectory] + """ + + _attribute_map = { + 'virtual_path': {'key': 'virtualPath', 'type': 'str'}, + 'physical_path': {'key': 'physicalPath', 'type': 'str'}, + 'preload_enabled': {'key': 'preloadEnabled', 'type': 'bool'}, + 'virtual_directories': {'key': 'virtualDirectories', 'type': '[VirtualDirectory]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualApplication, self).__init__(**kwargs) + self.virtual_path = kwargs.get('virtual_path', None) + self.physical_path = kwargs.get('physical_path', None) + self.preload_enabled = kwargs.get('preload_enabled', None) + self.virtual_directories = kwargs.get('virtual_directories', None) + + +class VirtualDirectory(msrest.serialization.Model): + """Directory for virtual application. + + :param virtual_path: Path to virtual application. + :type virtual_path: str + :param physical_path: Physical path. + :type physical_path: str + """ + + _attribute_map = { + 'virtual_path': {'key': 'virtualPath', 'type': 'str'}, + 'physical_path': {'key': 'physicalPath', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualDirectory, self).__init__(**kwargs) + self.virtual_path = kwargs.get('virtual_path', None) + self.physical_path = kwargs.get('physical_path', None) + + +class VirtualIPMapping(msrest.serialization.Model): + """Virtual IP mapping. + + :param virtual_ip: Virtual IP address. + :type virtual_ip: str + :param internal_http_port: Internal HTTP port. + :type internal_http_port: int + :param internal_https_port: Internal HTTPS port. + :type internal_https_port: int + :param in_use: Is virtual IP mapping in use. + :type in_use: bool + :param service_name: name of the service that virtual IP is assigned to. + :type service_name: str + """ + + _attribute_map = { + 'virtual_ip': {'key': 'virtualIP', 'type': 'str'}, + 'internal_http_port': {'key': 'internalHttpPort', 'type': 'int'}, + 'internal_https_port': {'key': 'internalHttpsPort', 'type': 'int'}, + 'in_use': {'key': 'inUse', 'type': 'bool'}, + 'service_name': {'key': 'serviceName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualIPMapping, self).__init__(**kwargs) + self.virtual_ip = kwargs.get('virtual_ip', None) + self.internal_http_port = kwargs.get('internal_http_port', None) + self.internal_https_port = kwargs.get('internal_https_port', None) + self.in_use = kwargs.get('in_use', None) + self.service_name = kwargs.get('service_name', None) + + +class VirtualNetworkProfile(msrest.serialization.Model): + """Specification for using a Virtual Network. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource id of the Virtual Network. + :type id: str + :ivar name: Name of the Virtual Network (read-only). + :vartype name: str + :ivar type: Resource type of the Virtual Network (read-only). + :vartype type: str + :param subnet: Subnet within the Virtual Network. + :type subnet: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkProfile, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = None + self.type = None + self.subnet = kwargs.get('subnet', None) + + +class VnetGateway(ProxyOnlyResource): + """The Virtual Network gateway contract. This is used to give the Virtual Network gateway access to the VPN package. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param vnet_name: The Virtual Network name. + :type vnet_name: str + :param vpn_package_uri: The URI where the VPN package can be downloaded. + :type vpn_package_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vpn_package_uri': {'key': 'properties.vpnPackageUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VnetGateway, self).__init__(**kwargs) + self.vnet_name = kwargs.get('vnet_name', None) + self.vpn_package_uri = kwargs.get('vpn_package_uri', None) + + +class VnetInfo(ProxyOnlyResource): + """Virtual Network information contract. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param vnet_resource_id: The Virtual Network's resource ID. + :type vnet_resource_id: str + :ivar cert_thumbprint: The client certificate thumbprint. + :vartype cert_thumbprint: str + :param cert_blob: A certificate file (.cer) blob containing the public key of the private key + used to authenticate a + Point-To-Site VPN connection. + :type cert_blob: str + :ivar routes: The routes that this Virtual Network connection uses. + :vartype routes: list[~azure.mgmt.web.v2020_06_01.models.VnetRoute] + :ivar resync_required: :code:`true` if a resync is required; otherwise, + :code:`false`. + :vartype resync_required: bool + :param dns_servers: DNS servers to be used by this Virtual Network. This should be a comma- + separated list of IP addresses. + :type dns_servers: str + :param is_swift: Flag that is used to denote if this is VNET injection. + :type is_swift: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'cert_thumbprint': {'readonly': True}, + 'routes': {'readonly': True}, + 'resync_required': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vnet_resource_id': {'key': 'properties.vnetResourceId', 'type': 'str'}, + 'cert_thumbprint': {'key': 'properties.certThumbprint', 'type': 'str'}, + 'cert_blob': {'key': 'properties.certBlob', 'type': 'str'}, + 'routes': {'key': 'properties.routes', 'type': '[VnetRoute]'}, + 'resync_required': {'key': 'properties.resyncRequired', 'type': 'bool'}, + 'dns_servers': {'key': 'properties.dnsServers', 'type': 'str'}, + 'is_swift': {'key': 'properties.isSwift', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(VnetInfo, self).__init__(**kwargs) + self.vnet_resource_id = kwargs.get('vnet_resource_id', None) + self.cert_thumbprint = None + self.cert_blob = kwargs.get('cert_blob', None) + self.routes = None + self.resync_required = None + self.dns_servers = kwargs.get('dns_servers', None) + self.is_swift = kwargs.get('is_swift', None) + + +class VnetParameters(ProxyOnlyResource): + """The required set of inputs to validate a VNET. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param vnet_resource_group: The Resource Group of the VNET to be validated. + :type vnet_resource_group: str + :param vnet_name: The name of the VNET to be validated. + :type vnet_name: str + :param vnet_subnet_name: The subnet name to be validated. + :type vnet_subnet_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vnet_resource_group': {'key': 'properties.vnetResourceGroup', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'properties.vnetSubnetName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VnetParameters, self).__init__(**kwargs) + self.vnet_resource_group = kwargs.get('vnet_resource_group', None) + self.vnet_name = kwargs.get('vnet_name', None) + self.vnet_subnet_name = kwargs.get('vnet_subnet_name', None) + + +class VnetRoute(ProxyOnlyResource): + """Virtual Network route contract used to pass routing information for a Virtual Network. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param start_address: The starting address for this route. This may also include a CIDR + notation, in which case the end address must not be specified. + :type start_address: str + :param end_address: The ending address for this route. If the start address is specified in + CIDR notation, this must be omitted. + :type end_address: str + :param route_type: The type of route this is: + DEFAULT - By default, every app has routes to the local address ranges specified by RFC1918 + INHERITED - Routes inherited from the real Virtual Network routes + STATIC - Static route set on the app only + + These values will be used for syncing an app's routes with those from a Virtual Network. + Possible values include: "DEFAULT", "INHERITED", "STATIC". + :type route_type: str or ~azure.mgmt.web.v2020_06_01.models.RouteType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_address': {'key': 'properties.startAddress', 'type': 'str'}, + 'end_address': {'key': 'properties.endAddress', 'type': 'str'}, + 'route_type': {'key': 'properties.routeType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VnetRoute, self).__init__(**kwargs) + self.start_address = kwargs.get('start_address', None) + self.end_address = kwargs.get('end_address', None) + self.route_type = kwargs.get('route_type', None) + + +class VnetValidationFailureDetails(ProxyOnlyResource): + """A class that describes the reason for a validation failure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param failed: A flag describing whether or not validation failed. + :type failed: bool + :param failed_tests: A list of tests that failed in the validation. + :type failed_tests: list[~azure.mgmt.web.v2020_06_01.models.VnetValidationTestFailure] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'failed': {'key': 'properties.failed', 'type': 'bool'}, + 'failed_tests': {'key': 'properties.failedTests', 'type': '[VnetValidationTestFailure]'}, + } + + def __init__( + self, + **kwargs + ): + super(VnetValidationFailureDetails, self).__init__(**kwargs) + self.failed = kwargs.get('failed', None) + self.failed_tests = kwargs.get('failed_tests', None) + + +class VnetValidationTestFailure(ProxyOnlyResource): + """A class that describes a test that failed during NSG and UDR validation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param test_name: The name of the test that failed. + :type test_name: str + :param details: The details of what caused the failure, e.g. the blocking rule name, etc. + :type details: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'test_name': {'key': 'properties.testName', 'type': 'str'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VnetValidationTestFailure, self).__init__(**kwargs) + self.test_name = kwargs.get('test_name', None) + self.details = kwargs.get('details', None) + + +class WebAppCollection(msrest.serialization.Model): + """Collection of App Service apps. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.Site] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Site]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WebAppCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class WebAppInstanceStatusCollection(msrest.serialization.Model): + """Collection of app instances. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.WebSiteInstanceStatus] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WebSiteInstanceStatus]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WebAppInstanceStatusCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class WebJob(ProxyOnlyResource): + """Web Job Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param run_command: Run command. + :type run_command: str + :param url: Job URL. + :type url: str + :param extra_info_url: Extra Info URL. + :type extra_info_url: str + :param web_job_type: Job type. Possible values include: "Continuous", "Triggered". + :type web_job_type: str or ~azure.mgmt.web.v2020_06_01.models.WebJobType + :param error: Error information. + :type error: str + :param using_sdk: Using SDK?. + :type using_sdk: bool + :param settings: Job settings. + :type settings: dict[str, object] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'run_command': {'key': 'properties.run_command', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'extra_info_url': {'key': 'properties.extra_info_url', 'type': 'str'}, + 'web_job_type': {'key': 'properties.web_job_type', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'str'}, + 'using_sdk': {'key': 'properties.using_sdk', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(WebJob, self).__init__(**kwargs) + self.run_command = kwargs.get('run_command', None) + self.url = kwargs.get('url', None) + self.extra_info_url = kwargs.get('extra_info_url', None) + self.web_job_type = kwargs.get('web_job_type', None) + self.error = kwargs.get('error', None) + self.using_sdk = kwargs.get('using_sdk', None) + self.settings = kwargs.get('settings', None) + + +class WebJobCollection(msrest.serialization.Model): + """Collection of Kudu web job information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.WebJob] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WebJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WebJobCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class WebSiteInstanceStatus(ProxyOnlyResource): + """WebSiteInstanceStatus. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param state: Possible values include: "READY", "STOPPED", "UNKNOWN". + :type state: str or ~azure.mgmt.web.v2020_06_01.models.SiteRuntimeState + :param status_url: Link to the GetStatusApi in Kudu. + :type status_url: str + :param detector_url: Link to the Diagnose and Solve Portal. + :type detector_url: str + :param console_url: Link to the console to web app instance. + :type console_url: str + :param health_check_url: Link to the console to web app instance. + :type health_check_url: str + :param containers: Dictionary of :code:``. + :type containers: dict[str, ~azure.mgmt.web.v2020_06_01.models.ContainerInfo] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'status_url': {'key': 'properties.statusUrl', 'type': 'str'}, + 'detector_url': {'key': 'properties.detectorUrl', 'type': 'str'}, + 'console_url': {'key': 'properties.consoleUrl', 'type': 'str'}, + 'health_check_url': {'key': 'properties.healthCheckUrl', 'type': 'str'}, + 'containers': {'key': 'properties.containers', 'type': '{ContainerInfo}'}, + } + + def __init__( + self, + **kwargs + ): + super(WebSiteInstanceStatus, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.status_url = kwargs.get('status_url', None) + self.detector_url = kwargs.get('detector_url', None) + self.console_url = kwargs.get('console_url', None) + self.health_check_url = kwargs.get('health_check_url', None) + self.containers = kwargs.get('containers', None) + + +class WorkerPool(msrest.serialization.Model): + """Worker pool of an App Service Environment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param worker_size_id: Worker size ID for referencing this worker pool. + :type worker_size_id: int + :param compute_mode: Shared or dedicated app hosting. Possible values include: "Shared", + "Dedicated", "Dynamic". + :type compute_mode: str or ~azure.mgmt.web.v2020_06_01.models.ComputeModeOptions + :param worker_size: VM size of the worker pool instances. + :type worker_size: str + :param worker_count: Number of instances in the worker pool. + :type worker_count: int + :ivar instance_names: Names of all instances in the worker pool (read only). + :vartype instance_names: list[str] + """ + + _validation = { + 'instance_names': {'readonly': True}, + } + + _attribute_map = { + 'worker_size_id': {'key': 'workerSizeId', 'type': 'int'}, + 'compute_mode': {'key': 'computeMode', 'type': 'str'}, + 'worker_size': {'key': 'workerSize', 'type': 'str'}, + 'worker_count': {'key': 'workerCount', 'type': 'int'}, + 'instance_names': {'key': 'instanceNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkerPool, self).__init__(**kwargs) + self.worker_size_id = kwargs.get('worker_size_id', None) + self.compute_mode = kwargs.get('compute_mode', None) + self.worker_size = kwargs.get('worker_size', None) + self.worker_count = kwargs.get('worker_count', None) + self.instance_names = None + + +class WorkerPoolCollection(msrest.serialization.Model): + """Collection of worker pools. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkerPoolResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkerPoolCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class WorkerPoolResource(ProxyOnlyResource): + """Worker pool of an App Service Environment ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param sku: Description of a SKU for a scalable resource. + :type sku: ~azure.mgmt.web.v2020_06_01.models.SkuDescription + :param worker_size_id: Worker size ID for referencing this worker pool. + :type worker_size_id: int + :param compute_mode: Shared or dedicated app hosting. Possible values include: "Shared", + "Dedicated", "Dynamic". + :type compute_mode: str or ~azure.mgmt.web.v2020_06_01.models.ComputeModeOptions + :param worker_size: VM size of the worker pool instances. + :type worker_size: str + :param worker_count: Number of instances in the worker pool. + :type worker_count: int + :ivar instance_names: Names of all instances in the worker pool (read only). + :vartype instance_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'instance_names': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'worker_size_id': {'key': 'properties.workerSizeId', 'type': 'int'}, + 'compute_mode': {'key': 'properties.computeMode', 'type': 'str'}, + 'worker_size': {'key': 'properties.workerSize', 'type': 'str'}, + 'worker_count': {'key': 'properties.workerCount', 'type': 'int'}, + 'instance_names': {'key': 'properties.instanceNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkerPoolResource, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.worker_size_id = kwargs.get('worker_size_id', None) + self.compute_mode = kwargs.get('compute_mode', None) + self.worker_size = kwargs.get('worker_size', None) + self.worker_count = kwargs.get('worker_count', None) + self.instance_names = None diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/models/_models_py3.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/models/_models_py3.py new file mode 100644 index 000000000000..f4b8a591914f --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/models/_models_py3.py @@ -0,0 +1,18799 @@ +# 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. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._web_site_management_client_enums import * + + +class AbnormalTimePeriod(msrest.serialization.Model): + """Class representing Abnormal Time Period identified in diagnosis. + + :param start_time: Start time of the downtime. + :type start_time: ~datetime.datetime + :param end_time: End time of the downtime. + :type end_time: ~datetime.datetime + :param events: List of Possible Cause of downtime. + :type events: list[~azure.mgmt.web.v2020_06_01.models.DetectorAbnormalTimePeriod] + :param solutions: List of proposed solutions. + :type solutions: list[~azure.mgmt.web.v2020_06_01.models.Solution] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'events': {'key': 'events', 'type': '[DetectorAbnormalTimePeriod]'}, + 'solutions': {'key': 'solutions', 'type': '[Solution]'}, + } + + def __init__( + self, + *, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + events: Optional[List["DetectorAbnormalTimePeriod"]] = None, + solutions: Optional[List["Solution"]] = None, + **kwargs + ): + super(AbnormalTimePeriod, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.events = events + self.solutions = solutions + + +class Address(msrest.serialization.Model): + """Address information for domain registration. + + All required parameters must be populated in order to send to Azure. + + :param address1: Required. First line of an Address. + :type address1: str + :param address2: The second line of the Address. Optional. + :type address2: str + :param city: Required. The city for the address. + :type city: str + :param country: Required. The country for the address. + :type country: str + :param postal_code: Required. The postal code for the address. + :type postal_code: str + :param state: Required. The state or province for the address. + :type state: str + """ + + _validation = { + 'address1': {'required': True}, + 'city': {'required': True}, + 'country': {'required': True}, + 'postal_code': {'required': True}, + 'state': {'required': True}, + } + + _attribute_map = { + 'address1': {'key': 'address1', 'type': 'str'}, + 'address2': {'key': 'address2', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + *, + address1: str, + city: str, + country: str, + postal_code: str, + state: str, + address2: Optional[str] = None, + **kwargs + ): + super(Address, self).__init__(**kwargs) + self.address1 = address1 + self.address2 = address2 + self.city = city + self.country = country + self.postal_code = postal_code + self.state = state + + +class ProxyOnlyResource(msrest.serialization.Model): + """Azure proxy only resource. This resource is not tracked by Azure Resource Manager. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(ProxyOnlyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.kind = kind + self.type = None + + +class AddressResponse(ProxyOnlyResource): + """Describes main public IP address and any extra virtual IPs. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param service_ip_address: Main public virtual IP. + :type service_ip_address: str + :param internal_ip_address: Virtual Network internal IP address of the App Service Environment + if it is in internal load-balancing mode. + :type internal_ip_address: str + :param outbound_ip_addresses: IP addresses appearing on outbound connections. + :type outbound_ip_addresses: list[str] + :param vip_mappings: Additional virtual IPs. + :type vip_mappings: list[~azure.mgmt.web.v2020_06_01.models.VirtualIPMapping] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'service_ip_address': {'key': 'properties.serviceIpAddress', 'type': 'str'}, + 'internal_ip_address': {'key': 'properties.internalIpAddress', 'type': 'str'}, + 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': '[str]'}, + 'vip_mappings': {'key': 'properties.vipMappings', 'type': '[VirtualIPMapping]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + service_ip_address: Optional[str] = None, + internal_ip_address: Optional[str] = None, + outbound_ip_addresses: Optional[List[str]] = None, + vip_mappings: Optional[List["VirtualIPMapping"]] = None, + **kwargs + ): + super(AddressResponse, self).__init__(kind=kind, **kwargs) + self.service_ip_address = service_ip_address + self.internal_ip_address = internal_ip_address + self.outbound_ip_addresses = outbound_ip_addresses + self.vip_mappings = vip_mappings + + +class AllowedAudiencesValidation(ProxyOnlyResource): + """AllowedAudiencesValidation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param allowed_audiences: + :type allowed_audiences: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + allowed_audiences: Optional[List[str]] = None, + **kwargs + ): + super(AllowedAudiencesValidation, self).__init__(kind=kind, **kwargs) + self.allowed_audiences = allowed_audiences + + +class AnalysisData(msrest.serialization.Model): + """Class Representing Detector Evidence used for analysis. + + :param source: Name of the Detector. + :type source: str + :param detector_definition: Detector Definition. + :type detector_definition: ~azure.mgmt.web.v2020_06_01.models.DetectorDefinition + :param metrics: Source Metrics. + :type metrics: list[~azure.mgmt.web.v2020_06_01.models.DiagnosticMetricSet] + :param data: Additional Source Data. + :type data: list[list[~azure.mgmt.web.v2020_06_01.models.NameValuePair]] + :param detector_meta_data: Detector Meta Data. + :type detector_meta_data: ~azure.mgmt.web.v2020_06_01.models.ResponseMetaData + """ + + _attribute_map = { + 'source': {'key': 'source', 'type': 'str'}, + 'detector_definition': {'key': 'detectorDefinition', 'type': 'DetectorDefinition'}, + 'metrics': {'key': 'metrics', 'type': '[DiagnosticMetricSet]'}, + 'data': {'key': 'data', 'type': '[[NameValuePair]]'}, + 'detector_meta_data': {'key': 'detectorMetaData', 'type': 'ResponseMetaData'}, + } + + def __init__( + self, + *, + source: Optional[str] = None, + detector_definition: Optional["DetectorDefinition"] = None, + metrics: Optional[List["DiagnosticMetricSet"]] = None, + data: Optional[List[List["NameValuePair"]]] = None, + detector_meta_data: Optional["ResponseMetaData"] = None, + **kwargs + ): + super(AnalysisData, self).__init__(**kwargs) + self.source = source + self.detector_definition = detector_definition + self.metrics = metrics + self.data = data + self.detector_meta_data = detector_meta_data + + +class AnalysisDefinition(ProxyOnlyResource): + """Definition of Analysis. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar description: Description of the Analysis. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(AnalysisDefinition, self).__init__(kind=kind, **kwargs) + self.description = None + + +class ApiDefinitionInfo(msrest.serialization.Model): + """Information about the formal API definition for the app. + + :param url: The URL of the API definition. + :type url: str + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__( + self, + *, + url: Optional[str] = None, + **kwargs + ): + super(ApiDefinitionInfo, self).__init__(**kwargs) + self.url = url + + +class ApiManagementConfig(msrest.serialization.Model): + """Azure API management (APIM) configuration linked to the app. + + :param id: APIM-Api Identifier. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(ApiManagementConfig, self).__init__(**kwargs) + self.id = id + + +class ApplicationLogsConfig(msrest.serialization.Model): + """Application logs configuration. + + :param file_system: Application logs to file system configuration. + :type file_system: ~azure.mgmt.web.v2020_06_01.models.FileSystemApplicationLogsConfig + :param azure_table_storage: Application logs to azure table storage configuration. + :type azure_table_storage: + ~azure.mgmt.web.v2020_06_01.models.AzureTableStorageApplicationLogsConfig + :param azure_blob_storage: Application logs to blob storage configuration. + :type azure_blob_storage: + ~azure.mgmt.web.v2020_06_01.models.AzureBlobStorageApplicationLogsConfig + """ + + _attribute_map = { + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemApplicationLogsConfig'}, + 'azure_table_storage': {'key': 'azureTableStorage', 'type': 'AzureTableStorageApplicationLogsConfig'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'AzureBlobStorageApplicationLogsConfig'}, + } + + def __init__( + self, + *, + file_system: Optional["FileSystemApplicationLogsConfig"] = None, + azure_table_storage: Optional["AzureTableStorageApplicationLogsConfig"] = None, + azure_blob_storage: Optional["AzureBlobStorageApplicationLogsConfig"] = None, + **kwargs + ): + super(ApplicationLogsConfig, self).__init__(**kwargs) + self.file_system = file_system + self.azure_table_storage = azure_table_storage + self.azure_blob_storage = azure_blob_storage + + +class ApplicationStack(msrest.serialization.Model): + """Application stack. + + :param name: Application stack name. + :type name: str + :param display: Application stack display name. + :type display: str + :param dependency: Application stack dependency. + :type dependency: str + :param major_versions: List of major versions available. + :type major_versions: list[~azure.mgmt.web.v2020_06_01.models.StackMajorVersion] + :param frameworks: List of frameworks associated with application stack. + :type frameworks: list[~azure.mgmt.web.v2020_06_01.models.ApplicationStack] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'str'}, + 'dependency': {'key': 'dependency', 'type': 'str'}, + 'major_versions': {'key': 'majorVersions', 'type': '[StackMajorVersion]'}, + 'frameworks': {'key': 'frameworks', 'type': '[ApplicationStack]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional[str] = None, + dependency: Optional[str] = None, + major_versions: Optional[List["StackMajorVersion"]] = None, + frameworks: Optional[List["ApplicationStack"]] = None, + **kwargs + ): + super(ApplicationStack, self).__init__(**kwargs) + self.name = name + self.display = display + self.dependency = dependency + self.major_versions = major_versions + self.frameworks = frameworks + + +class ApplicationStackCollection(msrest.serialization.Model): + """Collection of Application Stacks. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.ApplicationStackResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationStackResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ApplicationStackResource"], + **kwargs + ): + super(ApplicationStackCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ApplicationStackResource(ProxyOnlyResource): + """ARM resource for a ApplicationStack. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param name_properties_name: Application stack name. + :type name_properties_name: str + :param display: Application stack display name. + :type display: str + :param dependency: Application stack dependency. + :type dependency: str + :param major_versions: List of major versions available. + :type major_versions: list[~azure.mgmt.web.v2020_06_01.models.StackMajorVersion] + :param frameworks: List of frameworks associated with application stack. + :type frameworks: list[~azure.mgmt.web.v2020_06_01.models.ApplicationStack] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'display': {'key': 'properties.display', 'type': 'str'}, + 'dependency': {'key': 'properties.dependency', 'type': 'str'}, + 'major_versions': {'key': 'properties.majorVersions', 'type': '[StackMajorVersion]'}, + 'frameworks': {'key': 'properties.frameworks', 'type': '[ApplicationStack]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + name_properties_name: Optional[str] = None, + display: Optional[str] = None, + dependency: Optional[str] = None, + major_versions: Optional[List["StackMajorVersion"]] = None, + frameworks: Optional[List["ApplicationStack"]] = None, + **kwargs + ): + super(ApplicationStackResource, self).__init__(kind=kind, **kwargs) + self.name_properties_name = name_properties_name + self.display = display + self.dependency = dependency + self.major_versions = major_versions + self.frameworks = frameworks + + +class AppRegistration(ProxyOnlyResource): + """AppRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param app_id: + :type app_id: str + :param app_secret_setting_name: + :type app_secret_setting_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'app_id': {'key': 'properties.appId', 'type': 'str'}, + 'app_secret_setting_name': {'key': 'properties.appSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + app_id: Optional[str] = None, + app_secret_setting_name: Optional[str] = None, + **kwargs + ): + super(AppRegistration, self).__init__(kind=kind, **kwargs) + self.app_id = app_id + self.app_secret_setting_name = app_secret_setting_name + + +class AppServiceCertificate(msrest.serialization.Model): + """Key Vault container for a certificate that is purchased through Azure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param key_vault_id: Key Vault resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar provisioning_state: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.KeyVaultSecretStatus + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'key_vault_id': {'key': 'keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'keyVaultSecretName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + key_vault_id: Optional[str] = None, + key_vault_secret_name: Optional[str] = None, + **kwargs + ): + super(AppServiceCertificate, self).__init__(**kwargs) + self.key_vault_id = key_vault_id + self.key_vault_secret_name = key_vault_secret_name + self.provisioning_state = None + + +class AppServiceCertificateCollection(msrest.serialization.Model): + """Collection of certificate order certificates. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServiceCertificateResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["AppServiceCertificateResource"], + **kwargs + ): + super(AppServiceCertificateCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class Resource(msrest.serialization.Model): + """Azure resource. This resource is tracked in Azure Resource Manager. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.kind = kind + self.location = location + self.type = None + self.tags = tags + + +class AppServiceCertificateOrder(Resource): + """SSL certificate purchase order. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param certificates: State of the Key Vault secret. + :type certificates: dict[str, ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificate] + :param distinguished_name: Certificate distinguished name. + :type distinguished_name: str + :ivar domain_verification_token: Domain verification token. + :vartype domain_verification_token: str + :param validity_in_years: Duration in years (must be between 1 and 3). + :type validity_in_years: int + :param key_size: Certificate key size. + :type key_size: int + :param product_type: Certificate product type. Possible values include: + "StandardDomainValidatedSsl", "StandardDomainValidatedWildCardSsl". + :type product_type: str or ~azure.mgmt.web.v2020_06_01.models.CertificateProductType + :param auto_renew: :code:`true` if the certificate should be automatically renewed + when it expires; otherwise, :code:`false`. + :type auto_renew: bool + :ivar provisioning_state: Status of certificate order. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.ProvisioningState + :ivar status: Current order status. Possible values include: "Pendingissuance", "Issued", + "Revoked", "Canceled", "Denied", "Pendingrevocation", "PendingRekey", "Unused", "Expired", + "NotSubmitted". + :vartype status: str or ~azure.mgmt.web.v2020_06_01.models.CertificateOrderStatus + :ivar signed_certificate: Signed certificate. + :vartype signed_certificate: ~azure.mgmt.web.v2020_06_01.models.CertificateDetails + :param csr: Last CSR that was created for this order. + :type csr: str + :ivar intermediate: Intermediate certificate. + :vartype intermediate: ~azure.mgmt.web.v2020_06_01.models.CertificateDetails + :ivar root: Root certificate. + :vartype root: ~azure.mgmt.web.v2020_06_01.models.CertificateDetails + :ivar serial_number: Current serial number of the certificate. + :vartype serial_number: str + :ivar last_certificate_issuance_time: Certificate last issuance time. + :vartype last_certificate_issuance_time: ~datetime.datetime + :ivar expiration_time: Certificate expiration time. + :vartype expiration_time: ~datetime.datetime + :ivar is_private_key_external: :code:`true` if private key is external; otherwise, + :code:`false`. + :vartype is_private_key_external: bool + :ivar app_service_certificate_not_renewable_reasons: Reasons why App Service Certificate is not + renewable at the current moment. + :vartype app_service_certificate_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem] + :ivar next_auto_renewal_time_stamp: Time stamp when the certificate would be auto renewed next. + :vartype next_auto_renewal_time_stamp: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'domain_verification_token': {'readonly': True}, + 'validity_in_years': {'maximum': 3, 'minimum': 1}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'signed_certificate': {'readonly': True}, + 'intermediate': {'readonly': True}, + 'root': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'last_certificate_issuance_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'is_private_key_external': {'readonly': True}, + 'app_service_certificate_not_renewable_reasons': {'readonly': True}, + 'next_auto_renewal_time_stamp': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'certificates': {'key': 'properties.certificates', 'type': '{AppServiceCertificate}'}, + 'distinguished_name': {'key': 'properties.distinguishedName', 'type': 'str'}, + 'domain_verification_token': {'key': 'properties.domainVerificationToken', 'type': 'str'}, + 'validity_in_years': {'key': 'properties.validityInYears', 'type': 'int'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'signed_certificate': {'key': 'properties.signedCertificate', 'type': 'CertificateDetails'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'intermediate': {'key': 'properties.intermediate', 'type': 'CertificateDetails'}, + 'root': {'key': 'properties.root', 'type': 'CertificateDetails'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'last_certificate_issuance_time': {'key': 'properties.lastCertificateIssuanceTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + 'app_service_certificate_not_renewable_reasons': {'key': 'properties.appServiceCertificateNotRenewableReasons', 'type': '[str]'}, + 'next_auto_renewal_time_stamp': {'key': 'properties.nextAutoRenewalTimeStamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + certificates: Optional[Dict[str, "AppServiceCertificate"]] = None, + distinguished_name: Optional[str] = None, + validity_in_years: Optional[int] = 1, + key_size: Optional[int] = 2048, + product_type: Optional[Union[str, "CertificateProductType"]] = None, + auto_renew: Optional[bool] = True, + csr: Optional[str] = None, + **kwargs + ): + super(AppServiceCertificateOrder, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.certificates = certificates + self.distinguished_name = distinguished_name + self.domain_verification_token = None + self.validity_in_years = validity_in_years + self.key_size = key_size + self.product_type = product_type + self.auto_renew = auto_renew + self.provisioning_state = None + self.status = None + self.signed_certificate = None + self.csr = csr + self.intermediate = None + self.root = None + self.serial_number = None + self.last_certificate_issuance_time = None + self.expiration_time = None + self.is_private_key_external = None + self.app_service_certificate_not_renewable_reasons = None + self.next_auto_renewal_time_stamp = None + + +class AppServiceCertificateOrderCollection(msrest.serialization.Model): + """Collection of certificate orders. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrder] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServiceCertificateOrder]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["AppServiceCertificateOrder"], + **kwargs + ): + super(AppServiceCertificateOrderCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class AppServiceCertificateOrderPatchResource(ProxyOnlyResource): + """ARM resource for a certificate order that is purchased through Azure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param certificates: State of the Key Vault secret. + :type certificates: dict[str, ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificate] + :param distinguished_name: Certificate distinguished name. + :type distinguished_name: str + :ivar domain_verification_token: Domain verification token. + :vartype domain_verification_token: str + :param validity_in_years: Duration in years (must be between 1 and 3). + :type validity_in_years: int + :param key_size: Certificate key size. + :type key_size: int + :param product_type: Certificate product type. Possible values include: + "StandardDomainValidatedSsl", "StandardDomainValidatedWildCardSsl". + :type product_type: str or ~azure.mgmt.web.v2020_06_01.models.CertificateProductType + :param auto_renew: :code:`true` if the certificate should be automatically renewed + when it expires; otherwise, :code:`false`. + :type auto_renew: bool + :ivar provisioning_state: Status of certificate order. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.ProvisioningState + :ivar status: Current order status. Possible values include: "Pendingissuance", "Issued", + "Revoked", "Canceled", "Denied", "Pendingrevocation", "PendingRekey", "Unused", "Expired", + "NotSubmitted". + :vartype status: str or ~azure.mgmt.web.v2020_06_01.models.CertificateOrderStatus + :ivar signed_certificate: Signed certificate. + :vartype signed_certificate: ~azure.mgmt.web.v2020_06_01.models.CertificateDetails + :param csr: Last CSR that was created for this order. + :type csr: str + :ivar intermediate: Intermediate certificate. + :vartype intermediate: ~azure.mgmt.web.v2020_06_01.models.CertificateDetails + :ivar root: Root certificate. + :vartype root: ~azure.mgmt.web.v2020_06_01.models.CertificateDetails + :ivar serial_number: Current serial number of the certificate. + :vartype serial_number: str + :ivar last_certificate_issuance_time: Certificate last issuance time. + :vartype last_certificate_issuance_time: ~datetime.datetime + :ivar expiration_time: Certificate expiration time. + :vartype expiration_time: ~datetime.datetime + :ivar is_private_key_external: :code:`true` if private key is external; otherwise, + :code:`false`. + :vartype is_private_key_external: bool + :ivar app_service_certificate_not_renewable_reasons: Reasons why App Service Certificate is not + renewable at the current moment. + :vartype app_service_certificate_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem] + :ivar next_auto_renewal_time_stamp: Time stamp when the certificate would be auto renewed next. + :vartype next_auto_renewal_time_stamp: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'domain_verification_token': {'readonly': True}, + 'validity_in_years': {'maximum': 3, 'minimum': 1}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'signed_certificate': {'readonly': True}, + 'intermediate': {'readonly': True}, + 'root': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'last_certificate_issuance_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'is_private_key_external': {'readonly': True}, + 'app_service_certificate_not_renewable_reasons': {'readonly': True}, + 'next_auto_renewal_time_stamp': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'certificates': {'key': 'properties.certificates', 'type': '{AppServiceCertificate}'}, + 'distinguished_name': {'key': 'properties.distinguishedName', 'type': 'str'}, + 'domain_verification_token': {'key': 'properties.domainVerificationToken', 'type': 'str'}, + 'validity_in_years': {'key': 'properties.validityInYears', 'type': 'int'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'signed_certificate': {'key': 'properties.signedCertificate', 'type': 'CertificateDetails'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'intermediate': {'key': 'properties.intermediate', 'type': 'CertificateDetails'}, + 'root': {'key': 'properties.root', 'type': 'CertificateDetails'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'last_certificate_issuance_time': {'key': 'properties.lastCertificateIssuanceTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + 'app_service_certificate_not_renewable_reasons': {'key': 'properties.appServiceCertificateNotRenewableReasons', 'type': '[str]'}, + 'next_auto_renewal_time_stamp': {'key': 'properties.nextAutoRenewalTimeStamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + certificates: Optional[Dict[str, "AppServiceCertificate"]] = None, + distinguished_name: Optional[str] = None, + validity_in_years: Optional[int] = 1, + key_size: Optional[int] = 2048, + product_type: Optional[Union[str, "CertificateProductType"]] = None, + auto_renew: Optional[bool] = True, + csr: Optional[str] = None, + **kwargs + ): + super(AppServiceCertificateOrderPatchResource, self).__init__(kind=kind, **kwargs) + self.certificates = certificates + self.distinguished_name = distinguished_name + self.domain_verification_token = None + self.validity_in_years = validity_in_years + self.key_size = key_size + self.product_type = product_type + self.auto_renew = auto_renew + self.provisioning_state = None + self.status = None + self.signed_certificate = None + self.csr = csr + self.intermediate = None + self.root = None + self.serial_number = None + self.last_certificate_issuance_time = None + self.expiration_time = None + self.is_private_key_external = None + self.app_service_certificate_not_renewable_reasons = None + self.next_auto_renewal_time_stamp = None + + +class AppServiceCertificatePatchResource(ProxyOnlyResource): + """Key Vault container ARM resource for a certificate that is purchased through Azure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param key_vault_id: Key Vault resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar provisioning_state: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.KeyVaultSecretStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + key_vault_id: Optional[str] = None, + key_vault_secret_name: Optional[str] = None, + **kwargs + ): + super(AppServiceCertificatePatchResource, self).__init__(kind=kind, **kwargs) + self.key_vault_id = key_vault_id + self.key_vault_secret_name = key_vault_secret_name + self.provisioning_state = None + + +class AppServiceCertificateResource(Resource): + """Key Vault container ARM resource for a certificate that is purchased through Azure. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param key_vault_id: Key Vault resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar provisioning_state: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.KeyVaultSecretStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + key_vault_id: Optional[str] = None, + key_vault_secret_name: Optional[str] = None, + **kwargs + ): + super(AppServiceCertificateResource, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.key_vault_id = key_vault_id + self.key_vault_secret_name = key_vault_secret_name + self.provisioning_state = None + + +class AppServiceEnvironment(msrest.serialization.Model): + """Description of an App Service Environment. + + 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. + + :param name: Required. Name of the App Service Environment. + :type name: str + :param location: Required. Location of the App Service Environment, e.g. "West US". + :type location: str + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.ProvisioningState + :ivar status: Current status of the App Service Environment. Possible values include: + "Preparing", "Ready", "Scaling", "Deleting". + :vartype status: str or ~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentStatus + :param vnet_name: Name of the Virtual Network for the App Service Environment. + :type vnet_name: str + :param vnet_resource_group_name: Resource group of the Virtual Network. + :type vnet_resource_group_name: str + :param vnet_subnet_name: Subnet of the Virtual Network. + :type vnet_subnet_name: str + :param virtual_network: Required. Description of the Virtual Network. + :type virtual_network: ~azure.mgmt.web.v2020_06_01.models.VirtualNetworkProfile + :param internal_load_balancing_mode: Specifies which endpoints to serve internally in the + Virtual Network for the App Service Environment. Possible values include: "None", "Web", + "Publishing", "Web,Publishing". + :type internal_load_balancing_mode: str or ~azure.mgmt.web.v2020_06_01.models.LoadBalancingMode + :param multi_size: Front-end VM size, e.g. "Medium", "Large". + :type multi_size: str + :param multi_role_count: Number of front-end instances. + :type multi_role_count: int + :param worker_pools: Required. Description of worker pools with worker size IDs, VM sizes, and + number of workers in each pool. + :type worker_pools: list[~azure.mgmt.web.v2020_06_01.models.WorkerPool] + :param ipssl_address_count: Number of IP SSL addresses reserved for the App Service + Environment. + :type ipssl_address_count: int + :ivar database_edition: Edition of the metadata database for the App Service Environment, e.g. + "Standard". + :vartype database_edition: str + :ivar database_service_objective: Service objective of the metadata database for the App + Service Environment, e.g. "S0". + :vartype database_service_objective: str + :ivar upgrade_domains: Number of upgrade domains of the App Service Environment. + :vartype upgrade_domains: int + :ivar subscription_id: Subscription of the App Service Environment. + :vartype subscription_id: str + :param dns_suffix: DNS suffix of the App Service Environment. + :type dns_suffix: str + :ivar last_action: Last deployment action on the App Service Environment. + :vartype last_action: str + :ivar last_action_result: Result of the last deployment action on the App Service Environment. + :vartype last_action_result: str + :ivar allowed_multi_sizes: List of comma separated strings describing which VM sizes are + allowed for front-ends. + :vartype allowed_multi_sizes: str + :ivar allowed_worker_sizes: List of comma separated strings describing which VM sizes are + allowed for workers. + :vartype allowed_worker_sizes: str + :ivar maximum_number_of_machines: Maximum number of VMs in the App Service Environment. + :vartype maximum_number_of_machines: int + :ivar vip_mappings: Description of IP SSL mapping for the App Service Environment. + :vartype vip_mappings: list[~azure.mgmt.web.v2020_06_01.models.VirtualIPMapping] + :ivar environment_capacities: Current total, used, and available worker capacities. + :vartype environment_capacities: list[~azure.mgmt.web.v2020_06_01.models.StampCapacity] + :param network_access_control_list: Access control list for controlling traffic to the App + Service Environment. + :type network_access_control_list: + list[~azure.mgmt.web.v2020_06_01.models.NetworkAccessControlEntry] + :ivar environment_is_healthy: True/false indicating whether the App Service Environment is + healthy. + :vartype environment_is_healthy: bool + :ivar environment_status: Detailed message about with results of the last check of the App + Service Environment. + :vartype environment_status: str + :ivar resource_group: Resource group of the App Service Environment. + :vartype resource_group: str + :param front_end_scale_factor: Scale factor for front-ends. + :type front_end_scale_factor: int + :ivar default_front_end_scale_factor: Default Scale Factor for FrontEnds. + :vartype default_front_end_scale_factor: int + :param api_management_account_id: API Management Account associated with the App Service + Environment. + :type api_management_account_id: str + :param suspended: :code:`true` if the App Service Environment is suspended; + otherwise, :code:`false`. The environment can be suspended, e.g. when the + management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :type suspended: bool + :param dynamic_cache_enabled: True/false indicating whether the App Service Environment is + suspended. The environment can be suspended e.g. when the management endpoint is no longer + available + (most likely because NSG blocked the incoming traffic). + :type dynamic_cache_enabled: bool + :param cluster_settings: Custom settings for changing the behavior of the App Service + Environment. + :type cluster_settings: list[~azure.mgmt.web.v2020_06_01.models.NameValuePair] + :param user_whitelisted_ip_ranges: User added ip ranges to whitelist on ASE db. + :type user_whitelisted_ip_ranges: list[str] + :param has_linux_workers: Flag that displays whether an ASE has linux workers or not. + :type has_linux_workers: bool + :param ssl_cert_key_vault_id: Key Vault ID for ILB App Service Environment default SSL + certificate. + :type ssl_cert_key_vault_id: str + :param ssl_cert_key_vault_secret_name: Key Vault Secret Name for ILB App Service Environment + default SSL certificate. + :type ssl_cert_key_vault_secret_name: str + """ + + _validation = { + 'name': {'required': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'virtual_network': {'required': True}, + 'worker_pools': {'required': True}, + 'database_edition': {'readonly': True}, + 'database_service_objective': {'readonly': True}, + 'upgrade_domains': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'last_action': {'readonly': True}, + 'last_action_result': {'readonly': True}, + 'allowed_multi_sizes': {'readonly': True}, + 'allowed_worker_sizes': {'readonly': True}, + 'maximum_number_of_machines': {'readonly': True}, + 'vip_mappings': {'readonly': True}, + 'environment_capacities': {'readonly': True}, + 'environment_is_healthy': {'readonly': True}, + 'environment_status': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'default_front_end_scale_factor': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'vnet_name': {'key': 'vnetName', 'type': 'str'}, + 'vnet_resource_group_name': {'key': 'vnetResourceGroupName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'vnetSubnetName', 'type': 'str'}, + 'virtual_network': {'key': 'virtualNetwork', 'type': 'VirtualNetworkProfile'}, + 'internal_load_balancing_mode': {'key': 'internalLoadBalancingMode', 'type': 'str'}, + 'multi_size': {'key': 'multiSize', 'type': 'str'}, + 'multi_role_count': {'key': 'multiRoleCount', 'type': 'int'}, + 'worker_pools': {'key': 'workerPools', 'type': '[WorkerPool]'}, + 'ipssl_address_count': {'key': 'ipsslAddressCount', 'type': 'int'}, + 'database_edition': {'key': 'databaseEdition', 'type': 'str'}, + 'database_service_objective': {'key': 'databaseServiceObjective', 'type': 'str'}, + 'upgrade_domains': {'key': 'upgradeDomains', 'type': 'int'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'dns_suffix': {'key': 'dnsSuffix', 'type': 'str'}, + 'last_action': {'key': 'lastAction', 'type': 'str'}, + 'last_action_result': {'key': 'lastActionResult', 'type': 'str'}, + 'allowed_multi_sizes': {'key': 'allowedMultiSizes', 'type': 'str'}, + 'allowed_worker_sizes': {'key': 'allowedWorkerSizes', 'type': 'str'}, + 'maximum_number_of_machines': {'key': 'maximumNumberOfMachines', 'type': 'int'}, + 'vip_mappings': {'key': 'vipMappings', 'type': '[VirtualIPMapping]'}, + 'environment_capacities': {'key': 'environmentCapacities', 'type': '[StampCapacity]'}, + 'network_access_control_list': {'key': 'networkAccessControlList', 'type': '[NetworkAccessControlEntry]'}, + 'environment_is_healthy': {'key': 'environmentIsHealthy', 'type': 'bool'}, + 'environment_status': {'key': 'environmentStatus', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'front_end_scale_factor': {'key': 'frontEndScaleFactor', 'type': 'int'}, + 'default_front_end_scale_factor': {'key': 'defaultFrontEndScaleFactor', 'type': 'int'}, + 'api_management_account_id': {'key': 'apiManagementAccountId', 'type': 'str'}, + 'suspended': {'key': 'suspended', 'type': 'bool'}, + 'dynamic_cache_enabled': {'key': 'dynamicCacheEnabled', 'type': 'bool'}, + 'cluster_settings': {'key': 'clusterSettings', 'type': '[NameValuePair]'}, + 'user_whitelisted_ip_ranges': {'key': 'userWhitelistedIpRanges', 'type': '[str]'}, + 'has_linux_workers': {'key': 'hasLinuxWorkers', 'type': 'bool'}, + 'ssl_cert_key_vault_id': {'key': 'sslCertKeyVaultId', 'type': 'str'}, + 'ssl_cert_key_vault_secret_name': {'key': 'sslCertKeyVaultSecretName', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + location: str, + virtual_network: "VirtualNetworkProfile", + worker_pools: List["WorkerPool"], + vnet_name: Optional[str] = None, + vnet_resource_group_name: Optional[str] = None, + vnet_subnet_name: Optional[str] = None, + internal_load_balancing_mode: Optional[Union[str, "LoadBalancingMode"]] = None, + multi_size: Optional[str] = None, + multi_role_count: Optional[int] = None, + ipssl_address_count: Optional[int] = None, + dns_suffix: Optional[str] = None, + network_access_control_list: Optional[List["NetworkAccessControlEntry"]] = None, + front_end_scale_factor: Optional[int] = None, + api_management_account_id: Optional[str] = None, + suspended: Optional[bool] = None, + dynamic_cache_enabled: Optional[bool] = None, + cluster_settings: Optional[List["NameValuePair"]] = None, + user_whitelisted_ip_ranges: Optional[List[str]] = None, + has_linux_workers: Optional[bool] = None, + ssl_cert_key_vault_id: Optional[str] = None, + ssl_cert_key_vault_secret_name: Optional[str] = None, + **kwargs + ): + super(AppServiceEnvironment, self).__init__(**kwargs) + self.name = name + self.location = location + self.provisioning_state = None + self.status = None + self.vnet_name = vnet_name + self.vnet_resource_group_name = vnet_resource_group_name + self.vnet_subnet_name = vnet_subnet_name + self.virtual_network = virtual_network + self.internal_load_balancing_mode = internal_load_balancing_mode + self.multi_size = multi_size + self.multi_role_count = multi_role_count + self.worker_pools = worker_pools + self.ipssl_address_count = ipssl_address_count + self.database_edition = None + self.database_service_objective = None + self.upgrade_domains = None + self.subscription_id = None + self.dns_suffix = dns_suffix + self.last_action = None + self.last_action_result = None + self.allowed_multi_sizes = None + self.allowed_worker_sizes = None + self.maximum_number_of_machines = None + self.vip_mappings = None + self.environment_capacities = None + self.network_access_control_list = network_access_control_list + self.environment_is_healthy = None + self.environment_status = None + self.resource_group = None + self.front_end_scale_factor = front_end_scale_factor + self.default_front_end_scale_factor = None + self.api_management_account_id = api_management_account_id + self.suspended = suspended + self.dynamic_cache_enabled = dynamic_cache_enabled + self.cluster_settings = cluster_settings + self.user_whitelisted_ip_ranges = user_whitelisted_ip_ranges + self.has_linux_workers = has_linux_workers + self.ssl_cert_key_vault_id = ssl_cert_key_vault_id + self.ssl_cert_key_vault_secret_name = ssl_cert_key_vault_secret_name + + +class AppServiceEnvironmentCollection(msrest.serialization.Model): + """Collection of App Service Environments. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.AppServiceEnvironmentResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServiceEnvironmentResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["AppServiceEnvironmentResource"], + **kwargs + ): + super(AppServiceEnvironmentCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class AppServiceEnvironmentPatchResource(ProxyOnlyResource): + """ARM resource for a app service environment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param name_properties_name: Name of the App Service Environment. + :type name_properties_name: str + :param location: Location of the App Service Environment, e.g. "West US". + :type location: str + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.ProvisioningState + :ivar status: Current status of the App Service Environment. Possible values include: + "Preparing", "Ready", "Scaling", "Deleting". + :vartype status: str or ~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentStatus + :param vnet_name: Name of the Virtual Network for the App Service Environment. + :type vnet_name: str + :param vnet_resource_group_name: Resource group of the Virtual Network. + :type vnet_resource_group_name: str + :param vnet_subnet_name: Subnet of the Virtual Network. + :type vnet_subnet_name: str + :param virtual_network: Description of the Virtual Network. + :type virtual_network: ~azure.mgmt.web.v2020_06_01.models.VirtualNetworkProfile + :param internal_load_balancing_mode: Specifies which endpoints to serve internally in the + Virtual Network for the App Service Environment. Possible values include: "None", "Web", + "Publishing", "Web,Publishing". + :type internal_load_balancing_mode: str or ~azure.mgmt.web.v2020_06_01.models.LoadBalancingMode + :param multi_size: Front-end VM size, e.g. "Medium", "Large". + :type multi_size: str + :param multi_role_count: Number of front-end instances. + :type multi_role_count: int + :param worker_pools: Description of worker pools with worker size IDs, VM sizes, and number of + workers in each pool. + :type worker_pools: list[~azure.mgmt.web.v2020_06_01.models.WorkerPool] + :param ipssl_address_count: Number of IP SSL addresses reserved for the App Service + Environment. + :type ipssl_address_count: int + :ivar database_edition: Edition of the metadata database for the App Service Environment, e.g. + "Standard". + :vartype database_edition: str + :ivar database_service_objective: Service objective of the metadata database for the App + Service Environment, e.g. "S0". + :vartype database_service_objective: str + :ivar upgrade_domains: Number of upgrade domains of the App Service Environment. + :vartype upgrade_domains: int + :ivar subscription_id: Subscription of the App Service Environment. + :vartype subscription_id: str + :param dns_suffix: DNS suffix of the App Service Environment. + :type dns_suffix: str + :ivar last_action: Last deployment action on the App Service Environment. + :vartype last_action: str + :ivar last_action_result: Result of the last deployment action on the App Service Environment. + :vartype last_action_result: str + :ivar allowed_multi_sizes: List of comma separated strings describing which VM sizes are + allowed for front-ends. + :vartype allowed_multi_sizes: str + :ivar allowed_worker_sizes: List of comma separated strings describing which VM sizes are + allowed for workers. + :vartype allowed_worker_sizes: str + :ivar maximum_number_of_machines: Maximum number of VMs in the App Service Environment. + :vartype maximum_number_of_machines: int + :ivar vip_mappings: Description of IP SSL mapping for the App Service Environment. + :vartype vip_mappings: list[~azure.mgmt.web.v2020_06_01.models.VirtualIPMapping] + :ivar environment_capacities: Current total, used, and available worker capacities. + :vartype environment_capacities: list[~azure.mgmt.web.v2020_06_01.models.StampCapacity] + :param network_access_control_list: Access control list for controlling traffic to the App + Service Environment. + :type network_access_control_list: + list[~azure.mgmt.web.v2020_06_01.models.NetworkAccessControlEntry] + :ivar environment_is_healthy: True/false indicating whether the App Service Environment is + healthy. + :vartype environment_is_healthy: bool + :ivar environment_status: Detailed message about with results of the last check of the App + Service Environment. + :vartype environment_status: str + :ivar resource_group: Resource group of the App Service Environment. + :vartype resource_group: str + :param front_end_scale_factor: Scale factor for front-ends. + :type front_end_scale_factor: int + :ivar default_front_end_scale_factor: Default Scale Factor for FrontEnds. + :vartype default_front_end_scale_factor: int + :param api_management_account_id: API Management Account associated with the App Service + Environment. + :type api_management_account_id: str + :param suspended: :code:`true` if the App Service Environment is suspended; + otherwise, :code:`false`. The environment can be suspended, e.g. when the + management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :type suspended: bool + :param dynamic_cache_enabled: True/false indicating whether the App Service Environment is + suspended. The environment can be suspended e.g. when the management endpoint is no longer + available + (most likely because NSG blocked the incoming traffic). + :type dynamic_cache_enabled: bool + :param cluster_settings: Custom settings for changing the behavior of the App Service + Environment. + :type cluster_settings: list[~azure.mgmt.web.v2020_06_01.models.NameValuePair] + :param user_whitelisted_ip_ranges: User added ip ranges to whitelist on ASE db. + :type user_whitelisted_ip_ranges: list[str] + :param has_linux_workers: Flag that displays whether an ASE has linux workers or not. + :type has_linux_workers: bool + :param ssl_cert_key_vault_id: Key Vault ID for ILB App Service Environment default SSL + certificate. + :type ssl_cert_key_vault_id: str + :param ssl_cert_key_vault_secret_name: Key Vault Secret Name for ILB App Service Environment + default SSL certificate. + :type ssl_cert_key_vault_secret_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'database_edition': {'readonly': True}, + 'database_service_objective': {'readonly': True}, + 'upgrade_domains': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'last_action': {'readonly': True}, + 'last_action_result': {'readonly': True}, + 'allowed_multi_sizes': {'readonly': True}, + 'allowed_worker_sizes': {'readonly': True}, + 'maximum_number_of_machines': {'readonly': True}, + 'vip_mappings': {'readonly': True}, + 'environment_capacities': {'readonly': True}, + 'environment_is_healthy': {'readonly': True}, + 'environment_status': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'default_front_end_scale_factor': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_resource_group_name': {'key': 'properties.vnetResourceGroupName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'properties.vnetSubnetName', 'type': 'str'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'VirtualNetworkProfile'}, + 'internal_load_balancing_mode': {'key': 'properties.internalLoadBalancingMode', 'type': 'str'}, + 'multi_size': {'key': 'properties.multiSize', 'type': 'str'}, + 'multi_role_count': {'key': 'properties.multiRoleCount', 'type': 'int'}, + 'worker_pools': {'key': 'properties.workerPools', 'type': '[WorkerPool]'}, + 'ipssl_address_count': {'key': 'properties.ipsslAddressCount', 'type': 'int'}, + 'database_edition': {'key': 'properties.databaseEdition', 'type': 'str'}, + 'database_service_objective': {'key': 'properties.databaseServiceObjective', 'type': 'str'}, + 'upgrade_domains': {'key': 'properties.upgradeDomains', 'type': 'int'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'dns_suffix': {'key': 'properties.dnsSuffix', 'type': 'str'}, + 'last_action': {'key': 'properties.lastAction', 'type': 'str'}, + 'last_action_result': {'key': 'properties.lastActionResult', 'type': 'str'}, + 'allowed_multi_sizes': {'key': 'properties.allowedMultiSizes', 'type': 'str'}, + 'allowed_worker_sizes': {'key': 'properties.allowedWorkerSizes', 'type': 'str'}, + 'maximum_number_of_machines': {'key': 'properties.maximumNumberOfMachines', 'type': 'int'}, + 'vip_mappings': {'key': 'properties.vipMappings', 'type': '[VirtualIPMapping]'}, + 'environment_capacities': {'key': 'properties.environmentCapacities', 'type': '[StampCapacity]'}, + 'network_access_control_list': {'key': 'properties.networkAccessControlList', 'type': '[NetworkAccessControlEntry]'}, + 'environment_is_healthy': {'key': 'properties.environmentIsHealthy', 'type': 'bool'}, + 'environment_status': {'key': 'properties.environmentStatus', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'front_end_scale_factor': {'key': 'properties.frontEndScaleFactor', 'type': 'int'}, + 'default_front_end_scale_factor': {'key': 'properties.defaultFrontEndScaleFactor', 'type': 'int'}, + 'api_management_account_id': {'key': 'properties.apiManagementAccountId', 'type': 'str'}, + 'suspended': {'key': 'properties.suspended', 'type': 'bool'}, + 'dynamic_cache_enabled': {'key': 'properties.dynamicCacheEnabled', 'type': 'bool'}, + 'cluster_settings': {'key': 'properties.clusterSettings', 'type': '[NameValuePair]'}, + 'user_whitelisted_ip_ranges': {'key': 'properties.userWhitelistedIpRanges', 'type': '[str]'}, + 'has_linux_workers': {'key': 'properties.hasLinuxWorkers', 'type': 'bool'}, + 'ssl_cert_key_vault_id': {'key': 'properties.sslCertKeyVaultId', 'type': 'str'}, + 'ssl_cert_key_vault_secret_name': {'key': 'properties.sslCertKeyVaultSecretName', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + name_properties_name: Optional[str] = None, + location: Optional[str] = None, + vnet_name: Optional[str] = None, + vnet_resource_group_name: Optional[str] = None, + vnet_subnet_name: Optional[str] = None, + virtual_network: Optional["VirtualNetworkProfile"] = None, + internal_load_balancing_mode: Optional[Union[str, "LoadBalancingMode"]] = None, + multi_size: Optional[str] = None, + multi_role_count: Optional[int] = None, + worker_pools: Optional[List["WorkerPool"]] = None, + ipssl_address_count: Optional[int] = None, + dns_suffix: Optional[str] = None, + network_access_control_list: Optional[List["NetworkAccessControlEntry"]] = None, + front_end_scale_factor: Optional[int] = None, + api_management_account_id: Optional[str] = None, + suspended: Optional[bool] = None, + dynamic_cache_enabled: Optional[bool] = None, + cluster_settings: Optional[List["NameValuePair"]] = None, + user_whitelisted_ip_ranges: Optional[List[str]] = None, + has_linux_workers: Optional[bool] = None, + ssl_cert_key_vault_id: Optional[str] = None, + ssl_cert_key_vault_secret_name: Optional[str] = None, + **kwargs + ): + super(AppServiceEnvironmentPatchResource, self).__init__(kind=kind, **kwargs) + self.name_properties_name = name_properties_name + self.location = location + self.provisioning_state = None + self.status = None + self.vnet_name = vnet_name + self.vnet_resource_group_name = vnet_resource_group_name + self.vnet_subnet_name = vnet_subnet_name + self.virtual_network = virtual_network + self.internal_load_balancing_mode = internal_load_balancing_mode + self.multi_size = multi_size + self.multi_role_count = multi_role_count + self.worker_pools = worker_pools + self.ipssl_address_count = ipssl_address_count + self.database_edition = None + self.database_service_objective = None + self.upgrade_domains = None + self.subscription_id = None + self.dns_suffix = dns_suffix + self.last_action = None + self.last_action_result = None + self.allowed_multi_sizes = None + self.allowed_worker_sizes = None + self.maximum_number_of_machines = None + self.vip_mappings = None + self.environment_capacities = None + self.network_access_control_list = network_access_control_list + self.environment_is_healthy = None + self.environment_status = None + self.resource_group = None + self.front_end_scale_factor = front_end_scale_factor + self.default_front_end_scale_factor = None + self.api_management_account_id = api_management_account_id + self.suspended = suspended + self.dynamic_cache_enabled = dynamic_cache_enabled + self.cluster_settings = cluster_settings + self.user_whitelisted_ip_ranges = user_whitelisted_ip_ranges + self.has_linux_workers = has_linux_workers + self.ssl_cert_key_vault_id = ssl_cert_key_vault_id + self.ssl_cert_key_vault_secret_name = ssl_cert_key_vault_secret_name + + +class AppServiceEnvironmentResource(Resource): + """App Service Environment ARM 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param name_properties_name: Name of the App Service Environment. + :type name_properties_name: str + :param location_properties_location: Location of the App Service Environment, e.g. "West US". + :type location_properties_location: str + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.ProvisioningState + :ivar status: Current status of the App Service Environment. Possible values include: + "Preparing", "Ready", "Scaling", "Deleting". + :vartype status: str or ~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentStatus + :param vnet_name: Name of the Virtual Network for the App Service Environment. + :type vnet_name: str + :param vnet_resource_group_name: Resource group of the Virtual Network. + :type vnet_resource_group_name: str + :param vnet_subnet_name: Subnet of the Virtual Network. + :type vnet_subnet_name: str + :param virtual_network: Description of the Virtual Network. + :type virtual_network: ~azure.mgmt.web.v2020_06_01.models.VirtualNetworkProfile + :param internal_load_balancing_mode: Specifies which endpoints to serve internally in the + Virtual Network for the App Service Environment. Possible values include: "None", "Web", + "Publishing", "Web,Publishing". + :type internal_load_balancing_mode: str or ~azure.mgmt.web.v2020_06_01.models.LoadBalancingMode + :param multi_size: Front-end VM size, e.g. "Medium", "Large". + :type multi_size: str + :param multi_role_count: Number of front-end instances. + :type multi_role_count: int + :param worker_pools: Description of worker pools with worker size IDs, VM sizes, and number of + workers in each pool. + :type worker_pools: list[~azure.mgmt.web.v2020_06_01.models.WorkerPool] + :param ipssl_address_count: Number of IP SSL addresses reserved for the App Service + Environment. + :type ipssl_address_count: int + :ivar database_edition: Edition of the metadata database for the App Service Environment, e.g. + "Standard". + :vartype database_edition: str + :ivar database_service_objective: Service objective of the metadata database for the App + Service Environment, e.g. "S0". + :vartype database_service_objective: str + :ivar upgrade_domains: Number of upgrade domains of the App Service Environment. + :vartype upgrade_domains: int + :ivar subscription_id: Subscription of the App Service Environment. + :vartype subscription_id: str + :param dns_suffix: DNS suffix of the App Service Environment. + :type dns_suffix: str + :ivar last_action: Last deployment action on the App Service Environment. + :vartype last_action: str + :ivar last_action_result: Result of the last deployment action on the App Service Environment. + :vartype last_action_result: str + :ivar allowed_multi_sizes: List of comma separated strings describing which VM sizes are + allowed for front-ends. + :vartype allowed_multi_sizes: str + :ivar allowed_worker_sizes: List of comma separated strings describing which VM sizes are + allowed for workers. + :vartype allowed_worker_sizes: str + :ivar maximum_number_of_machines: Maximum number of VMs in the App Service Environment. + :vartype maximum_number_of_machines: int + :ivar vip_mappings: Description of IP SSL mapping for the App Service Environment. + :vartype vip_mappings: list[~azure.mgmt.web.v2020_06_01.models.VirtualIPMapping] + :ivar environment_capacities: Current total, used, and available worker capacities. + :vartype environment_capacities: list[~azure.mgmt.web.v2020_06_01.models.StampCapacity] + :param network_access_control_list: Access control list for controlling traffic to the App + Service Environment. + :type network_access_control_list: + list[~azure.mgmt.web.v2020_06_01.models.NetworkAccessControlEntry] + :ivar environment_is_healthy: True/false indicating whether the App Service Environment is + healthy. + :vartype environment_is_healthy: bool + :ivar environment_status: Detailed message about with results of the last check of the App + Service Environment. + :vartype environment_status: str + :ivar resource_group: Resource group of the App Service Environment. + :vartype resource_group: str + :param front_end_scale_factor: Scale factor for front-ends. + :type front_end_scale_factor: int + :ivar default_front_end_scale_factor: Default Scale Factor for FrontEnds. + :vartype default_front_end_scale_factor: int + :param api_management_account_id: API Management Account associated with the App Service + Environment. + :type api_management_account_id: str + :param suspended: :code:`true` if the App Service Environment is suspended; + otherwise, :code:`false`. The environment can be suspended, e.g. when the + management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :type suspended: bool + :param dynamic_cache_enabled: True/false indicating whether the App Service Environment is + suspended. The environment can be suspended e.g. when the management endpoint is no longer + available + (most likely because NSG blocked the incoming traffic). + :type dynamic_cache_enabled: bool + :param cluster_settings: Custom settings for changing the behavior of the App Service + Environment. + :type cluster_settings: list[~azure.mgmt.web.v2020_06_01.models.NameValuePair] + :param user_whitelisted_ip_ranges: User added ip ranges to whitelist on ASE db. + :type user_whitelisted_ip_ranges: list[str] + :param has_linux_workers: Flag that displays whether an ASE has linux workers or not. + :type has_linux_workers: bool + :param ssl_cert_key_vault_id: Key Vault ID for ILB App Service Environment default SSL + certificate. + :type ssl_cert_key_vault_id: str + :param ssl_cert_key_vault_secret_name: Key Vault Secret Name for ILB App Service Environment + default SSL certificate. + :type ssl_cert_key_vault_secret_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'database_edition': {'readonly': True}, + 'database_service_objective': {'readonly': True}, + 'upgrade_domains': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'last_action': {'readonly': True}, + 'last_action_result': {'readonly': True}, + 'allowed_multi_sizes': {'readonly': True}, + 'allowed_worker_sizes': {'readonly': True}, + 'maximum_number_of_machines': {'readonly': True}, + 'vip_mappings': {'readonly': True}, + 'environment_capacities': {'readonly': True}, + 'environment_is_healthy': {'readonly': True}, + 'environment_status': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'default_front_end_scale_factor': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'location_properties_location': {'key': 'properties.location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_resource_group_name': {'key': 'properties.vnetResourceGroupName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'properties.vnetSubnetName', 'type': 'str'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'VirtualNetworkProfile'}, + 'internal_load_balancing_mode': {'key': 'properties.internalLoadBalancingMode', 'type': 'str'}, + 'multi_size': {'key': 'properties.multiSize', 'type': 'str'}, + 'multi_role_count': {'key': 'properties.multiRoleCount', 'type': 'int'}, + 'worker_pools': {'key': 'properties.workerPools', 'type': '[WorkerPool]'}, + 'ipssl_address_count': {'key': 'properties.ipsslAddressCount', 'type': 'int'}, + 'database_edition': {'key': 'properties.databaseEdition', 'type': 'str'}, + 'database_service_objective': {'key': 'properties.databaseServiceObjective', 'type': 'str'}, + 'upgrade_domains': {'key': 'properties.upgradeDomains', 'type': 'int'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'dns_suffix': {'key': 'properties.dnsSuffix', 'type': 'str'}, + 'last_action': {'key': 'properties.lastAction', 'type': 'str'}, + 'last_action_result': {'key': 'properties.lastActionResult', 'type': 'str'}, + 'allowed_multi_sizes': {'key': 'properties.allowedMultiSizes', 'type': 'str'}, + 'allowed_worker_sizes': {'key': 'properties.allowedWorkerSizes', 'type': 'str'}, + 'maximum_number_of_machines': {'key': 'properties.maximumNumberOfMachines', 'type': 'int'}, + 'vip_mappings': {'key': 'properties.vipMappings', 'type': '[VirtualIPMapping]'}, + 'environment_capacities': {'key': 'properties.environmentCapacities', 'type': '[StampCapacity]'}, + 'network_access_control_list': {'key': 'properties.networkAccessControlList', 'type': '[NetworkAccessControlEntry]'}, + 'environment_is_healthy': {'key': 'properties.environmentIsHealthy', 'type': 'bool'}, + 'environment_status': {'key': 'properties.environmentStatus', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'front_end_scale_factor': {'key': 'properties.frontEndScaleFactor', 'type': 'int'}, + 'default_front_end_scale_factor': {'key': 'properties.defaultFrontEndScaleFactor', 'type': 'int'}, + 'api_management_account_id': {'key': 'properties.apiManagementAccountId', 'type': 'str'}, + 'suspended': {'key': 'properties.suspended', 'type': 'bool'}, + 'dynamic_cache_enabled': {'key': 'properties.dynamicCacheEnabled', 'type': 'bool'}, + 'cluster_settings': {'key': 'properties.clusterSettings', 'type': '[NameValuePair]'}, + 'user_whitelisted_ip_ranges': {'key': 'properties.userWhitelistedIpRanges', 'type': '[str]'}, + 'has_linux_workers': {'key': 'properties.hasLinuxWorkers', 'type': 'bool'}, + 'ssl_cert_key_vault_id': {'key': 'properties.sslCertKeyVaultId', 'type': 'str'}, + 'ssl_cert_key_vault_secret_name': {'key': 'properties.sslCertKeyVaultSecretName', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + name_properties_name: Optional[str] = None, + location_properties_location: Optional[str] = None, + vnet_name: Optional[str] = None, + vnet_resource_group_name: Optional[str] = None, + vnet_subnet_name: Optional[str] = None, + virtual_network: Optional["VirtualNetworkProfile"] = None, + internal_load_balancing_mode: Optional[Union[str, "LoadBalancingMode"]] = None, + multi_size: Optional[str] = None, + multi_role_count: Optional[int] = None, + worker_pools: Optional[List["WorkerPool"]] = None, + ipssl_address_count: Optional[int] = None, + dns_suffix: Optional[str] = None, + network_access_control_list: Optional[List["NetworkAccessControlEntry"]] = None, + front_end_scale_factor: Optional[int] = None, + api_management_account_id: Optional[str] = None, + suspended: Optional[bool] = None, + dynamic_cache_enabled: Optional[bool] = None, + cluster_settings: Optional[List["NameValuePair"]] = None, + user_whitelisted_ip_ranges: Optional[List[str]] = None, + has_linux_workers: Optional[bool] = None, + ssl_cert_key_vault_id: Optional[str] = None, + ssl_cert_key_vault_secret_name: Optional[str] = None, + **kwargs + ): + super(AppServiceEnvironmentResource, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.name_properties_name = name_properties_name + self.location_properties_location = location_properties_location + self.provisioning_state = None + self.status = None + self.vnet_name = vnet_name + self.vnet_resource_group_name = vnet_resource_group_name + self.vnet_subnet_name = vnet_subnet_name + self.virtual_network = virtual_network + self.internal_load_balancing_mode = internal_load_balancing_mode + self.multi_size = multi_size + self.multi_role_count = multi_role_count + self.worker_pools = worker_pools + self.ipssl_address_count = ipssl_address_count + self.database_edition = None + self.database_service_objective = None + self.upgrade_domains = None + self.subscription_id = None + self.dns_suffix = dns_suffix + self.last_action = None + self.last_action_result = None + self.allowed_multi_sizes = None + self.allowed_worker_sizes = None + self.maximum_number_of_machines = None + self.vip_mappings = None + self.environment_capacities = None + self.network_access_control_list = network_access_control_list + self.environment_is_healthy = None + self.environment_status = None + self.resource_group = None + self.front_end_scale_factor = front_end_scale_factor + self.default_front_end_scale_factor = None + self.api_management_account_id = api_management_account_id + self.suspended = suspended + self.dynamic_cache_enabled = dynamic_cache_enabled + self.cluster_settings = cluster_settings + self.user_whitelisted_ip_ranges = user_whitelisted_ip_ranges + self.has_linux_workers = has_linux_workers + self.ssl_cert_key_vault_id = ssl_cert_key_vault_id + self.ssl_cert_key_vault_secret_name = ssl_cert_key_vault_secret_name + + +class AppServicePlan(Resource): + """App Service plan. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: Description of a SKU for a scalable resource. + :type sku: ~azure.mgmt.web.v2020_06_01.models.SkuDescription + :param worker_tier_name: Target worker tier assigned to the App Service plan. + :type worker_tier_name: str + :ivar status: App Service plan status. Possible values include: "Ready", "Pending", "Creating". + :vartype status: str or ~azure.mgmt.web.v2020_06_01.models.StatusOptions + :ivar subscription: App Service plan subscription. + :vartype subscription: str + :param hosting_environment_profile: Specification for the App Service Environment to use for + the App Service plan. + :type hosting_environment_profile: ~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentProfile + :ivar maximum_number_of_workers: Maximum number of instances that can be assigned to this App + Service plan. + :vartype maximum_number_of_workers: int + :ivar geo_region: Geographical location for the App Service plan. + :vartype geo_region: str + :param per_site_scaling: If :code:`true`, apps assigned to this App Service plan + can be scaled independently. + If :code:`false`, apps assigned to this App Service plan will scale to all + instances of the plan. + :type per_site_scaling: bool + :param maximum_elastic_worker_count: Maximum number of total workers allowed for this + ElasticScaleEnabled App Service Plan. + :type maximum_elastic_worker_count: int + :ivar number_of_sites: Number of apps assigned to this App Service plan. + :vartype number_of_sites: int + :param is_spot: If :code:`true`, this App Service Plan owns spot instances. + :type is_spot: bool + :param spot_expiration_time: The time when the server farm expires. Valid only if it is a spot + server farm. + :type spot_expiration_time: ~datetime.datetime + :param free_offer_expiration_time: The time when the server farm free offer expires. + :type free_offer_expiration_time: ~datetime.datetime + :ivar resource_group: Resource group of the App Service plan. + :vartype resource_group: str + :param reserved: If Linux app service plan :code:`true`, + :code:`false` otherwise. + :type reserved: bool + :param is_xenon: Obsolete: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type is_xenon: bool + :param hyper_v: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type hyper_v: bool + :param target_worker_count: Scaling worker count. + :type target_worker_count: int + :param target_worker_size_id: Scaling worker size ID. + :type target_worker_size_id: int + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'subscription': {'readonly': True}, + 'maximum_number_of_workers': {'readonly': True}, + 'geo_region': {'readonly': True}, + 'number_of_sites': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'worker_tier_name': {'key': 'properties.workerTierName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'maximum_number_of_workers': {'key': 'properties.maximumNumberOfWorkers', 'type': 'int'}, + 'geo_region': {'key': 'properties.geoRegion', 'type': 'str'}, + 'per_site_scaling': {'key': 'properties.perSiteScaling', 'type': 'bool'}, + 'maximum_elastic_worker_count': {'key': 'properties.maximumElasticWorkerCount', 'type': 'int'}, + 'number_of_sites': {'key': 'properties.numberOfSites', 'type': 'int'}, + 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, + 'spot_expiration_time': {'key': 'properties.spotExpirationTime', 'type': 'iso-8601'}, + 'free_offer_expiration_time': {'key': 'properties.freeOfferExpirationTime', 'type': 'iso-8601'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'target_worker_count': {'key': 'properties.targetWorkerCount', 'type': 'int'}, + 'target_worker_size_id': {'key': 'properties.targetWorkerSizeId', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["SkuDescription"] = None, + worker_tier_name: Optional[str] = None, + hosting_environment_profile: Optional["HostingEnvironmentProfile"] = None, + per_site_scaling: Optional[bool] = False, + maximum_elastic_worker_count: Optional[int] = None, + is_spot: Optional[bool] = None, + spot_expiration_time: Optional[datetime.datetime] = None, + free_offer_expiration_time: Optional[datetime.datetime] = None, + reserved: Optional[bool] = False, + is_xenon: Optional[bool] = False, + hyper_v: Optional[bool] = False, + target_worker_count: Optional[int] = None, + target_worker_size_id: Optional[int] = None, + **kwargs + ): + super(AppServicePlan, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.sku = sku + self.worker_tier_name = worker_tier_name + self.status = None + self.subscription = None + self.hosting_environment_profile = hosting_environment_profile + self.maximum_number_of_workers = None + self.geo_region = None + self.per_site_scaling = per_site_scaling + self.maximum_elastic_worker_count = maximum_elastic_worker_count + self.number_of_sites = None + self.is_spot = is_spot + self.spot_expiration_time = spot_expiration_time + self.free_offer_expiration_time = free_offer_expiration_time + self.resource_group = None + self.reserved = reserved + self.is_xenon = is_xenon + self.hyper_v = hyper_v + self.target_worker_count = target_worker_count + self.target_worker_size_id = target_worker_size_id + self.provisioning_state = None + + +class AppServicePlanCollection(msrest.serialization.Model): + """Collection of App Service plans. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.AppServicePlan] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServicePlan]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["AppServicePlan"], + **kwargs + ): + super(AppServicePlanCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class AppServicePlanPatchResource(ProxyOnlyResource): + """ARM resource for a app service plan. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param worker_tier_name: Target worker tier assigned to the App Service plan. + :type worker_tier_name: str + :ivar status: App Service plan status. Possible values include: "Ready", "Pending", "Creating". + :vartype status: str or ~azure.mgmt.web.v2020_06_01.models.StatusOptions + :ivar subscription: App Service plan subscription. + :vartype subscription: str + :param hosting_environment_profile: Specification for the App Service Environment to use for + the App Service plan. + :type hosting_environment_profile: ~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentProfile + :ivar maximum_number_of_workers: Maximum number of instances that can be assigned to this App + Service plan. + :vartype maximum_number_of_workers: int + :ivar geo_region: Geographical location for the App Service plan. + :vartype geo_region: str + :param per_site_scaling: If :code:`true`, apps assigned to this App Service plan + can be scaled independently. + If :code:`false`, apps assigned to this App Service plan will scale to all + instances of the plan. + :type per_site_scaling: bool + :param maximum_elastic_worker_count: Maximum number of total workers allowed for this + ElasticScaleEnabled App Service Plan. + :type maximum_elastic_worker_count: int + :ivar number_of_sites: Number of apps assigned to this App Service plan. + :vartype number_of_sites: int + :param is_spot: If :code:`true`, this App Service Plan owns spot instances. + :type is_spot: bool + :param spot_expiration_time: The time when the server farm expires. Valid only if it is a spot + server farm. + :type spot_expiration_time: ~datetime.datetime + :param free_offer_expiration_time: The time when the server farm free offer expires. + :type free_offer_expiration_time: ~datetime.datetime + :ivar resource_group: Resource group of the App Service plan. + :vartype resource_group: str + :param reserved: This needs to set to :code:`true` when creating a Linux App + Service Plan, along with :code:`kind` set to :code:`Linux`. It should + be :code:`false` otherwise. + :type reserved: bool + :param is_xenon: Obsolete: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type is_xenon: bool + :param hyper_v: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type hyper_v: bool + :param target_worker_count: Scaling worker count. + :type target_worker_count: int + :param target_worker_size_id: Scaling worker size ID. + :type target_worker_size_id: int + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'subscription': {'readonly': True}, + 'maximum_number_of_workers': {'readonly': True}, + 'geo_region': {'readonly': True}, + 'number_of_sites': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'worker_tier_name': {'key': 'properties.workerTierName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'maximum_number_of_workers': {'key': 'properties.maximumNumberOfWorkers', 'type': 'int'}, + 'geo_region': {'key': 'properties.geoRegion', 'type': 'str'}, + 'per_site_scaling': {'key': 'properties.perSiteScaling', 'type': 'bool'}, + 'maximum_elastic_worker_count': {'key': 'properties.maximumElasticWorkerCount', 'type': 'int'}, + 'number_of_sites': {'key': 'properties.numberOfSites', 'type': 'int'}, + 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, + 'spot_expiration_time': {'key': 'properties.spotExpirationTime', 'type': 'iso-8601'}, + 'free_offer_expiration_time': {'key': 'properties.freeOfferExpirationTime', 'type': 'iso-8601'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'target_worker_count': {'key': 'properties.targetWorkerCount', 'type': 'int'}, + 'target_worker_size_id': {'key': 'properties.targetWorkerSizeId', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + worker_tier_name: Optional[str] = None, + hosting_environment_profile: Optional["HostingEnvironmentProfile"] = None, + per_site_scaling: Optional[bool] = False, + maximum_elastic_worker_count: Optional[int] = None, + is_spot: Optional[bool] = None, + spot_expiration_time: Optional[datetime.datetime] = None, + free_offer_expiration_time: Optional[datetime.datetime] = None, + reserved: Optional[bool] = False, + is_xenon: Optional[bool] = False, + hyper_v: Optional[bool] = False, + target_worker_count: Optional[int] = None, + target_worker_size_id: Optional[int] = None, + **kwargs + ): + super(AppServicePlanPatchResource, self).__init__(kind=kind, **kwargs) + self.worker_tier_name = worker_tier_name + self.status = None + self.subscription = None + self.hosting_environment_profile = hosting_environment_profile + self.maximum_number_of_workers = None + self.geo_region = None + self.per_site_scaling = per_site_scaling + self.maximum_elastic_worker_count = maximum_elastic_worker_count + self.number_of_sites = None + self.is_spot = is_spot + self.spot_expiration_time = spot_expiration_time + self.free_offer_expiration_time = free_offer_expiration_time + self.resource_group = None + self.reserved = reserved + self.is_xenon = is_xenon + self.hyper_v = hyper_v + self.target_worker_count = target_worker_count + self.target_worker_size_id = target_worker_size_id + self.provisioning_state = None + + +class ArmIdWrapper(msrest.serialization.Model): + """A wrapper for an ARM resource id. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ArmIdWrapper, self).__init__(**kwargs) + self.id = None + + +class AuthPlatform(ProxyOnlyResource): + """AuthPlatform. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: + :type enabled: bool + :param runtime_version: + :type runtime_version: str + :param config_file_path: + :type config_file_path: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'runtime_version': {'key': 'properties.runtimeVersion', 'type': 'str'}, + 'config_file_path': {'key': 'properties.configFilePath', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + runtime_version: Optional[str] = None, + config_file_path: Optional[str] = None, + **kwargs + ): + super(AuthPlatform, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.runtime_version = runtime_version + self.config_file_path = config_file_path + + +class AutoHealActions(msrest.serialization.Model): + """Actions which to take by the auto-heal module when a rule is triggered. + + :param action_type: Predefined action to be taken. Possible values include: "Recycle", + "LogEvent", "CustomAction". + :type action_type: str or ~azure.mgmt.web.v2020_06_01.models.AutoHealActionType + :param custom_action: Custom action to be taken. + :type custom_action: ~azure.mgmt.web.v2020_06_01.models.AutoHealCustomAction + :param min_process_execution_time: Minimum time the process must execute + before taking the action. + :type min_process_execution_time: str + """ + + _attribute_map = { + 'action_type': {'key': 'actionType', 'type': 'str'}, + 'custom_action': {'key': 'customAction', 'type': 'AutoHealCustomAction'}, + 'min_process_execution_time': {'key': 'minProcessExecutionTime', 'type': 'str'}, + } + + def __init__( + self, + *, + action_type: Optional[Union[str, "AutoHealActionType"]] = None, + custom_action: Optional["AutoHealCustomAction"] = None, + min_process_execution_time: Optional[str] = None, + **kwargs + ): + super(AutoHealActions, self).__init__(**kwargs) + self.action_type = action_type + self.custom_action = custom_action + self.min_process_execution_time = min_process_execution_time + + +class AutoHealCustomAction(msrest.serialization.Model): + """Custom action to be executed +when an auto heal rule is triggered. + + :param exe: Executable to be run. + :type exe: str + :param parameters: Parameters for the executable. + :type parameters: str + """ + + _attribute_map = { + 'exe': {'key': 'exe', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'str'}, + } + + def __init__( + self, + *, + exe: Optional[str] = None, + parameters: Optional[str] = None, + **kwargs + ): + super(AutoHealCustomAction, self).__init__(**kwargs) + self.exe = exe + self.parameters = parameters + + +class AutoHealRules(msrest.serialization.Model): + """Rules that can be defined for auto-heal. + + :param triggers: Conditions that describe when to execute the auto-heal actions. + :type triggers: ~azure.mgmt.web.v2020_06_01.models.AutoHealTriggers + :param actions: Actions to be executed when a rule is triggered. + :type actions: ~azure.mgmt.web.v2020_06_01.models.AutoHealActions + """ + + _attribute_map = { + 'triggers': {'key': 'triggers', 'type': 'AutoHealTriggers'}, + 'actions': {'key': 'actions', 'type': 'AutoHealActions'}, + } + + def __init__( + self, + *, + triggers: Optional["AutoHealTriggers"] = None, + actions: Optional["AutoHealActions"] = None, + **kwargs + ): + super(AutoHealRules, self).__init__(**kwargs) + self.triggers = triggers + self.actions = actions + + +class AutoHealTriggers(msrest.serialization.Model): + """Triggers for auto-heal. + + :param requests: A rule based on total requests. + :type requests: ~azure.mgmt.web.v2020_06_01.models.RequestsBasedTrigger + :param private_bytes_in_kb: A rule based on private bytes. + :type private_bytes_in_kb: int + :param status_codes: A rule based on status codes. + :type status_codes: list[~azure.mgmt.web.v2020_06_01.models.StatusCodesBasedTrigger] + :param slow_requests: A rule based on request execution time. + :type slow_requests: ~azure.mgmt.web.v2020_06_01.models.SlowRequestsBasedTrigger + """ + + _attribute_map = { + 'requests': {'key': 'requests', 'type': 'RequestsBasedTrigger'}, + 'private_bytes_in_kb': {'key': 'privateBytesInKB', 'type': 'int'}, + 'status_codes': {'key': 'statusCodes', 'type': '[StatusCodesBasedTrigger]'}, + 'slow_requests': {'key': 'slowRequests', 'type': 'SlowRequestsBasedTrigger'}, + } + + def __init__( + self, + *, + requests: Optional["RequestsBasedTrigger"] = None, + private_bytes_in_kb: Optional[int] = None, + status_codes: Optional[List["StatusCodesBasedTrigger"]] = None, + slow_requests: Optional["SlowRequestsBasedTrigger"] = None, + **kwargs + ): + super(AutoHealTriggers, self).__init__(**kwargs) + self.requests = requests + self.private_bytes_in_kb = private_bytes_in_kb + self.status_codes = status_codes + self.slow_requests = slow_requests + + +class AzureActiveDirectory(ProxyOnlyResource): + """AzureActiveDirectory. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_06_01.models.AzureActiveDirectoryRegistration + :param login: + :type login: ~azure.mgmt.web.v2020_06_01.models.AzureActiveDirectoryLogin + :param validation: + :type validation: ~azure.mgmt.web.v2020_06_01.models.AzureActiveDirectoryValidation + :param is_auto_provisioned: + :type is_auto_provisioned: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'AzureActiveDirectoryRegistration'}, + 'login': {'key': 'properties.login', 'type': 'AzureActiveDirectoryLogin'}, + 'validation': {'key': 'properties.validation', 'type': 'AzureActiveDirectoryValidation'}, + 'is_auto_provisioned': {'key': 'properties.isAutoProvisioned', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + registration: Optional["AzureActiveDirectoryRegistration"] = None, + login: Optional["AzureActiveDirectoryLogin"] = None, + validation: Optional["AzureActiveDirectoryValidation"] = None, + is_auto_provisioned: Optional[bool] = None, + **kwargs + ): + super(AzureActiveDirectory, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.registration = registration + self.login = login + self.validation = validation + self.is_auto_provisioned = is_auto_provisioned + + +class AzureActiveDirectoryLogin(ProxyOnlyResource): + """AzureActiveDirectoryLogin. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param disable_www_authenticate: + :type disable_www_authenticate: bool + :param login_parameters: + :type login_parameters: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'disable_www_authenticate': {'key': 'properties.disableWWWAuthenticate', 'type': 'bool'}, + 'login_parameters': {'key': 'properties.loginParameters', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + disable_www_authenticate: Optional[bool] = None, + login_parameters: Optional[List[str]] = None, + **kwargs + ): + super(AzureActiveDirectoryLogin, self).__init__(kind=kind, **kwargs) + self.disable_www_authenticate = disable_www_authenticate + self.login_parameters = login_parameters + + +class AzureActiveDirectoryRegistration(ProxyOnlyResource): + """AzureActiveDirectoryRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param open_id_issuer: + :type open_id_issuer: str + :param client_id: + :type client_id: str + :param client_secret_setting_name: + :type client_secret_setting_name: str + :param client_secret_certificate_thumbprint: + :type client_secret_certificate_thumbprint: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'open_id_issuer': {'key': 'properties.openIdIssuer', 'type': 'str'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_secret_certificate_thumbprint': {'key': 'properties.clientSecretCertificateThumbprint', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + open_id_issuer: Optional[str] = None, + client_id: Optional[str] = None, + client_secret_setting_name: Optional[str] = None, + client_secret_certificate_thumbprint: Optional[str] = None, + **kwargs + ): + super(AzureActiveDirectoryRegistration, self).__init__(kind=kind, **kwargs) + self.open_id_issuer = open_id_issuer + self.client_id = client_id + self.client_secret_setting_name = client_secret_setting_name + self.client_secret_certificate_thumbprint = client_secret_certificate_thumbprint + + +class AzureActiveDirectoryValidation(ProxyOnlyResource): + """AzureActiveDirectoryValidation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param jwt_claim_checks: + :type jwt_claim_checks: ~azure.mgmt.web.v2020_06_01.models.JwtClaimChecks + :param allowed_audiences: + :type allowed_audiences: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'jwt_claim_checks': {'key': 'properties.jwtClaimChecks', 'type': 'JwtClaimChecks'}, + 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + jwt_claim_checks: Optional["JwtClaimChecks"] = None, + allowed_audiences: Optional[List[str]] = None, + **kwargs + ): + super(AzureActiveDirectoryValidation, self).__init__(kind=kind, **kwargs) + self.jwt_claim_checks = jwt_claim_checks + self.allowed_audiences = allowed_audiences + + +class AzureBlobStorageApplicationLogsConfig(msrest.serialization.Model): + """Application logs azure blob storage configuration. + + :param level: Log level. Possible values include: "Off", "Verbose", "Information", "Warning", + "Error". + :type level: str or ~azure.mgmt.web.v2020_06_01.models.LogLevel + :param sas_url: SAS url to a azure blob container with read/write/list/delete permissions. + :type sas_url: str + :param retention_in_days: Retention in days. + Remove blobs older than X days. + 0 or lower means no retention. + :type retention_in_days: int + """ + + _attribute_map = { + 'level': {'key': 'level', 'type': 'str'}, + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + } + + def __init__( + self, + *, + level: Optional[Union[str, "LogLevel"]] = None, + sas_url: Optional[str] = None, + retention_in_days: Optional[int] = None, + **kwargs + ): + super(AzureBlobStorageApplicationLogsConfig, self).__init__(**kwargs) + self.level = level + self.sas_url = sas_url + self.retention_in_days = retention_in_days + + +class AzureBlobStorageHttpLogsConfig(msrest.serialization.Model): + """Http logs to azure blob storage configuration. + + :param sas_url: SAS url to a azure blob container with read/write/list/delete permissions. + :type sas_url: str + :param retention_in_days: Retention in days. + Remove blobs older than X days. + 0 or lower means no retention. + :type retention_in_days: int + :param enabled: True if configuration is enabled, false if it is disabled and null if + configuration is not set. + :type enabled: bool + """ + + _attribute_map = { + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + sas_url: Optional[str] = None, + retention_in_days: Optional[int] = None, + enabled: Optional[bool] = None, + **kwargs + ): + super(AzureBlobStorageHttpLogsConfig, self).__init__(**kwargs) + self.sas_url = sas_url + self.retention_in_days = retention_in_days + self.enabled = enabled + + +class AzureStorageInfoValue(msrest.serialization.Model): + """Azure Files or Blob Storage access information value for dictionary storage. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Type of storage. Possible values include: "AzureFiles", "AzureBlob". + :type type: str or ~azure.mgmt.web.v2020_06_01.models.AzureStorageType + :param account_name: Name of the storage account. + :type account_name: str + :param share_name: Name of the file share (container name, for Blob storage). + :type share_name: str + :param access_key: Access key for the storage account. + :type access_key: str + :param mount_path: Path to mount the storage within the site's runtime environment. + :type mount_path: str + :ivar state: State of the storage account. Possible values include: "Ok", "InvalidCredentials", + "InvalidShare". + :vartype state: str or ~azure.mgmt.web.v2020_06_01.models.AzureStorageState + """ + + _validation = { + 'state': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'account_name': {'key': 'accountName', 'type': 'str'}, + 'share_name': {'key': 'shareName', 'type': 'str'}, + 'access_key': {'key': 'accessKey', 'type': 'str'}, + 'mount_path': {'key': 'mountPath', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "AzureStorageType"]] = None, + account_name: Optional[str] = None, + share_name: Optional[str] = None, + access_key: Optional[str] = None, + mount_path: Optional[str] = None, + **kwargs + ): + super(AzureStorageInfoValue, self).__init__(**kwargs) + self.type = type + self.account_name = account_name + self.share_name = share_name + self.access_key = access_key + self.mount_path = mount_path + self.state = None + + +class AzureStoragePropertyDictionaryResource(ProxyOnlyResource): + """AzureStorageInfo dictionary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param properties: Azure storage accounts. + :type properties: dict[str, ~azure.mgmt.web.v2020_06_01.models.AzureStorageInfoValue] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{AzureStorageInfoValue}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + properties: Optional[Dict[str, "AzureStorageInfoValue"]] = None, + **kwargs + ): + super(AzureStoragePropertyDictionaryResource, self).__init__(kind=kind, **kwargs) + self.properties = properties + + +class AzureTableStorageApplicationLogsConfig(msrest.serialization.Model): + """Application logs to Azure table storage configuration. + + All required parameters must be populated in order to send to Azure. + + :param level: Log level. Possible values include: "Off", "Verbose", "Information", "Warning", + "Error". + :type level: str or ~azure.mgmt.web.v2020_06_01.models.LogLevel + :param sas_url: Required. SAS URL to an Azure table with add/query/delete permissions. + :type sas_url: str + """ + + _validation = { + 'sas_url': {'required': True}, + } + + _attribute_map = { + 'level': {'key': 'level', 'type': 'str'}, + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + sas_url: str, + level: Optional[Union[str, "LogLevel"]] = None, + **kwargs + ): + super(AzureTableStorageApplicationLogsConfig, self).__init__(**kwargs) + self.level = level + self.sas_url = sas_url + + +class BackupItem(ProxyOnlyResource): + """Backup description. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar backup_id: Id of the backup. + :vartype backup_id: int + :ivar storage_account_url: SAS URL for the storage account container which contains this + backup. + :vartype storage_account_url: str + :ivar blob_name: Name of the blob which contains data for this backup. + :vartype blob_name: str + :ivar name_properties_name: Name of this backup. + :vartype name_properties_name: str + :ivar status: Backup status. Possible values include: "InProgress", "Failed", "Succeeded", + "TimedOut", "Created", "Skipped", "PartiallySucceeded", "DeleteInProgress", "DeleteFailed", + "Deleted". + :vartype status: str or ~azure.mgmt.web.v2020_06_01.models.BackupItemStatus + :ivar size_in_bytes: Size of the backup in bytes. + :vartype size_in_bytes: long + :ivar created: Timestamp of the backup creation. + :vartype created: ~datetime.datetime + :ivar log: Details regarding this backup. Might contain an error message. + :vartype log: str + :ivar databases: List of databases included in the backup. + :vartype databases: list[~azure.mgmt.web.v2020_06_01.models.DatabaseBackupSetting] + :ivar scheduled: True if this backup has been created due to a schedule being triggered. + :vartype scheduled: bool + :ivar last_restore_time_stamp: Timestamp of a last restore operation which used this backup. + :vartype last_restore_time_stamp: ~datetime.datetime + :ivar finished_time_stamp: Timestamp when this backup finished. + :vartype finished_time_stamp: ~datetime.datetime + :ivar correlation_id: Unique correlation identifier. Please use this along with the timestamp + while communicating with Azure support. + :vartype correlation_id: str + :ivar website_size_in_bytes: Size of the original web app which has been backed up. + :vartype website_size_in_bytes: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'backup_id': {'readonly': True}, + 'storage_account_url': {'readonly': True}, + 'blob_name': {'readonly': True}, + 'name_properties_name': {'readonly': True}, + 'status': {'readonly': True}, + 'size_in_bytes': {'readonly': True}, + 'created': {'readonly': True}, + 'log': {'readonly': True}, + 'databases': {'readonly': True}, + 'scheduled': {'readonly': True}, + 'last_restore_time_stamp': {'readonly': True}, + 'finished_time_stamp': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'website_size_in_bytes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'backup_id': {'key': 'properties.id', 'type': 'int'}, + 'storage_account_url': {'key': 'properties.storageAccountUrl', 'type': 'str'}, + 'blob_name': {'key': 'properties.blobName', 'type': 'str'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'size_in_bytes': {'key': 'properties.sizeInBytes', 'type': 'long'}, + 'created': {'key': 'properties.created', 'type': 'iso-8601'}, + 'log': {'key': 'properties.log', 'type': 'str'}, + 'databases': {'key': 'properties.databases', 'type': '[DatabaseBackupSetting]'}, + 'scheduled': {'key': 'properties.scheduled', 'type': 'bool'}, + 'last_restore_time_stamp': {'key': 'properties.lastRestoreTimeStamp', 'type': 'iso-8601'}, + 'finished_time_stamp': {'key': 'properties.finishedTimeStamp', 'type': 'iso-8601'}, + 'correlation_id': {'key': 'properties.correlationId', 'type': 'str'}, + 'website_size_in_bytes': {'key': 'properties.websiteSizeInBytes', 'type': 'long'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(BackupItem, self).__init__(kind=kind, **kwargs) + self.backup_id = None + self.storage_account_url = None + self.blob_name = None + self.name_properties_name = None + self.status = None + self.size_in_bytes = None + self.created = None + self.log = None + self.databases = None + self.scheduled = None + self.last_restore_time_stamp = None + self.finished_time_stamp = None + self.correlation_id = None + self.website_size_in_bytes = None + + +class BackupItemCollection(msrest.serialization.Model): + """Collection of backup items. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.BackupItem] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BackupItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["BackupItem"], + **kwargs + ): + super(BackupItemCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class BackupRequest(ProxyOnlyResource): + """Description of a backup which will be performed. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param backup_name: Name of the backup. + :type backup_name: str + :param enabled: True if the backup schedule is enabled (must be included in that case), false + if the backup schedule should be disabled. + :type enabled: bool + :param storage_account_url: SAS URL to the container. + :type storage_account_url: str + :param backup_schedule: Schedule for the backup if it is executed periodically. + :type backup_schedule: ~azure.mgmt.web.v2020_06_01.models.BackupSchedule + :param databases: Databases included in the backup. + :type databases: list[~azure.mgmt.web.v2020_06_01.models.DatabaseBackupSetting] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'backup_name': {'key': 'properties.backupName', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'storage_account_url': {'key': 'properties.storageAccountUrl', 'type': 'str'}, + 'backup_schedule': {'key': 'properties.backupSchedule', 'type': 'BackupSchedule'}, + 'databases': {'key': 'properties.databases', 'type': '[DatabaseBackupSetting]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + backup_name: Optional[str] = None, + enabled: Optional[bool] = None, + storage_account_url: Optional[str] = None, + backup_schedule: Optional["BackupSchedule"] = None, + databases: Optional[List["DatabaseBackupSetting"]] = None, + **kwargs + ): + super(BackupRequest, self).__init__(kind=kind, **kwargs) + self.backup_name = backup_name + self.enabled = enabled + self.storage_account_url = storage_account_url + self.backup_schedule = backup_schedule + self.databases = databases + + +class BackupSchedule(msrest.serialization.Model): + """Description of a backup schedule. Describes how often should be the backup performed and what should be the retention policy. + + 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. + + :param frequency_interval: Required. How often the backup should be executed (e.g. for weekly + backup, this should be set to 7 and FrequencyUnit should be set to Day). + :type frequency_interval: int + :param frequency_unit: Required. The unit of time for how often the backup should be executed + (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7). + Possible values include: "Day", "Hour". Default value: "Day". + :type frequency_unit: str or ~azure.mgmt.web.v2020_06_01.models.FrequencyUnit + :param keep_at_least_one_backup: Required. True if the retention policy should always keep at + least one backup in the storage account, regardless how old it is; false otherwise. + :type keep_at_least_one_backup: bool + :param retention_period_in_days: Required. After how many days backups should be deleted. + :type retention_period_in_days: int + :param start_time: When the schedule should start working. + :type start_time: ~datetime.datetime + :ivar last_execution_time: Last time when this schedule was triggered. + :vartype last_execution_time: ~datetime.datetime + """ + + _validation = { + 'frequency_interval': {'required': True}, + 'frequency_unit': {'required': True}, + 'keep_at_least_one_backup': {'required': True}, + 'retention_period_in_days': {'required': True}, + 'last_execution_time': {'readonly': True}, + } + + _attribute_map = { + 'frequency_interval': {'key': 'frequencyInterval', 'type': 'int'}, + 'frequency_unit': {'key': 'frequencyUnit', 'type': 'str'}, + 'keep_at_least_one_backup': {'key': 'keepAtLeastOneBackup', 'type': 'bool'}, + 'retention_period_in_days': {'key': 'retentionPeriodInDays', 'type': 'int'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'last_execution_time': {'key': 'lastExecutionTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + frequency_interval: int = 7, + frequency_unit: Union[str, "FrequencyUnit"] = "Day", + keep_at_least_one_backup: bool = True, + retention_period_in_days: int = 30, + start_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(BackupSchedule, self).__init__(**kwargs) + self.frequency_interval = frequency_interval + self.frequency_unit = frequency_unit + self.keep_at_least_one_backup = keep_at_least_one_backup + self.retention_period_in_days = retention_period_in_days + self.start_time = start_time + self.last_execution_time = None + + +class BillingMeter(ProxyOnlyResource): + """App Service billing entity that contains information about meter which the Azure billing system utilizes to charge users for services. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param meter_id: Meter GUID onboarded in Commerce. + :type meter_id: str + :param billing_location: Azure Location of billable resource. + :type billing_location: str + :param short_name: Short Name from App Service Azure pricing Page. + :type short_name: str + :param friendly_name: Friendly name of the meter. + :type friendly_name: str + :param resource_type: App Service ResourceType meter used for. + :type resource_type: str + :param os_type: App Service OS type meter used for. + :type os_type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, + 'billing_location': {'key': 'properties.billingLocation', 'type': 'str'}, + 'short_name': {'key': 'properties.shortName', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'resource_type': {'key': 'properties.resourceType', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + meter_id: Optional[str] = None, + billing_location: Optional[str] = None, + short_name: Optional[str] = None, + friendly_name: Optional[str] = None, + resource_type: Optional[str] = None, + os_type: Optional[str] = None, + **kwargs + ): + super(BillingMeter, self).__init__(kind=kind, **kwargs) + self.meter_id = meter_id + self.billing_location = billing_location + self.short_name = short_name + self.friendly_name = friendly_name + self.resource_type = resource_type + self.os_type = os_type + + +class BillingMeterCollection(msrest.serialization.Model): + """Collection of Billing Meters. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.BillingMeter] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingMeter]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["BillingMeter"], + **kwargs + ): + super(BillingMeterCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class BlobStorageTokenStore(ProxyOnlyResource): + """BlobStorageTokenStore. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param sas_url_setting_name: + :type sas_url_setting_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sas_url_setting_name': {'key': 'properties.sasUrlSettingName', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + sas_url_setting_name: Optional[str] = None, + **kwargs + ): + super(BlobStorageTokenStore, self).__init__(kind=kind, **kwargs) + self.sas_url_setting_name = sas_url_setting_name + + +class Capability(msrest.serialization.Model): + """Describes the capabilities/features allowed for a specific SKU. + + :param name: Name of the SKU capability. + :type name: str + :param value: Value of the SKU capability. + :type value: str + :param reason: Reason of the SKU capability. + :type reason: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + reason: Optional[str] = None, + **kwargs + ): + super(Capability, self).__init__(**kwargs) + self.name = name + self.value = value + self.reason = reason + + +class Certificate(Resource): + """SSL certificate for an app. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar friendly_name: Friendly name of the certificate. + :vartype friendly_name: str + :ivar subject_name: Subject name of the certificate. + :vartype subject_name: str + :param host_names: Host names the certificate applies to. + :type host_names: list[str] + :param pfx_blob: Pfx blob. + :type pfx_blob: bytearray + :ivar site_name: App name. + :vartype site_name: str + :ivar self_link: Self link. + :vartype self_link: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar issue_date: Certificate issue Date. + :vartype issue_date: ~datetime.datetime + :ivar expiration_date: Certificate expiration date. + :vartype expiration_date: ~datetime.datetime + :param password: Certificate password. + :type password: str + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid: Is the certificate valid?. + :vartype valid: bool + :ivar cer_blob: Raw bytes of .cer file. + :vartype cer_blob: bytearray + :ivar public_key_hash: Public key hash. + :vartype public_key_hash: str + :ivar hosting_environment_profile: Specification for the App Service Environment to use for the + certificate. + :vartype hosting_environment_profile: + ~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentProfile + :param key_vault_id: Key Vault Csm resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar key_vault_secret_status: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype key_vault_secret_status: str or + ~azure.mgmt.web.v2020_06_01.models.KeyVaultSecretStatus + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param canonical_name: CNAME of the certificate to be issued via free certificate. + :type canonical_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'site_name': {'readonly': True}, + 'self_link': {'readonly': True}, + 'issuer': {'readonly': True}, + 'issue_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'valid': {'readonly': True}, + 'cer_blob': {'readonly': True}, + 'public_key_hash': {'readonly': True}, + 'hosting_environment_profile': {'readonly': True}, + 'key_vault_secret_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'subject_name': {'key': 'properties.subjectName', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'pfx_blob': {'key': 'properties.pfxBlob', 'type': 'bytearray'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'self_link': {'key': 'properties.selfLink', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'issue_date': {'key': 'properties.issueDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'valid': {'key': 'properties.valid', 'type': 'bool'}, + 'cer_blob': {'key': 'properties.cerBlob', 'type': 'bytearray'}, + 'public_key_hash': {'key': 'properties.publicKeyHash', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'key_vault_secret_status': {'key': 'properties.keyVaultSecretStatus', 'type': 'str'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'canonical_name': {'key': 'properties.canonicalName', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + host_names: Optional[List[str]] = None, + pfx_blob: Optional[bytearray] = None, + password: Optional[str] = None, + key_vault_id: Optional[str] = None, + key_vault_secret_name: Optional[str] = None, + server_farm_id: Optional[str] = None, + canonical_name: Optional[str] = None, + **kwargs + ): + super(Certificate, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.friendly_name = None + self.subject_name = None + self.host_names = host_names + self.pfx_blob = pfx_blob + self.site_name = None + self.self_link = None + self.issuer = None + self.issue_date = None + self.expiration_date = None + self.password = password + self.thumbprint = None + self.valid = None + self.cer_blob = None + self.public_key_hash = None + self.hosting_environment_profile = None + self.key_vault_id = key_vault_id + self.key_vault_secret_name = key_vault_secret_name + self.key_vault_secret_status = None + self.server_farm_id = server_farm_id + self.canonical_name = canonical_name + + +class CertificateCollection(msrest.serialization.Model): + """Collection of certificates. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.Certificate] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Certificate]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Certificate"], + **kwargs + ): + super(CertificateCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class CertificateDetails(msrest.serialization.Model): + """SSL certificate details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar version: Certificate Version. + :vartype version: int + :ivar serial_number: Certificate Serial Number. + :vartype serial_number: str + :ivar thumbprint: Certificate Thumbprint. + :vartype thumbprint: str + :ivar subject: Certificate Subject. + :vartype subject: str + :ivar not_before: Date Certificate is valid from. + :vartype not_before: ~datetime.datetime + :ivar not_after: Date Certificate is valid to. + :vartype not_after: ~datetime.datetime + :ivar signature_algorithm: Certificate Signature algorithm. + :vartype signature_algorithm: str + :ivar issuer: Certificate Issuer. + :vartype issuer: str + :ivar raw_data: Raw certificate data. + :vartype raw_data: str + """ + + _validation = { + 'version': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'subject': {'readonly': True}, + 'not_before': {'readonly': True}, + 'not_after': {'readonly': True}, + 'signature_algorithm': {'readonly': True}, + 'issuer': {'readonly': True}, + 'raw_data': {'readonly': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'int'}, + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + 'not_before': {'key': 'notBefore', 'type': 'iso-8601'}, + 'not_after': {'key': 'notAfter', 'type': 'iso-8601'}, + 'signature_algorithm': {'key': 'signatureAlgorithm', 'type': 'str'}, + 'issuer': {'key': 'issuer', 'type': 'str'}, + 'raw_data': {'key': 'rawData', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateDetails, self).__init__(**kwargs) + self.version = None + self.serial_number = None + self.thumbprint = None + self.subject = None + self.not_before = None + self.not_after = None + self.signature_algorithm = None + self.issuer = None + self.raw_data = None + + +class CertificateEmail(ProxyOnlyResource): + """SSL certificate email. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param email_id: Email id. + :type email_id: str + :param time_stamp: Time stamp. + :type time_stamp: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'email_id': {'key': 'properties.emailId', 'type': 'str'}, + 'time_stamp': {'key': 'properties.timeStamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + email_id: Optional[str] = None, + time_stamp: Optional[datetime.datetime] = None, + **kwargs + ): + super(CertificateEmail, self).__init__(kind=kind, **kwargs) + self.email_id = email_id + self.time_stamp = time_stamp + + +class CertificateOrderAction(ProxyOnlyResource): + """Certificate order action. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar action_type: Action type. Possible values include: "CertificateIssued", + "CertificateOrderCanceled", "CertificateOrderCreated", "CertificateRevoked", + "DomainValidationComplete", "FraudDetected", "OrgNameChange", "OrgValidationComplete", + "SanDrop", "FraudCleared", "CertificateExpired", "CertificateExpirationWarning", + "FraudDocumentationRequired", "Unknown". + :vartype action_type: str or ~azure.mgmt.web.v2020_06_01.models.CertificateOrderActionType + :ivar created_at: Time at which the certificate action was performed. + :vartype created_at: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'action_type': {'readonly': True}, + 'created_at': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'action_type': {'key': 'properties.actionType', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(CertificateOrderAction, self).__init__(kind=kind, **kwargs) + self.action_type = None + self.created_at = None + + +class CertificatePatchResource(ProxyOnlyResource): + """ARM resource for a certificate. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar friendly_name: Friendly name of the certificate. + :vartype friendly_name: str + :ivar subject_name: Subject name of the certificate. + :vartype subject_name: str + :param host_names: Host names the certificate applies to. + :type host_names: list[str] + :param pfx_blob: Pfx blob. + :type pfx_blob: bytearray + :ivar site_name: App name. + :vartype site_name: str + :ivar self_link: Self link. + :vartype self_link: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar issue_date: Certificate issue Date. + :vartype issue_date: ~datetime.datetime + :ivar expiration_date: Certificate expiration date. + :vartype expiration_date: ~datetime.datetime + :param password: Certificate password. + :type password: str + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid: Is the certificate valid?. + :vartype valid: bool + :ivar cer_blob: Raw bytes of .cer file. + :vartype cer_blob: bytearray + :ivar public_key_hash: Public key hash. + :vartype public_key_hash: str + :ivar hosting_environment_profile: Specification for the App Service Environment to use for the + certificate. + :vartype hosting_environment_profile: + ~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentProfile + :param key_vault_id: Key Vault Csm resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar key_vault_secret_status: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype key_vault_secret_status: str or + ~azure.mgmt.web.v2020_06_01.models.KeyVaultSecretStatus + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param canonical_name: CNAME of the certificate to be issued via free certificate. + :type canonical_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'site_name': {'readonly': True}, + 'self_link': {'readonly': True}, + 'issuer': {'readonly': True}, + 'issue_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'valid': {'readonly': True}, + 'cer_blob': {'readonly': True}, + 'public_key_hash': {'readonly': True}, + 'hosting_environment_profile': {'readonly': True}, + 'key_vault_secret_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'subject_name': {'key': 'properties.subjectName', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'pfx_blob': {'key': 'properties.pfxBlob', 'type': 'bytearray'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'self_link': {'key': 'properties.selfLink', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'issue_date': {'key': 'properties.issueDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'valid': {'key': 'properties.valid', 'type': 'bool'}, + 'cer_blob': {'key': 'properties.cerBlob', 'type': 'bytearray'}, + 'public_key_hash': {'key': 'properties.publicKeyHash', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'key_vault_secret_status': {'key': 'properties.keyVaultSecretStatus', 'type': 'str'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'canonical_name': {'key': 'properties.canonicalName', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + host_names: Optional[List[str]] = None, + pfx_blob: Optional[bytearray] = None, + password: Optional[str] = None, + key_vault_id: Optional[str] = None, + key_vault_secret_name: Optional[str] = None, + server_farm_id: Optional[str] = None, + canonical_name: Optional[str] = None, + **kwargs + ): + super(CertificatePatchResource, self).__init__(kind=kind, **kwargs) + self.friendly_name = None + self.subject_name = None + self.host_names = host_names + self.pfx_blob = pfx_blob + self.site_name = None + self.self_link = None + self.issuer = None + self.issue_date = None + self.expiration_date = None + self.password = password + self.thumbprint = None + self.valid = None + self.cer_blob = None + self.public_key_hash = None + self.hosting_environment_profile = None + self.key_vault_id = key_vault_id + self.key_vault_secret_name = key_vault_secret_name + self.key_vault_secret_status = None + self.server_farm_id = server_farm_id + self.canonical_name = canonical_name + + +class ClientRegistration(ProxyOnlyResource): + """ClientRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param client_id: + :type client_id: str + :param client_secret_setting_name: + :type client_secret_setting_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + client_id: Optional[str] = None, + client_secret_setting_name: Optional[str] = None, + **kwargs + ): + super(ClientRegistration, self).__init__(kind=kind, **kwargs) + self.client_id = client_id + self.client_secret_setting_name = client_secret_setting_name + + +class CloningInfo(msrest.serialization.Model): + """Information needed for cloning operation. + + All required parameters must be populated in order to send to Azure. + + :param correlation_id: Correlation ID of cloning operation. This ID ties multiple cloning + operations + together to use the same snapshot. + :type correlation_id: str + :param overwrite: :code:`true` to overwrite destination app; otherwise, + :code:`false`. + :type overwrite: bool + :param clone_custom_host_names: :code:`true` to clone custom hostnames from source + app; otherwise, :code:`false`. + :type clone_custom_host_names: bool + :param clone_source_control: :code:`true` to clone source control from source app; + otherwise, :code:`false`. + :type clone_source_control: bool + :param source_web_app_id: Required. ARM resource ID of the source app. App resource ID is of + the form + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + for production slots and + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + for other slots. + :type source_web_app_id: str + :param source_web_app_location: Location of source app ex: West US or North Europe. + :type source_web_app_location: str + :param hosting_environment: App Service Environment. + :type hosting_environment: str + :param app_settings_overrides: Application setting overrides for cloned app. If specified, + these settings override the settings cloned + from source app. Otherwise, application settings from source app are retained. + :type app_settings_overrides: dict[str, str] + :param configure_load_balancing: :code:`true` to configure load balancing for + source and destination app. + :type configure_load_balancing: bool + :param traffic_manager_profile_id: ARM resource ID of the Traffic Manager profile to use, if it + exists. Traffic Manager resource ID is of the form + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + :type traffic_manager_profile_id: str + :param traffic_manager_profile_name: Name of Traffic Manager profile to create. This is only + needed if Traffic Manager profile does not already exist. + :type traffic_manager_profile_name: str + """ + + _validation = { + 'source_web_app_id': {'required': True}, + } + + _attribute_map = { + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'overwrite': {'key': 'overwrite', 'type': 'bool'}, + 'clone_custom_host_names': {'key': 'cloneCustomHostNames', 'type': 'bool'}, + 'clone_source_control': {'key': 'cloneSourceControl', 'type': 'bool'}, + 'source_web_app_id': {'key': 'sourceWebAppId', 'type': 'str'}, + 'source_web_app_location': {'key': 'sourceWebAppLocation', 'type': 'str'}, + 'hosting_environment': {'key': 'hostingEnvironment', 'type': 'str'}, + 'app_settings_overrides': {'key': 'appSettingsOverrides', 'type': '{str}'}, + 'configure_load_balancing': {'key': 'configureLoadBalancing', 'type': 'bool'}, + 'traffic_manager_profile_id': {'key': 'trafficManagerProfileId', 'type': 'str'}, + 'traffic_manager_profile_name': {'key': 'trafficManagerProfileName', 'type': 'str'}, + } + + def __init__( + self, + *, + source_web_app_id: str, + correlation_id: Optional[str] = None, + overwrite: Optional[bool] = None, + clone_custom_host_names: Optional[bool] = None, + clone_source_control: Optional[bool] = None, + source_web_app_location: Optional[str] = None, + hosting_environment: Optional[str] = None, + app_settings_overrides: Optional[Dict[str, str]] = None, + configure_load_balancing: Optional[bool] = None, + traffic_manager_profile_id: Optional[str] = None, + traffic_manager_profile_name: Optional[str] = None, + **kwargs + ): + super(CloningInfo, self).__init__(**kwargs) + self.correlation_id = correlation_id + self.overwrite = overwrite + self.clone_custom_host_names = clone_custom_host_names + self.clone_source_control = clone_source_control + self.source_web_app_id = source_web_app_id + self.source_web_app_location = source_web_app_location + self.hosting_environment = hosting_environment + self.app_settings_overrides = app_settings_overrides + self.configure_load_balancing = configure_load_balancing + self.traffic_manager_profile_id = traffic_manager_profile_id + self.traffic_manager_profile_name = traffic_manager_profile_name + + +class Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: Principal Id of user assigned identity. + :vartype principal_id: str + :ivar client_id: Client Id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class ConnectionStringDictionary(ProxyOnlyResource): + """String dictionary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param properties: Connection strings. + :type properties: dict[str, ~azure.mgmt.web.v2020_06_01.models.ConnStringValueTypePair] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{ConnStringValueTypePair}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + properties: Optional[Dict[str, "ConnStringValueTypePair"]] = None, + **kwargs + ): + super(ConnectionStringDictionary, self).__init__(kind=kind, **kwargs) + self.properties = properties + + +class ConnStringInfo(msrest.serialization.Model): + """Database connection string information. + + :param name: Name of connection string. + :type name: str + :param connection_string: Connection string value. + :type connection_string: str + :param type: Type of database. Possible values include: "MySql", "SQLServer", "SQLAzure", + "Custom", "NotificationHub", "ServiceBus", "EventHub", "ApiHub", "DocDb", "RedisCache", + "PostgreSQL". + :type type: str or ~azure.mgmt.web.v2020_06_01.models.ConnectionStringType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + connection_string: Optional[str] = None, + type: Optional[Union[str, "ConnectionStringType"]] = None, + **kwargs + ): + super(ConnStringInfo, self).__init__(**kwargs) + self.name = name + self.connection_string = connection_string + self.type = type + + +class ConnStringValueTypePair(msrest.serialization.Model): + """Database connection string value to type pair. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Value of pair. + :type value: str + :param type: Required. Type of database. Possible values include: "MySql", "SQLServer", + "SQLAzure", "Custom", "NotificationHub", "ServiceBus", "EventHub", "ApiHub", "DocDb", + "RedisCache", "PostgreSQL". + :type type: str or ~azure.mgmt.web.v2020_06_01.models.ConnectionStringType + """ + + _validation = { + 'value': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + value: str, + type: Union[str, "ConnectionStringType"], + **kwargs + ): + super(ConnStringValueTypePair, self).__init__(**kwargs) + self.value = value + self.type = type + + +class Contact(msrest.serialization.Model): + """Contact information for domain registration. If 'Domain Privacy' option is not selected then the contact information is made publicly available through the Whois +directories as per ICANN requirements. + + All required parameters must be populated in order to send to Azure. + + :param address_mailing: Mailing address. + :type address_mailing: ~azure.mgmt.web.v2020_06_01.models.Address + :param email: Required. Email address. + :type email: str + :param fax: Fax number. + :type fax: str + :param job_title: Job title. + :type job_title: str + :param name_first: Required. First name. + :type name_first: str + :param name_last: Required. Last name. + :type name_last: str + :param name_middle: Middle name. + :type name_middle: str + :param organization: Organization contact belongs to. + :type organization: str + :param phone: Required. Phone number. + :type phone: str + """ + + _validation = { + 'email': {'required': True}, + 'name_first': {'required': True}, + 'name_last': {'required': True}, + 'phone': {'required': True}, + } + + _attribute_map = { + 'address_mailing': {'key': 'addressMailing', 'type': 'Address'}, + 'email': {'key': 'email', 'type': 'str'}, + 'fax': {'key': 'fax', 'type': 'str'}, + 'job_title': {'key': 'jobTitle', 'type': 'str'}, + 'name_first': {'key': 'nameFirst', 'type': 'str'}, + 'name_last': {'key': 'nameLast', 'type': 'str'}, + 'name_middle': {'key': 'nameMiddle', 'type': 'str'}, + 'organization': {'key': 'organization', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + } + + def __init__( + self, + *, + email: str, + name_first: str, + name_last: str, + phone: str, + address_mailing: Optional["Address"] = None, + fax: Optional[str] = None, + job_title: Optional[str] = None, + name_middle: Optional[str] = None, + organization: Optional[str] = None, + **kwargs + ): + super(Contact, self).__init__(**kwargs) + self.address_mailing = address_mailing + self.email = email + self.fax = fax + self.job_title = job_title + self.name_first = name_first + self.name_last = name_last + self.name_middle = name_middle + self.organization = organization + self.phone = phone + + +class ContainerCpuStatistics(msrest.serialization.Model): + """ContainerCpuStatistics. + + :param cpu_usage: + :type cpu_usage: ~azure.mgmt.web.v2020_06_01.models.ContainerCpuUsage + :param system_cpu_usage: + :type system_cpu_usage: long + :param online_cpu_count: + :type online_cpu_count: int + :param throttling_data: + :type throttling_data: ~azure.mgmt.web.v2020_06_01.models.ContainerThrottlingData + """ + + _attribute_map = { + 'cpu_usage': {'key': 'cpuUsage', 'type': 'ContainerCpuUsage'}, + 'system_cpu_usage': {'key': 'systemCpuUsage', 'type': 'long'}, + 'online_cpu_count': {'key': 'onlineCpuCount', 'type': 'int'}, + 'throttling_data': {'key': 'throttlingData', 'type': 'ContainerThrottlingData'}, + } + + def __init__( + self, + *, + cpu_usage: Optional["ContainerCpuUsage"] = None, + system_cpu_usage: Optional[int] = None, + online_cpu_count: Optional[int] = None, + throttling_data: Optional["ContainerThrottlingData"] = None, + **kwargs + ): + super(ContainerCpuStatistics, self).__init__(**kwargs) + self.cpu_usage = cpu_usage + self.system_cpu_usage = system_cpu_usage + self.online_cpu_count = online_cpu_count + self.throttling_data = throttling_data + + +class ContainerCpuUsage(msrest.serialization.Model): + """ContainerCpuUsage. + + :param total_usage: + :type total_usage: long + :param per_cpu_usage: + :type per_cpu_usage: list[long] + :param kernel_mode_usage: + :type kernel_mode_usage: long + :param user_mode_usage: + :type user_mode_usage: long + """ + + _attribute_map = { + 'total_usage': {'key': 'totalUsage', 'type': 'long'}, + 'per_cpu_usage': {'key': 'perCpuUsage', 'type': '[long]'}, + 'kernel_mode_usage': {'key': 'kernelModeUsage', 'type': 'long'}, + 'user_mode_usage': {'key': 'userModeUsage', 'type': 'long'}, + } + + def __init__( + self, + *, + total_usage: Optional[int] = None, + per_cpu_usage: Optional[List[int]] = None, + kernel_mode_usage: Optional[int] = None, + user_mode_usage: Optional[int] = None, + **kwargs + ): + super(ContainerCpuUsage, self).__init__(**kwargs) + self.total_usage = total_usage + self.per_cpu_usage = per_cpu_usage + self.kernel_mode_usage = kernel_mode_usage + self.user_mode_usage = user_mode_usage + + +class ContainerInfo(msrest.serialization.Model): + """ContainerInfo. + + :param current_time_stamp: + :type current_time_stamp: ~datetime.datetime + :param previous_time_stamp: + :type previous_time_stamp: ~datetime.datetime + :param current_cpu_stats: + :type current_cpu_stats: ~azure.mgmt.web.v2020_06_01.models.ContainerCpuStatistics + :param previous_cpu_stats: + :type previous_cpu_stats: ~azure.mgmt.web.v2020_06_01.models.ContainerCpuStatistics + :param memory_stats: + :type memory_stats: ~azure.mgmt.web.v2020_06_01.models.ContainerMemoryStatistics + :param name: + :type name: str + :param id: + :type id: str + :param eth0: + :type eth0: ~azure.mgmt.web.v2020_06_01.models.ContainerNetworkInterfaceStatistics + """ + + _attribute_map = { + 'current_time_stamp': {'key': 'currentTimeStamp', 'type': 'iso-8601'}, + 'previous_time_stamp': {'key': 'previousTimeStamp', 'type': 'iso-8601'}, + 'current_cpu_stats': {'key': 'currentCpuStats', 'type': 'ContainerCpuStatistics'}, + 'previous_cpu_stats': {'key': 'previousCpuStats', 'type': 'ContainerCpuStatistics'}, + 'memory_stats': {'key': 'memoryStats', 'type': 'ContainerMemoryStatistics'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'eth0': {'key': 'eth0', 'type': 'ContainerNetworkInterfaceStatistics'}, + } + + def __init__( + self, + *, + current_time_stamp: Optional[datetime.datetime] = None, + previous_time_stamp: Optional[datetime.datetime] = None, + current_cpu_stats: Optional["ContainerCpuStatistics"] = None, + previous_cpu_stats: Optional["ContainerCpuStatistics"] = None, + memory_stats: Optional["ContainerMemoryStatistics"] = None, + name: Optional[str] = None, + id: Optional[str] = None, + eth0: Optional["ContainerNetworkInterfaceStatistics"] = None, + **kwargs + ): + super(ContainerInfo, self).__init__(**kwargs) + self.current_time_stamp = current_time_stamp + self.previous_time_stamp = previous_time_stamp + self.current_cpu_stats = current_cpu_stats + self.previous_cpu_stats = previous_cpu_stats + self.memory_stats = memory_stats + self.name = name + self.id = id + self.eth0 = eth0 + + +class ContainerMemoryStatistics(msrest.serialization.Model): + """ContainerMemoryStatistics. + + :param usage: + :type usage: long + :param max_usage: + :type max_usage: long + :param limit: + :type limit: long + """ + + _attribute_map = { + 'usage': {'key': 'usage', 'type': 'long'}, + 'max_usage': {'key': 'maxUsage', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + } + + def __init__( + self, + *, + usage: Optional[int] = None, + max_usage: Optional[int] = None, + limit: Optional[int] = None, + **kwargs + ): + super(ContainerMemoryStatistics, self).__init__(**kwargs) + self.usage = usage + self.max_usage = max_usage + self.limit = limit + + +class ContainerNetworkInterfaceStatistics(msrest.serialization.Model): + """ContainerNetworkInterfaceStatistics. + + :param rx_bytes: + :type rx_bytes: long + :param rx_packets: + :type rx_packets: long + :param rx_errors: + :type rx_errors: long + :param rx_dropped: + :type rx_dropped: long + :param tx_bytes: + :type tx_bytes: long + :param tx_packets: + :type tx_packets: long + :param tx_errors: + :type tx_errors: long + :param tx_dropped: + :type tx_dropped: long + """ + + _attribute_map = { + 'rx_bytes': {'key': 'rxBytes', 'type': 'long'}, + 'rx_packets': {'key': 'rxPackets', 'type': 'long'}, + 'rx_errors': {'key': 'rxErrors', 'type': 'long'}, + 'rx_dropped': {'key': 'rxDropped', 'type': 'long'}, + 'tx_bytes': {'key': 'txBytes', 'type': 'long'}, + 'tx_packets': {'key': 'txPackets', 'type': 'long'}, + 'tx_errors': {'key': 'txErrors', 'type': 'long'}, + 'tx_dropped': {'key': 'txDropped', 'type': 'long'}, + } + + def __init__( + self, + *, + rx_bytes: Optional[int] = None, + rx_packets: Optional[int] = None, + rx_errors: Optional[int] = None, + rx_dropped: Optional[int] = None, + tx_bytes: Optional[int] = None, + tx_packets: Optional[int] = None, + tx_errors: Optional[int] = None, + tx_dropped: Optional[int] = None, + **kwargs + ): + super(ContainerNetworkInterfaceStatistics, self).__init__(**kwargs) + self.rx_bytes = rx_bytes + self.rx_packets = rx_packets + self.rx_errors = rx_errors + self.rx_dropped = rx_dropped + self.tx_bytes = tx_bytes + self.tx_packets = tx_packets + self.tx_errors = tx_errors + self.tx_dropped = tx_dropped + + +class ContainerThrottlingData(msrest.serialization.Model): + """ContainerThrottlingData. + + :param periods: + :type periods: int + :param throttled_periods: + :type throttled_periods: int + :param throttled_time: + :type throttled_time: int + """ + + _attribute_map = { + 'periods': {'key': 'periods', 'type': 'int'}, + 'throttled_periods': {'key': 'throttledPeriods', 'type': 'int'}, + 'throttled_time': {'key': 'throttledTime', 'type': 'int'}, + } + + def __init__( + self, + *, + periods: Optional[int] = None, + throttled_periods: Optional[int] = None, + throttled_time: Optional[int] = None, + **kwargs + ): + super(ContainerThrottlingData, self).__init__(**kwargs) + self.periods = periods + self.throttled_periods = throttled_periods + self.throttled_time = throttled_time + + +class ContinuousWebJob(ProxyOnlyResource): + """Continuous Web Job Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param status: Job status. Possible values include: "Initializing", "Starting", "Running", + "PendingRestart", "Stopped". + :type status: str or ~azure.mgmt.web.v2020_06_01.models.ContinuousWebJobStatus + :param detailed_status: Detailed status. + :type detailed_status: str + :param log_url: Log URL. + :type log_url: str + :param run_command: Run command. + :type run_command: str + :param url: Job URL. + :type url: str + :param extra_info_url: Extra Info URL. + :type extra_info_url: str + :param web_job_type: Job type. Possible values include: "Continuous", "Triggered". + :type web_job_type: str or ~azure.mgmt.web.v2020_06_01.models.WebJobType + :param error: Error information. + :type error: str + :param using_sdk: Using SDK?. + :type using_sdk: bool + :param settings: Job settings. + :type settings: dict[str, object] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'detailed_status': {'key': 'properties.detailed_status', 'type': 'str'}, + 'log_url': {'key': 'properties.log_url', 'type': 'str'}, + 'run_command': {'key': 'properties.run_command', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'extra_info_url': {'key': 'properties.extra_info_url', 'type': 'str'}, + 'web_job_type': {'key': 'properties.web_job_type', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'str'}, + 'using_sdk': {'key': 'properties.using_sdk', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': '{object}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + status: Optional[Union[str, "ContinuousWebJobStatus"]] = None, + detailed_status: Optional[str] = None, + log_url: Optional[str] = None, + run_command: Optional[str] = None, + url: Optional[str] = None, + extra_info_url: Optional[str] = None, + web_job_type: Optional[Union[str, "WebJobType"]] = None, + error: Optional[str] = None, + using_sdk: Optional[bool] = None, + settings: Optional[Dict[str, object]] = None, + **kwargs + ): + super(ContinuousWebJob, self).__init__(kind=kind, **kwargs) + self.status = status + self.detailed_status = detailed_status + self.log_url = log_url + self.run_command = run_command + self.url = url + self.extra_info_url = extra_info_url + self.web_job_type = web_job_type + self.error = error + self.using_sdk = using_sdk + self.settings = settings + + +class ContinuousWebJobCollection(msrest.serialization.Model): + """Collection of Kudu continuous web job information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.ContinuousWebJob] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ContinuousWebJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ContinuousWebJob"], + **kwargs + ): + super(ContinuousWebJobCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class CookieExpiration(ProxyOnlyResource): + """CookieExpiration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param convention: Possible values include: "FixedTime", "IdentityProviderDerived". + :type convention: str or ~azure.mgmt.web.v2020_06_01.models.CookieExpirationConvention + :param time_to_expiration: + :type time_to_expiration: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'convention': {'key': 'properties.convention', 'type': 'str'}, + 'time_to_expiration': {'key': 'properties.timeToExpiration', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + convention: Optional[Union[str, "CookieExpirationConvention"]] = None, + time_to_expiration: Optional[str] = None, + **kwargs + ): + super(CookieExpiration, self).__init__(kind=kind, **kwargs) + self.convention = convention + self.time_to_expiration = time_to_expiration + + +class CorsSettings(msrest.serialization.Model): + """Cross-Origin Resource Sharing (CORS) settings for the app. + + :param allowed_origins: Gets or sets the list of origins that should be allowed to make cross- + origin + calls (for example: http://example.com:12345). Use "*" to allow all. + :type allowed_origins: list[str] + :param support_credentials: Gets or sets whether CORS requests with credentials are allowed. + See + https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + for more details. + :type support_credentials: bool + """ + + _attribute_map = { + 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'support_credentials': {'key': 'supportCredentials', 'type': 'bool'}, + } + + def __init__( + self, + *, + allowed_origins: Optional[List[str]] = None, + support_credentials: Optional[bool] = None, + **kwargs + ): + super(CorsSettings, self).__init__(**kwargs) + self.allowed_origins = allowed_origins + self.support_credentials = support_credentials + + +class CsmCopySlotEntity(msrest.serialization.Model): + """Copy deployment slot parameters. + + All required parameters must be populated in order to send to Azure. + + :param target_slot: Required. Destination deployment slot during copy operation. + :type target_slot: str + :param site_config: Required. The site object which will be merged with the source slot site + to produce new destination slot site object. + :code:`null` to just copy source slot content. Otherwise a + :code:`Site` + object with properties to override source slot site. + :type site_config: ~azure.mgmt.web.v2020_06_01.models.SiteConfig + """ + + _validation = { + 'target_slot': {'required': True}, + 'site_config': {'required': True}, + } + + _attribute_map = { + 'target_slot': {'key': 'targetSlot', 'type': 'str'}, + 'site_config': {'key': 'siteConfig', 'type': 'SiteConfig'}, + } + + def __init__( + self, + *, + target_slot: str, + site_config: "SiteConfig", + **kwargs + ): + super(CsmCopySlotEntity, self).__init__(**kwargs) + self.target_slot = target_slot + self.site_config = site_config + + +class CsmMoveResourceEnvelope(msrest.serialization.Model): + """Object with a list of the resources that need to be moved and the resource group they should be moved to. + + :param target_resource_group: + :type target_resource_group: str + :param resources: + :type resources: list[str] + """ + + _validation = { + 'target_resource_group': {'max_length': 90, 'min_length': 1, 'pattern': r' ^[-\w\._\(\)]+[^\.]$'}, + } + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + } + + def __init__( + self, + *, + target_resource_group: Optional[str] = None, + resources: Optional[List[str]] = None, + **kwargs + ): + super(CsmMoveResourceEnvelope, self).__init__(**kwargs) + self.target_resource_group = target_resource_group + self.resources = resources + + +class CsmOperationCollection(msrest.serialization.Model): + """Collection of Azure resource manager operation metadata. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.CsmOperationDescription] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CsmOperationDescription]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["CsmOperationDescription"], + **kwargs + ): + super(CsmOperationCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class CsmOperationDescription(msrest.serialization.Model): + """Description of an operation available for Microsoft.Web resource provider. + + :param name: + :type name: str + :param display: Meta data about operation used for display in portal. + :type display: ~azure.mgmt.web.v2020_06_01.models.CsmOperationDisplay + :param origin: + :type origin: str + :param properties: Properties available for a Microsoft.Web resource provider operation. + :type properties: ~azure.mgmt.web.v2020_06_01.models.CsmOperationDescriptionProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'CsmOperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CsmOperationDescriptionProperties'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["CsmOperationDisplay"] = None, + origin: Optional[str] = None, + properties: Optional["CsmOperationDescriptionProperties"] = None, + **kwargs + ): + super(CsmOperationDescription, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.properties = properties + + +class CsmOperationDescriptionProperties(msrest.serialization.Model): + """Properties available for a Microsoft.Web resource provider operation. + + :param service_specification: Resource metrics service provided by Microsoft.Insights resource + provider. + :type service_specification: ~azure.mgmt.web.v2020_06_01.models.ServiceSpecification + """ + + _attribute_map = { + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__( + self, + *, + service_specification: Optional["ServiceSpecification"] = None, + **kwargs + ): + super(CsmOperationDescriptionProperties, self).__init__(**kwargs) + self.service_specification = service_specification + + +class CsmOperationDisplay(msrest.serialization.Model): + """Meta data about operation used for display in portal. + + :param provider: + :type provider: str + :param resource: + :type resource: str + :param operation: + :type operation: str + :param description: + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(CsmOperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class CsmPublishingCredentialsPoliciesCollection(ProxyOnlyResource): + """Publishing Credentials Policies collection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param ftp: Whether FTP is allowed. + :type ftp: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingCredentialsPoliciesEntity + :param scm: Whether Scm Basic Auth is allowed. + :type scm: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingCredentialsPoliciesEntity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'ftp': {'key': 'properties.ftp', 'type': 'CsmPublishingCredentialsPoliciesEntity'}, + 'scm': {'key': 'properties.scm', 'type': 'CsmPublishingCredentialsPoliciesEntity'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + ftp: Optional["CsmPublishingCredentialsPoliciesEntity"] = None, + scm: Optional["CsmPublishingCredentialsPoliciesEntity"] = None, + **kwargs + ): + super(CsmPublishingCredentialsPoliciesCollection, self).__init__(kind=kind, **kwargs) + self.ftp = ftp + self.scm = scm + + +class CsmPublishingCredentialsPoliciesEntity(ProxyOnlyResource): + """Publishing Credentials Policies parameters. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param allow: :code:`true` to allow access to a publishing method; otherwise, + :code:`false`. + :type allow: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'allow': {'key': 'properties.allow', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + allow: Optional[bool] = None, + **kwargs + ): + super(CsmPublishingCredentialsPoliciesEntity, self).__init__(kind=kind, **kwargs) + self.allow = allow + + +class CsmPublishingProfileOptions(msrest.serialization.Model): + """Publishing options for requested profile. + + :param format: Name of the format. Valid values are: + FileZilla3 + WebDeploy -- default + Ftp. Possible values include: "FileZilla3", "WebDeploy", "Ftp". + :type format: str or ~azure.mgmt.web.v2020_06_01.models.PublishingProfileFormat + :param include_disaster_recovery_endpoints: Include the DisasterRecover endpoint if true. + :type include_disaster_recovery_endpoints: bool + """ + + _attribute_map = { + 'format': {'key': 'format', 'type': 'str'}, + 'include_disaster_recovery_endpoints': {'key': 'includeDisasterRecoveryEndpoints', 'type': 'bool'}, + } + + def __init__( + self, + *, + format: Optional[Union[str, "PublishingProfileFormat"]] = None, + include_disaster_recovery_endpoints: Optional[bool] = None, + **kwargs + ): + super(CsmPublishingProfileOptions, self).__init__(**kwargs) + self.format = format + self.include_disaster_recovery_endpoints = include_disaster_recovery_endpoints + + +class CsmSlotEntity(msrest.serialization.Model): + """Deployment slot parameters. + + All required parameters must be populated in order to send to Azure. + + :param target_slot: Required. Destination deployment slot during swap operation. + :type target_slot: str + :param preserve_vnet: Required. :code:`true` to preserve Virtual Network to the + slot during swap; otherwise, :code:`false`. + :type preserve_vnet: bool + """ + + _validation = { + 'target_slot': {'required': True}, + 'preserve_vnet': {'required': True}, + } + + _attribute_map = { + 'target_slot': {'key': 'targetSlot', 'type': 'str'}, + 'preserve_vnet': {'key': 'preserveVnet', 'type': 'bool'}, + } + + def __init__( + self, + *, + target_slot: str, + preserve_vnet: bool, + **kwargs + ): + super(CsmSlotEntity, self).__init__(**kwargs) + self.target_slot = target_slot + self.preserve_vnet = preserve_vnet + + +class CsmUsageQuota(msrest.serialization.Model): + """Usage of the quota resource. + + :param unit: Units of measurement for the quota resource. + :type unit: str + :param next_reset_time: Next reset time for the resource counter. + :type next_reset_time: ~datetime.datetime + :param current_value: The current value of the resource counter. + :type current_value: long + :param limit: The resource limit. + :type limit: long + :param name: Quota name. + :type name: ~azure.mgmt.web.v2020_06_01.models.LocalizableString + """ + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'next_reset_time': {'key': 'nextResetTime', 'type': 'iso-8601'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'LocalizableString'}, + } + + def __init__( + self, + *, + unit: Optional[str] = None, + next_reset_time: Optional[datetime.datetime] = None, + current_value: Optional[int] = None, + limit: Optional[int] = None, + name: Optional["LocalizableString"] = None, + **kwargs + ): + super(CsmUsageQuota, self).__init__(**kwargs) + self.unit = unit + self.next_reset_time = next_reset_time + self.current_value = current_value + self.limit = limit + self.name = name + + +class CsmUsageQuotaCollection(msrest.serialization.Model): + """Collection of CSM usage quotas. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.CsmUsageQuota] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CsmUsageQuota]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["CsmUsageQuota"], + **kwargs + ): + super(CsmUsageQuotaCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class CustomHostnameAnalysisResult(ProxyOnlyResource): + """Custom domain analysis. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar is_hostname_already_verified: :code:`true` if hostname is already verified; + otherwise, :code:`false`. + :vartype is_hostname_already_verified: bool + :ivar custom_domain_verification_test: DNS verification test result. Possible values include: + "Passed", "Failed", "Skipped". + :vartype custom_domain_verification_test: str or + ~azure.mgmt.web.v2020_06_01.models.DnsVerificationTestResult + :ivar custom_domain_verification_failure_info: Raw failure information if DNS verification + fails. + :vartype custom_domain_verification_failure_info: + ~azure.mgmt.web.v2020_06_01.models.ErrorEntity + :ivar has_conflict_on_scale_unit: :code:`true` if there is a conflict on a scale + unit; otherwise, :code:`false`. + :vartype has_conflict_on_scale_unit: bool + :ivar has_conflict_across_subscription: :code:`true` if there is a conflict across + subscriptions; otherwise, :code:`false`. + :vartype has_conflict_across_subscription: bool + :ivar conflicting_app_resource_id: Name of the conflicting app on scale unit if it's within the + same subscription. + :vartype conflicting_app_resource_id: str + :param c_name_records: CName records controller can see for this hostname. + :type c_name_records: list[str] + :param txt_records: TXT records controller can see for this hostname. + :type txt_records: list[str] + :param a_records: A records controller can see for this hostname. + :type a_records: list[str] + :param alternate_c_name_records: Alternate CName records controller can see for this hostname. + :type alternate_c_name_records: list[str] + :param alternate_txt_records: Alternate TXT records controller can see for this hostname. + :type alternate_txt_records: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'is_hostname_already_verified': {'readonly': True}, + 'custom_domain_verification_test': {'readonly': True}, + 'custom_domain_verification_failure_info': {'readonly': True}, + 'has_conflict_on_scale_unit': {'readonly': True}, + 'has_conflict_across_subscription': {'readonly': True}, + 'conflicting_app_resource_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_hostname_already_verified': {'key': 'properties.isHostnameAlreadyVerified', 'type': 'bool'}, + 'custom_domain_verification_test': {'key': 'properties.customDomainVerificationTest', 'type': 'str'}, + 'custom_domain_verification_failure_info': {'key': 'properties.customDomainVerificationFailureInfo', 'type': 'ErrorEntity'}, + 'has_conflict_on_scale_unit': {'key': 'properties.hasConflictOnScaleUnit', 'type': 'bool'}, + 'has_conflict_across_subscription': {'key': 'properties.hasConflictAcrossSubscription', 'type': 'bool'}, + 'conflicting_app_resource_id': {'key': 'properties.conflictingAppResourceId', 'type': 'str'}, + 'c_name_records': {'key': 'properties.cNameRecords', 'type': '[str]'}, + 'txt_records': {'key': 'properties.txtRecords', 'type': '[str]'}, + 'a_records': {'key': 'properties.aRecords', 'type': '[str]'}, + 'alternate_c_name_records': {'key': 'properties.alternateCNameRecords', 'type': '[str]'}, + 'alternate_txt_records': {'key': 'properties.alternateTxtRecords', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + c_name_records: Optional[List[str]] = None, + txt_records: Optional[List[str]] = None, + a_records: Optional[List[str]] = None, + alternate_c_name_records: Optional[List[str]] = None, + alternate_txt_records: Optional[List[str]] = None, + **kwargs + ): + super(CustomHostnameAnalysisResult, self).__init__(kind=kind, **kwargs) + self.is_hostname_already_verified = None + self.custom_domain_verification_test = None + self.custom_domain_verification_failure_info = None + self.has_conflict_on_scale_unit = None + self.has_conflict_across_subscription = None + self.conflicting_app_resource_id = None + self.c_name_records = c_name_records + self.txt_records = txt_records + self.a_records = a_records + self.alternate_c_name_records = alternate_c_name_records + self.alternate_txt_records = alternate_txt_records + + +class CustomOpenIdConnectProvider(ProxyOnlyResource): + """CustomOpenIdConnectProvider. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_06_01.models.OpenIdConnectRegistration + :param login: + :type login: ~azure.mgmt.web.v2020_06_01.models.OpenIdConnectLogin + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'OpenIdConnectRegistration'}, + 'login': {'key': 'properties.login', 'type': 'OpenIdConnectLogin'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + registration: Optional["OpenIdConnectRegistration"] = None, + login: Optional["OpenIdConnectLogin"] = None, + **kwargs + ): + super(CustomOpenIdConnectProvider, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.registration = registration + self.login = login + + +class DatabaseBackupSetting(msrest.serialization.Model): + """Database backup settings. + + All required parameters must be populated in order to send to Azure. + + :param database_type: Required. Database type (e.g. SqlAzure / MySql). Possible values include: + "SqlAzure", "MySql", "LocalMySql", "PostgreSql". + :type database_type: str or ~azure.mgmt.web.v2020_06_01.models.DatabaseType + :param name: + :type name: str + :param connection_string_name: Contains a connection string name that is linked to the + SiteConfig.ConnectionStrings. + This is used during restore with overwrite connection strings options. + :type connection_string_name: str + :param connection_string: Contains a connection string to a database which is being backed up + or restored. If the restore should happen to a new database, the database name inside is the + new one. + :type connection_string: str + """ + + _validation = { + 'database_type': {'required': True}, + } + + _attribute_map = { + 'database_type': {'key': 'databaseType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'connection_string_name': {'key': 'connectionStringName', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + } + + def __init__( + self, + *, + database_type: Union[str, "DatabaseType"], + name: Optional[str] = None, + connection_string_name: Optional[str] = None, + connection_string: Optional[str] = None, + **kwargs + ): + super(DatabaseBackupSetting, self).__init__(**kwargs) + self.database_type = database_type + self.name = name + self.connection_string_name = connection_string_name + self.connection_string = connection_string + + +class DataSource(msrest.serialization.Model): + """Class representing data source used by the detectors. + + :param instructions: Instructions if any for the data source. + :type instructions: list[str] + :param data_source_uri: Datasource Uri Links. + :type data_source_uri: list[~azure.mgmt.web.v2020_06_01.models.NameValuePair] + """ + + _attribute_map = { + 'instructions': {'key': 'instructions', 'type': '[str]'}, + 'data_source_uri': {'key': 'dataSourceUri', 'type': '[NameValuePair]'}, + } + + def __init__( + self, + *, + instructions: Optional[List[str]] = None, + data_source_uri: Optional[List["NameValuePair"]] = None, + **kwargs + ): + super(DataSource, self).__init__(**kwargs) + self.instructions = instructions + self.data_source_uri = data_source_uri + + +class DataTableResponseColumn(msrest.serialization.Model): + """Column definition. + + :param column_name: Name of the column. + :type column_name: str + :param data_type: Data type which looks like 'String' or 'Int32'. + :type data_type: str + :param column_type: Column Type. + :type column_type: str + """ + + _attribute_map = { + 'column_name': {'key': 'columnName', 'type': 'str'}, + 'data_type': {'key': 'dataType', 'type': 'str'}, + 'column_type': {'key': 'columnType', 'type': 'str'}, + } + + def __init__( + self, + *, + column_name: Optional[str] = None, + data_type: Optional[str] = None, + column_type: Optional[str] = None, + **kwargs + ): + super(DataTableResponseColumn, self).__init__(**kwargs) + self.column_name = column_name + self.data_type = data_type + self.column_type = column_type + + +class DataTableResponseObject(msrest.serialization.Model): + """Data Table which defines columns and raw row values. + + :param table_name: Name of the table. + :type table_name: str + :param columns: List of columns with data types. + :type columns: list[~azure.mgmt.web.v2020_06_01.models.DataTableResponseColumn] + :param rows: Raw row values. + :type rows: list[list[str]] + """ + + _attribute_map = { + 'table_name': {'key': 'tableName', 'type': 'str'}, + 'columns': {'key': 'columns', 'type': '[DataTableResponseColumn]'}, + 'rows': {'key': 'rows', 'type': '[[str]]'}, + } + + def __init__( + self, + *, + table_name: Optional[str] = None, + columns: Optional[List["DataTableResponseColumn"]] = None, + rows: Optional[List[List[str]]] = None, + **kwargs + ): + super(DataTableResponseObject, self).__init__(**kwargs) + self.table_name = table_name + self.columns = columns + self.rows = rows + + +class DefaultErrorResponse(msrest.serialization.Model): + """App Service error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Error model. + :vartype error: ~azure.mgmt.web.v2020_06_01.models.DefaultErrorResponseError + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'DefaultErrorResponseError'}, + } + + def __init__( + self, + **kwargs + ): + super(DefaultErrorResponse, self).__init__(**kwargs) + self.error = None + + +class DefaultErrorResponseError(msrest.serialization.Model): + """Error model. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Standardized string to programmatically identify the error. + :vartype code: str + :ivar message: Detailed error description and debugging information. + :vartype message: str + :ivar target: Detailed error description and debugging information. + :vartype target: str + :param details: + :type details: list[~azure.mgmt.web.v2020_06_01.models.DefaultErrorResponseErrorDetailsItem] + :ivar innererror: More information to debug error. + :vartype innererror: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'innererror': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[DefaultErrorResponseErrorDetailsItem]'}, + 'innererror': {'key': 'innererror', 'type': 'str'}, + } + + def __init__( + self, + *, + details: Optional[List["DefaultErrorResponseErrorDetailsItem"]] = None, + **kwargs + ): + super(DefaultErrorResponseError, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = details + self.innererror = None + + +class DefaultErrorResponseErrorDetailsItem(msrest.serialization.Model): + """Detailed errors. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Standardized string to programmatically identify the error. + :vartype code: str + :ivar message: Detailed error description and debugging information. + :vartype message: str + :ivar target: Detailed error description and debugging information. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DefaultErrorResponseErrorDetailsItem, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + + +class DeletedAppRestoreRequest(ProxyOnlyResource): + """Details about restoring a deleted app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param deleted_site_id: ARM resource ID of the deleted app. Example: + /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}. + :type deleted_site_id: str + :param recover_configuration: If true, deleted site configuration, in addition to content, will + be restored. + :type recover_configuration: bool + :param snapshot_time: Point in time to restore the deleted app from, formatted as a DateTime + string. + If unspecified, default value is the time that the app was deleted. + :type snapshot_time: str + :param use_dr_secondary: If true, the snapshot is retrieved from DRSecondary endpoint. + :type use_dr_secondary: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'deleted_site_id': {'key': 'properties.deletedSiteId', 'type': 'str'}, + 'recover_configuration': {'key': 'properties.recoverConfiguration', 'type': 'bool'}, + 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'str'}, + 'use_dr_secondary': {'key': 'properties.useDRSecondary', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + deleted_site_id: Optional[str] = None, + recover_configuration: Optional[bool] = None, + snapshot_time: Optional[str] = None, + use_dr_secondary: Optional[bool] = None, + **kwargs + ): + super(DeletedAppRestoreRequest, self).__init__(kind=kind, **kwargs) + self.deleted_site_id = deleted_site_id + self.recover_configuration = recover_configuration + self.snapshot_time = snapshot_time + self.use_dr_secondary = use_dr_secondary + + +class DeletedSite(ProxyOnlyResource): + """A deleted app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar deleted_site_id: Numeric id for the deleted site. + :vartype deleted_site_id: int + :ivar deleted_timestamp: Time in UTC when the app was deleted. + :vartype deleted_timestamp: str + :ivar subscription: Subscription containing the deleted site. + :vartype subscription: str + :ivar resource_group: ResourceGroup that contained the deleted site. + :vartype resource_group: str + :ivar deleted_site_name: Name of the deleted site. + :vartype deleted_site_name: str + :ivar slot: Slot of the deleted site. + :vartype slot: str + :ivar kind_properties_kind: Kind of site that was deleted. + :vartype kind_properties_kind: str + :ivar geo_region_name: Geo Region of the deleted site. + :vartype geo_region_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'deleted_site_id': {'readonly': True}, + 'deleted_timestamp': {'readonly': True}, + 'subscription': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'deleted_site_name': {'readonly': True}, + 'slot': {'readonly': True}, + 'kind_properties_kind': {'readonly': True}, + 'geo_region_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'deleted_site_id': {'key': 'properties.deletedSiteId', 'type': 'int'}, + 'deleted_timestamp': {'key': 'properties.deletedTimestamp', 'type': 'str'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'deleted_site_name': {'key': 'properties.deletedSiteName', 'type': 'str'}, + 'slot': {'key': 'properties.slot', 'type': 'str'}, + 'kind_properties_kind': {'key': 'properties.kind', 'type': 'str'}, + 'geo_region_name': {'key': 'properties.geoRegionName', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(DeletedSite, self).__init__(kind=kind, **kwargs) + self.deleted_site_id = None + self.deleted_timestamp = None + self.subscription = None + self.resource_group = None + self.deleted_site_name = None + self.slot = None + self.kind_properties_kind = None + self.geo_region_name = None + + +class DeletedWebAppCollection(msrest.serialization.Model): + """Collection of deleted apps. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.DeletedSite] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DeletedSite]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DeletedSite"], + **kwargs + ): + super(DeletedWebAppCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class Deployment(ProxyOnlyResource): + """User credentials used for publishing activity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param status: Deployment status. + :type status: int + :param message: Details about deployment status. + :type message: str + :param author: Who authored the deployment. + :type author: str + :param deployer: Who performed the deployment. + :type deployer: str + :param author_email: Author email. + :type author_email: str + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param end_time: End time. + :type end_time: ~datetime.datetime + :param active: True if deployment is currently active, false if completed and null if not + started. + :type active: bool + :param details: Details on deployment. + :type details: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'int'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'author': {'key': 'properties.author', 'type': 'str'}, + 'deployer': {'key': 'properties.deployer', 'type': 'str'}, + 'author_email': {'key': 'properties.author_email', 'type': 'str'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.end_time', 'type': 'iso-8601'}, + 'active': {'key': 'properties.active', 'type': 'bool'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + status: Optional[int] = None, + message: Optional[str] = None, + author: Optional[str] = None, + deployer: Optional[str] = None, + author_email: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + active: Optional[bool] = None, + details: Optional[str] = None, + **kwargs + ): + super(Deployment, self).__init__(kind=kind, **kwargs) + self.status = status + self.message = message + self.author = author + self.deployer = deployer + self.author_email = author_email + self.start_time = start_time + self.end_time = end_time + self.active = active + self.details = details + + +class DeploymentCollection(msrest.serialization.Model): + """Collection of app deployments. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.Deployment] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Deployment]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Deployment"], + **kwargs + ): + super(DeploymentCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DeploymentLocations(msrest.serialization.Model): + """List of available locations (regions or App Service Environments) for +deployment of App Service resources. + + :param locations: Available regions. + :type locations: list[~azure.mgmt.web.v2020_06_01.models.GeoRegion] + :param hosting_environments: Available App Service Environments with full descriptions of the + environments. + :type hosting_environments: list[~azure.mgmt.web.v2020_06_01.models.AppServiceEnvironment] + :param hosting_environment_deployment_infos: Available App Service Environments with basic + information. + :type hosting_environment_deployment_infos: + list[~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentDeploymentInfo] + """ + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[GeoRegion]'}, + 'hosting_environments': {'key': 'hostingEnvironments', 'type': '[AppServiceEnvironment]'}, + 'hosting_environment_deployment_infos': {'key': 'hostingEnvironmentDeploymentInfos', 'type': '[HostingEnvironmentDeploymentInfo]'}, + } + + def __init__( + self, + *, + locations: Optional[List["GeoRegion"]] = None, + hosting_environments: Optional[List["AppServiceEnvironment"]] = None, + hosting_environment_deployment_infos: Optional[List["HostingEnvironmentDeploymentInfo"]] = None, + **kwargs + ): + super(DeploymentLocations, self).__init__(**kwargs) + self.locations = locations + self.hosting_environments = hosting_environments + self.hosting_environment_deployment_infos = hosting_environment_deployment_infos + + +class DetectorAbnormalTimePeriod(msrest.serialization.Model): + """Class representing Abnormal Time Period detected. + + :param start_time: Start time of the correlated event. + :type start_time: ~datetime.datetime + :param end_time: End time of the correlated event. + :type end_time: ~datetime.datetime + :param message: Message describing the event. + :type message: str + :param source: Represents the name of the Detector. + :type source: str + :param priority: Represents the rank of the Detector. + :type priority: float + :param meta_data: Downtime metadata. + :type meta_data: list[list[~azure.mgmt.web.v2020_06_01.models.NameValuePair]] + :param type: Represents the type of the Detector. Possible values include: "ServiceIncident", + "AppDeployment", "AppCrash", "RuntimeIssueDetected", "AseDeployment", "UserIssue", + "PlatformIssue", "Other". + :type type: str or ~azure.mgmt.web.v2020_06_01.models.IssueType + :param solutions: List of proposed solutions. + :type solutions: list[~azure.mgmt.web.v2020_06_01.models.Solution] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'float'}, + 'meta_data': {'key': 'metaData', 'type': '[[NameValuePair]]'}, + 'type': {'key': 'type', 'type': 'str'}, + 'solutions': {'key': 'solutions', 'type': '[Solution]'}, + } + + def __init__( + self, + *, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + message: Optional[str] = None, + source: Optional[str] = None, + priority: Optional[float] = None, + meta_data: Optional[List[List["NameValuePair"]]] = None, + type: Optional[Union[str, "IssueType"]] = None, + solutions: Optional[List["Solution"]] = None, + **kwargs + ): + super(DetectorAbnormalTimePeriod, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.message = message + self.source = source + self.priority = priority + self.meta_data = meta_data + self.type = type + self.solutions = solutions + + +class DetectorDefinition(ProxyOnlyResource): + """Class representing detector definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: Display name of the detector. + :vartype display_name: str + :ivar description: Description of the detector. + :vartype description: str + :ivar rank: Detector Rank. + :vartype rank: float + :ivar is_enabled: Flag representing whether detector is enabled or not. + :vartype is_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'rank': {'readonly': True}, + 'is_enabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'rank': {'key': 'properties.rank', 'type': 'float'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(DetectorDefinition, self).__init__(kind=kind, **kwargs) + self.display_name = None + self.description = None + self.rank = None + self.is_enabled = None + + +class DetectorInfo(msrest.serialization.Model): + """Definition of Detector. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar description: Short description of the detector and its purpose. + :vartype description: str + :ivar category: Support Category. + :vartype category: str + :ivar sub_category: Support Sub Category. + :vartype sub_category: str + :ivar support_topic_id: Support Topic Id. + :vartype support_topic_id: str + """ + + _validation = { + 'description': {'readonly': True}, + 'category': {'readonly': True}, + 'sub_category': {'readonly': True}, + 'support_topic_id': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'sub_category': {'key': 'subCategory', 'type': 'str'}, + 'support_topic_id': {'key': 'supportTopicId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DetectorInfo, self).__init__(**kwargs) + self.description = None + self.category = None + self.sub_category = None + self.support_topic_id = None + + +class DetectorResponse(ProxyOnlyResource): + """Class representing Response from Detector. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param metadata: metadata for the detector. + :type metadata: ~azure.mgmt.web.v2020_06_01.models.DetectorInfo + :param dataset: Data Set. + :type dataset: list[~azure.mgmt.web.v2020_06_01.models.DiagnosticData] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': 'DetectorInfo'}, + 'dataset': {'key': 'properties.dataset', 'type': '[DiagnosticData]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + metadata: Optional["DetectorInfo"] = None, + dataset: Optional[List["DiagnosticData"]] = None, + **kwargs + ): + super(DetectorResponse, self).__init__(kind=kind, **kwargs) + self.metadata = metadata + self.dataset = dataset + + +class DetectorResponseCollection(msrest.serialization.Model): + """Collection of detector responses. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.DetectorResponse] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DetectorResponse]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DetectorResponse"], + **kwargs + ): + super(DetectorResponseCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DiagnosticAnalysis(ProxyOnlyResource): + """Class representing a diagnostic analysis done on an application. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param abnormal_time_periods: List of time periods. + :type abnormal_time_periods: list[~azure.mgmt.web.v2020_06_01.models.AbnormalTimePeriod] + :param payload: Data by each detector. + :type payload: list[~azure.mgmt.web.v2020_06_01.models.AnalysisData] + :param non_correlated_detectors: Data by each detector for detectors that did not corelate. + :type non_correlated_detectors: list[~azure.mgmt.web.v2020_06_01.models.DetectorDefinition] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'abnormal_time_periods': {'key': 'properties.abnormalTimePeriods', 'type': '[AbnormalTimePeriod]'}, + 'payload': {'key': 'properties.payload', 'type': '[AnalysisData]'}, + 'non_correlated_detectors': {'key': 'properties.nonCorrelatedDetectors', 'type': '[DetectorDefinition]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + abnormal_time_periods: Optional[List["AbnormalTimePeriod"]] = None, + payload: Optional[List["AnalysisData"]] = None, + non_correlated_detectors: Optional[List["DetectorDefinition"]] = None, + **kwargs + ): + super(DiagnosticAnalysis, self).__init__(kind=kind, **kwargs) + self.start_time = start_time + self.end_time = end_time + self.abnormal_time_periods = abnormal_time_periods + self.payload = payload + self.non_correlated_detectors = non_correlated_detectors + + +class DiagnosticAnalysisCollection(msrest.serialization.Model): + """Collection of Diagnostic Analyses. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.AnalysisDefinition] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AnalysisDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["AnalysisDefinition"], + **kwargs + ): + super(DiagnosticAnalysisCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DiagnosticCategory(ProxyOnlyResource): + """Class representing detector definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar description: Description of the diagnostic category. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(DiagnosticCategory, self).__init__(kind=kind, **kwargs) + self.description = None + + +class DiagnosticCategoryCollection(msrest.serialization.Model): + """Collection of Diagnostic Categories. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.DiagnosticCategory] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DiagnosticCategory]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DiagnosticCategory"], + **kwargs + ): + super(DiagnosticCategoryCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DiagnosticData(msrest.serialization.Model): + """Set of data with rendering instructions. + + :param table: Data in table form. + :type table: ~azure.mgmt.web.v2020_06_01.models.DataTableResponseObject + :param rendering_properties: Properties that describe how the table should be rendered. + :type rendering_properties: ~azure.mgmt.web.v2020_06_01.models.Rendering + """ + + _attribute_map = { + 'table': {'key': 'table', 'type': 'DataTableResponseObject'}, + 'rendering_properties': {'key': 'renderingProperties', 'type': 'Rendering'}, + } + + def __init__( + self, + *, + table: Optional["DataTableResponseObject"] = None, + rendering_properties: Optional["Rendering"] = None, + **kwargs + ): + super(DiagnosticData, self).__init__(**kwargs) + self.table = table + self.rendering_properties = rendering_properties + + +class DiagnosticDetectorCollection(msrest.serialization.Model): + """Collection of Diagnostic Detectors. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.DetectorDefinition] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DetectorDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DetectorDefinition"], + **kwargs + ): + super(DiagnosticDetectorCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DiagnosticDetectorResponse(ProxyOnlyResource): + """Class representing Response from Diagnostic Detectors. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param issue_detected: Flag representing Issue was detected. + :type issue_detected: bool + :param detector_definition: Detector's definition. + :type detector_definition: ~azure.mgmt.web.v2020_06_01.models.DetectorDefinition + :param metrics: Metrics provided by the detector. + :type metrics: list[~azure.mgmt.web.v2020_06_01.models.DiagnosticMetricSet] + :param abnormal_time_periods: List of Correlated events found by the detector. + :type abnormal_time_periods: + list[~azure.mgmt.web.v2020_06_01.models.DetectorAbnormalTimePeriod] + :param data: Additional Data that detector wants to send. + :type data: list[list[~azure.mgmt.web.v2020_06_01.models.NameValuePair]] + :param response_meta_data: Meta Data. + :type response_meta_data: ~azure.mgmt.web.v2020_06_01.models.ResponseMetaData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'issue_detected': {'key': 'properties.issueDetected', 'type': 'bool'}, + 'detector_definition': {'key': 'properties.detectorDefinition', 'type': 'DetectorDefinition'}, + 'metrics': {'key': 'properties.metrics', 'type': '[DiagnosticMetricSet]'}, + 'abnormal_time_periods': {'key': 'properties.abnormalTimePeriods', 'type': '[DetectorAbnormalTimePeriod]'}, + 'data': {'key': 'properties.data', 'type': '[[NameValuePair]]'}, + 'response_meta_data': {'key': 'properties.responseMetaData', 'type': 'ResponseMetaData'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + issue_detected: Optional[bool] = None, + detector_definition: Optional["DetectorDefinition"] = None, + metrics: Optional[List["DiagnosticMetricSet"]] = None, + abnormal_time_periods: Optional[List["DetectorAbnormalTimePeriod"]] = None, + data: Optional[List[List["NameValuePair"]]] = None, + response_meta_data: Optional["ResponseMetaData"] = None, + **kwargs + ): + super(DiagnosticDetectorResponse, self).__init__(kind=kind, **kwargs) + self.start_time = start_time + self.end_time = end_time + self.issue_detected = issue_detected + self.detector_definition = detector_definition + self.metrics = metrics + self.abnormal_time_periods = abnormal_time_periods + self.data = data + self.response_meta_data = response_meta_data + + +class DiagnosticMetricSample(msrest.serialization.Model): + """Class representing Diagnostic Metric. + + :param timestamp: Time at which metric is measured. + :type timestamp: ~datetime.datetime + :param role_instance: Role Instance. Null if this counter is not per instance + This is returned and should be whichever instance name we desire to be returned + i.e. CPU and Memory return RDWORKERNAME (LargeDed..._IN_0) + where RDWORKERNAME is Machine name below and RoleInstance name in parenthesis. + :type role_instance: str + :param total: Total value of the metric. If multiple measurements are made this will have sum + of all. + :type total: float + :param maximum: Maximum of the metric sampled during the time period. + :type maximum: float + :param minimum: Minimum of the metric sampled during the time period. + :type minimum: float + :param is_aggregated: Whether the values are aggregates across all workers or not. + :type is_aggregated: bool + """ + + _attribute_map = { + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'role_instance': {'key': 'roleInstance', 'type': 'str'}, + 'total': {'key': 'total', 'type': 'float'}, + 'maximum': {'key': 'maximum', 'type': 'float'}, + 'minimum': {'key': 'minimum', 'type': 'float'}, + 'is_aggregated': {'key': 'isAggregated', 'type': 'bool'}, + } + + def __init__( + self, + *, + timestamp: Optional[datetime.datetime] = None, + role_instance: Optional[str] = None, + total: Optional[float] = None, + maximum: Optional[float] = None, + minimum: Optional[float] = None, + is_aggregated: Optional[bool] = None, + **kwargs + ): + super(DiagnosticMetricSample, self).__init__(**kwargs) + self.timestamp = timestamp + self.role_instance = role_instance + self.total = total + self.maximum = maximum + self.minimum = minimum + self.is_aggregated = is_aggregated + + +class DiagnosticMetricSet(msrest.serialization.Model): + """Class representing Diagnostic Metric information. + + :param name: Name of the metric. + :type name: str + :param unit: Metric's unit. + :type unit: str + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param time_grain: Presented time grain. Supported grains at the moment are PT1M, PT1H, P1D. + :type time_grain: str + :param values: Collection of metric values for the selected period based on the + {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain}. + :type values: list[~azure.mgmt.web.v2020_06_01.models.DiagnosticMetricSample] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[DiagnosticMetricSample]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + unit: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + values: Optional[List["DiagnosticMetricSample"]] = None, + **kwargs + ): + super(DiagnosticMetricSet, self).__init__(**kwargs) + self.name = name + self.unit = unit + self.start_time = start_time + self.end_time = end_time + self.time_grain = time_grain + self.values = values + + +class Dimension(msrest.serialization.Model): + """Dimension of a resource metric. For e.g. instance specific HTTP requests for a web app, +where instance name is dimension of the metric HTTP request. + + :param name: + :type name: str + :param display_name: + :type display_name: str + :param internal_name: + :type internal_name: str + :param to_be_exported_for_shoebox: + :type to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + internal_name: Optional[str] = None, + to_be_exported_for_shoebox: Optional[bool] = None, + **kwargs + ): + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.internal_name = internal_name + self.to_be_exported_for_shoebox = to_be_exported_for_shoebox + + +class Domain(Resource): + """Information about a domain. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param contact_admin: Administrative contact. + :type contact_admin: ~azure.mgmt.web.v2020_06_01.models.Contact + :param contact_billing: Billing contact. + :type contact_billing: ~azure.mgmt.web.v2020_06_01.models.Contact + :param contact_registrant: Registrant contact. + :type contact_registrant: ~azure.mgmt.web.v2020_06_01.models.Contact + :param contact_tech: Technical contact. + :type contact_tech: ~azure.mgmt.web.v2020_06_01.models.Contact + :ivar registration_status: Domain registration status. Possible values include: "Active", + "Awaiting", "Cancelled", "Confiscated", "Disabled", "Excluded", "Expired", "Failed", "Held", + "Locked", "Parked", "Pending", "Reserved", "Reverted", "Suspended", "Transferred", "Unknown", + "Unlocked", "Unparked", "Updated", "JsonConverterFailed". + :vartype registration_status: str or ~azure.mgmt.web.v2020_06_01.models.DomainStatus + :ivar provisioning_state: Domain provisioning state. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.ProvisioningState + :ivar name_servers: Name servers. + :vartype name_servers: list[str] + :param privacy: :code:`true` if domain privacy is enabled for this domain; + otherwise, :code:`false`. + :type privacy: bool + :ivar created_time: Domain creation timestamp. + :vartype created_time: ~datetime.datetime + :ivar expiration_time: Domain expiration timestamp. + :vartype expiration_time: ~datetime.datetime + :ivar last_renewed_time: Timestamp when the domain was renewed last time. + :vartype last_renewed_time: ~datetime.datetime + :param auto_renew: :code:`true` if the domain should be automatically renewed; + otherwise, :code:`false`. + :type auto_renew: bool + :ivar ready_for_dns_record_management: :code:`true` if Azure can assign this + domain to App Service apps; otherwise, :code:`false`. This value will be + :code:`true` if domain registration status is active and + it is hosted on name servers Azure has programmatic access to. + :vartype ready_for_dns_record_management: bool + :ivar managed_host_names: All hostnames derived from the domain and assigned to Azure + resources. + :vartype managed_host_names: list[~azure.mgmt.web.v2020_06_01.models.HostName] + :param consent: Legal agreement consent. + :type consent: ~azure.mgmt.web.v2020_06_01.models.DomainPurchaseConsent + :ivar domain_not_renewable_reasons: Reasons why domain is not renewable. + :vartype domain_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2020_06_01.models.DomainPropertiesDomainNotRenewableReasonsItem] + :param dns_type: Current DNS type. Possible values include: "AzureDns", + "DefaultDomainRegistrarDns". + :type dns_type: str or ~azure.mgmt.web.v2020_06_01.models.DnsType + :param dns_zone_id: Azure DNS Zone to use. + :type dns_zone_id: str + :param target_dns_type: Target DNS type (would be used for migration). Possible values include: + "AzureDns", "DefaultDomainRegistrarDns". + :type target_dns_type: str or ~azure.mgmt.web.v2020_06_01.models.DnsType + :param auth_code: + :type auth_code: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'registration_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'name_servers': {'readonly': True}, + 'created_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'last_renewed_time': {'readonly': True}, + 'ready_for_dns_record_management': {'readonly': True}, + 'managed_host_names': {'readonly': True}, + 'domain_not_renewable_reasons': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'contact_admin': {'key': 'properties.contactAdmin', 'type': 'Contact'}, + 'contact_billing': {'key': 'properties.contactBilling', 'type': 'Contact'}, + 'contact_registrant': {'key': 'properties.contactRegistrant', 'type': 'Contact'}, + 'contact_tech': {'key': 'properties.contactTech', 'type': 'Contact'}, + 'registration_status': {'key': 'properties.registrationStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name_servers': {'key': 'properties.nameServers', 'type': '[str]'}, + 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'last_renewed_time': {'key': 'properties.lastRenewedTime', 'type': 'iso-8601'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'ready_for_dns_record_management': {'key': 'properties.readyForDnsRecordManagement', 'type': 'bool'}, + 'managed_host_names': {'key': 'properties.managedHostNames', 'type': '[HostName]'}, + 'consent': {'key': 'properties.consent', 'type': 'DomainPurchaseConsent'}, + 'domain_not_renewable_reasons': {'key': 'properties.domainNotRenewableReasons', 'type': '[str]'}, + 'dns_type': {'key': 'properties.dnsType', 'type': 'str'}, + 'dns_zone_id': {'key': 'properties.dnsZoneId', 'type': 'str'}, + 'target_dns_type': {'key': 'properties.targetDnsType', 'type': 'str'}, + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + contact_admin: Optional["Contact"] = None, + contact_billing: Optional["Contact"] = None, + contact_registrant: Optional["Contact"] = None, + contact_tech: Optional["Contact"] = None, + privacy: Optional[bool] = None, + auto_renew: Optional[bool] = True, + consent: Optional["DomainPurchaseConsent"] = None, + dns_type: Optional[Union[str, "DnsType"]] = None, + dns_zone_id: Optional[str] = None, + target_dns_type: Optional[Union[str, "DnsType"]] = None, + auth_code: Optional[str] = None, + **kwargs + ): + super(Domain, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.contact_admin = contact_admin + self.contact_billing = contact_billing + self.contact_registrant = contact_registrant + self.contact_tech = contact_tech + self.registration_status = None + self.provisioning_state = None + self.name_servers = None + self.privacy = privacy + self.created_time = None + self.expiration_time = None + self.last_renewed_time = None + self.auto_renew = auto_renew + self.ready_for_dns_record_management = None + self.managed_host_names = None + self.consent = consent + self.domain_not_renewable_reasons = None + self.dns_type = dns_type + self.dns_zone_id = dns_zone_id + self.target_dns_type = target_dns_type + self.auth_code = auth_code + + +class DomainAvailabilityCheckResult(msrest.serialization.Model): + """Domain availability check result. + + :param name: Name of the domain. + :type name: str + :param available: :code:`true` if domain can be purchased using CreateDomain API; + otherwise, :code:`false`. + :type available: bool + :param domain_type: Valid values are Regular domain: Azure will charge the full price of domain + registration, SoftDeleted: Purchasing this domain will simply restore it and this operation + will not cost anything. Possible values include: "Regular", "SoftDeleted". + :type domain_type: str or ~azure.mgmt.web.v2020_06_01.models.DomainType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'available': {'key': 'available', 'type': 'bool'}, + 'domain_type': {'key': 'domainType', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + available: Optional[bool] = None, + domain_type: Optional[Union[str, "DomainType"]] = None, + **kwargs + ): + super(DomainAvailabilityCheckResult, self).__init__(**kwargs) + self.name = name + self.available = available + self.domain_type = domain_type + + +class DomainCollection(msrest.serialization.Model): + """Collection of domains. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.Domain] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Domain]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Domain"], + **kwargs + ): + super(DomainCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DomainControlCenterSsoRequest(msrest.serialization.Model): + """Single sign-on request information for domain management. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar url: URL where the single sign-on request is to be made. + :vartype url: str + :ivar post_parameter_key: Post parameter key. + :vartype post_parameter_key: str + :ivar post_parameter_value: Post parameter value. Client should use 'application/x-www-form- + urlencoded' encoding for this value. + :vartype post_parameter_value: str + """ + + _validation = { + 'url': {'readonly': True}, + 'post_parameter_key': {'readonly': True}, + 'post_parameter_value': {'readonly': True}, + } + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'post_parameter_key': {'key': 'postParameterKey', 'type': 'str'}, + 'post_parameter_value': {'key': 'postParameterValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainControlCenterSsoRequest, self).__init__(**kwargs) + self.url = None + self.post_parameter_key = None + self.post_parameter_value = None + + +class DomainOwnershipIdentifier(ProxyOnlyResource): + """Domain ownership Identifier. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param ownership_id: Ownership Id. + :type ownership_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'ownership_id': {'key': 'properties.ownershipId', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + ownership_id: Optional[str] = None, + **kwargs + ): + super(DomainOwnershipIdentifier, self).__init__(kind=kind, **kwargs) + self.ownership_id = ownership_id + + +class DomainOwnershipIdentifierCollection(msrest.serialization.Model): + """Collection of domain ownership identifiers. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.DomainOwnershipIdentifier] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DomainOwnershipIdentifier]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DomainOwnershipIdentifier"], + **kwargs + ): + super(DomainOwnershipIdentifierCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DomainPatchResource(ProxyOnlyResource): + """ARM resource for a domain. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param contact_admin: Administrative contact. + :type contact_admin: ~azure.mgmt.web.v2020_06_01.models.Contact + :param contact_billing: Billing contact. + :type contact_billing: ~azure.mgmt.web.v2020_06_01.models.Contact + :param contact_registrant: Registrant contact. + :type contact_registrant: ~azure.mgmt.web.v2020_06_01.models.Contact + :param contact_tech: Technical contact. + :type contact_tech: ~azure.mgmt.web.v2020_06_01.models.Contact + :ivar registration_status: Domain registration status. Possible values include: "Active", + "Awaiting", "Cancelled", "Confiscated", "Disabled", "Excluded", "Expired", "Failed", "Held", + "Locked", "Parked", "Pending", "Reserved", "Reverted", "Suspended", "Transferred", "Unknown", + "Unlocked", "Unparked", "Updated", "JsonConverterFailed". + :vartype registration_status: str or ~azure.mgmt.web.v2020_06_01.models.DomainStatus + :ivar provisioning_state: Domain provisioning state. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_06_01.models.ProvisioningState + :ivar name_servers: Name servers. + :vartype name_servers: list[str] + :param privacy: :code:`true` if domain privacy is enabled for this domain; + otherwise, :code:`false`. + :type privacy: bool + :ivar created_time: Domain creation timestamp. + :vartype created_time: ~datetime.datetime + :ivar expiration_time: Domain expiration timestamp. + :vartype expiration_time: ~datetime.datetime + :ivar last_renewed_time: Timestamp when the domain was renewed last time. + :vartype last_renewed_time: ~datetime.datetime + :param auto_renew: :code:`true` if the domain should be automatically renewed; + otherwise, :code:`false`. + :type auto_renew: bool + :ivar ready_for_dns_record_management: :code:`true` if Azure can assign this + domain to App Service apps; otherwise, :code:`false`. This value will be + :code:`true` if domain registration status is active and + it is hosted on name servers Azure has programmatic access to. + :vartype ready_for_dns_record_management: bool + :ivar managed_host_names: All hostnames derived from the domain and assigned to Azure + resources. + :vartype managed_host_names: list[~azure.mgmt.web.v2020_06_01.models.HostName] + :param consent: Legal agreement consent. + :type consent: ~azure.mgmt.web.v2020_06_01.models.DomainPurchaseConsent + :ivar domain_not_renewable_reasons: Reasons why domain is not renewable. + :vartype domain_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2020_06_01.models.DomainPatchResourcePropertiesDomainNotRenewableReasonsItem] + :param dns_type: Current DNS type. Possible values include: "AzureDns", + "DefaultDomainRegistrarDns". + :type dns_type: str or ~azure.mgmt.web.v2020_06_01.models.DnsType + :param dns_zone_id: Azure DNS Zone to use. + :type dns_zone_id: str + :param target_dns_type: Target DNS type (would be used for migration). Possible values include: + "AzureDns", "DefaultDomainRegistrarDns". + :type target_dns_type: str or ~azure.mgmt.web.v2020_06_01.models.DnsType + :param auth_code: + :type auth_code: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'registration_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'name_servers': {'readonly': True}, + 'created_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'last_renewed_time': {'readonly': True}, + 'ready_for_dns_record_management': {'readonly': True}, + 'managed_host_names': {'readonly': True}, + 'domain_not_renewable_reasons': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'contact_admin': {'key': 'properties.contactAdmin', 'type': 'Contact'}, + 'contact_billing': {'key': 'properties.contactBilling', 'type': 'Contact'}, + 'contact_registrant': {'key': 'properties.contactRegistrant', 'type': 'Contact'}, + 'contact_tech': {'key': 'properties.contactTech', 'type': 'Contact'}, + 'registration_status': {'key': 'properties.registrationStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name_servers': {'key': 'properties.nameServers', 'type': '[str]'}, + 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'last_renewed_time': {'key': 'properties.lastRenewedTime', 'type': 'iso-8601'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'ready_for_dns_record_management': {'key': 'properties.readyForDnsRecordManagement', 'type': 'bool'}, + 'managed_host_names': {'key': 'properties.managedHostNames', 'type': '[HostName]'}, + 'consent': {'key': 'properties.consent', 'type': 'DomainPurchaseConsent'}, + 'domain_not_renewable_reasons': {'key': 'properties.domainNotRenewableReasons', 'type': '[str]'}, + 'dns_type': {'key': 'properties.dnsType', 'type': 'str'}, + 'dns_zone_id': {'key': 'properties.dnsZoneId', 'type': 'str'}, + 'target_dns_type': {'key': 'properties.targetDnsType', 'type': 'str'}, + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + contact_admin: Optional["Contact"] = None, + contact_billing: Optional["Contact"] = None, + contact_registrant: Optional["Contact"] = None, + contact_tech: Optional["Contact"] = None, + privacy: Optional[bool] = None, + auto_renew: Optional[bool] = True, + consent: Optional["DomainPurchaseConsent"] = None, + dns_type: Optional[Union[str, "DnsType"]] = None, + dns_zone_id: Optional[str] = None, + target_dns_type: Optional[Union[str, "DnsType"]] = None, + auth_code: Optional[str] = None, + **kwargs + ): + super(DomainPatchResource, self).__init__(kind=kind, **kwargs) + self.contact_admin = contact_admin + self.contact_billing = contact_billing + self.contact_registrant = contact_registrant + self.contact_tech = contact_tech + self.registration_status = None + self.provisioning_state = None + self.name_servers = None + self.privacy = privacy + self.created_time = None + self.expiration_time = None + self.last_renewed_time = None + self.auto_renew = auto_renew + self.ready_for_dns_record_management = None + self.managed_host_names = None + self.consent = consent + self.domain_not_renewable_reasons = None + self.dns_type = dns_type + self.dns_zone_id = dns_zone_id + self.target_dns_type = target_dns_type + self.auth_code = auth_code + + +class DomainPurchaseConsent(msrest.serialization.Model): + """Domain purchase consent object, representing acceptance of applicable legal agreements. + + :param agreement_keys: List of applicable legal agreement keys. This list can be retrieved + using ListLegalAgreements API under :code:`TopLevelDomain` resource. + :type agreement_keys: list[str] + :param agreed_by: Client IP address. + :type agreed_by: str + :param agreed_at: Timestamp when the agreements were accepted. + :type agreed_at: ~datetime.datetime + """ + + _attribute_map = { + 'agreement_keys': {'key': 'agreementKeys', 'type': '[str]'}, + 'agreed_by': {'key': 'agreedBy', 'type': 'str'}, + 'agreed_at': {'key': 'agreedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + agreement_keys: Optional[List[str]] = None, + agreed_by: Optional[str] = None, + agreed_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(DomainPurchaseConsent, self).__init__(**kwargs) + self.agreement_keys = agreement_keys + self.agreed_by = agreed_by + self.agreed_at = agreed_at + + +class DomainRecommendationSearchParameters(msrest.serialization.Model): + """Domain recommendation search parameters. + + :param keywords: Keywords to be used for generating domain recommendations. + :type keywords: str + :param max_domain_recommendations: Maximum number of recommendations. + :type max_domain_recommendations: int + """ + + _attribute_map = { + 'keywords': {'key': 'keywords', 'type': 'str'}, + 'max_domain_recommendations': {'key': 'maxDomainRecommendations', 'type': 'int'}, + } + + def __init__( + self, + *, + keywords: Optional[str] = None, + max_domain_recommendations: Optional[int] = None, + **kwargs + ): + super(DomainRecommendationSearchParameters, self).__init__(**kwargs) + self.keywords = keywords + self.max_domain_recommendations = max_domain_recommendations + + +class EnabledConfig(msrest.serialization.Model): + """Enabled configuration. + + :param enabled: True if configuration is enabled, false if it is disabled and null if + configuration is not set. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + **kwargs + ): + super(EnabledConfig, self).__init__(**kwargs) + self.enabled = enabled + + +class EndpointDependency(msrest.serialization.Model): + """A domain name that a service is reached at, including details of the current connection status. + + :param domain_name: The domain name of the dependency. + :type domain_name: str + :param endpoint_details: The IP Addresses and Ports used when connecting to DomainName. + :type endpoint_details: list[~azure.mgmt.web.v2020_06_01.models.EndpointDetail] + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'endpoint_details': {'key': 'endpointDetails', 'type': '[EndpointDetail]'}, + } + + def __init__( + self, + *, + domain_name: Optional[str] = None, + endpoint_details: Optional[List["EndpointDetail"]] = None, + **kwargs + ): + super(EndpointDependency, self).__init__(**kwargs) + self.domain_name = domain_name + self.endpoint_details = endpoint_details + + +class EndpointDetail(msrest.serialization.Model): + """Current TCP connectivity information from the App Service Environment to a single endpoint. + + :param ip_address: An IP Address that Domain Name currently resolves to. + :type ip_address: str + :param port: The port an endpoint is connected to. + :type port: int + :param latency: The time in milliseconds it takes for a TCP connection to be created from the + App Service Environment to this IpAddress at this Port. + :type latency: float + :param is_accessible: Whether it is possible to create a TCP connection from the App Service + Environment to this IpAddress at this Port. + :type is_accessible: bool + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'latency': {'key': 'latency', 'type': 'float'}, + 'is_accessible': {'key': 'isAccessible', 'type': 'bool'}, + } + + def __init__( + self, + *, + ip_address: Optional[str] = None, + port: Optional[int] = None, + latency: Optional[float] = None, + is_accessible: Optional[bool] = None, + **kwargs + ): + super(EndpointDetail, self).__init__(**kwargs) + self.ip_address = ip_address + self.port = port + self.latency = latency + self.is_accessible = is_accessible + + +class ErrorEntity(msrest.serialization.Model): + """Body of the error response returned from the API. + + :param extended_code: Type of error. + :type extended_code: str + :param message_template: Message template. + :type message_template: str + :param parameters: Parameters for the template. + :type parameters: list[str] + :param inner_errors: Inner errors. + :type inner_errors: list[~azure.mgmt.web.v2020_06_01.models.ErrorEntity] + :param code: Basic error code. + :type code: str + :param message: Any details of the error. + :type message: str + """ + + _attribute_map = { + 'extended_code': {'key': 'extendedCode', 'type': 'str'}, + 'message_template': {'key': 'messageTemplate', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '[str]'}, + 'inner_errors': {'key': 'innerErrors', 'type': '[ErrorEntity]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + extended_code: Optional[str] = None, + message_template: Optional[str] = None, + parameters: Optional[List[str]] = None, + inner_errors: Optional[List["ErrorEntity"]] = None, + code: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ErrorEntity, self).__init__(**kwargs) + self.extended_code = extended_code + self.message_template = message_template + self.parameters = parameters + self.inner_errors = inner_errors + self.code = code + self.message = message + + +class Experiments(msrest.serialization.Model): + """Routing rules in production experiments. + + :param ramp_up_rules: List of ramp-up rules. + :type ramp_up_rules: list[~azure.mgmt.web.v2020_06_01.models.RampUpRule] + """ + + _attribute_map = { + 'ramp_up_rules': {'key': 'rampUpRules', 'type': '[RampUpRule]'}, + } + + def __init__( + self, + *, + ramp_up_rules: Optional[List["RampUpRule"]] = None, + **kwargs + ): + super(Experiments, self).__init__(**kwargs) + self.ramp_up_rules = ramp_up_rules + + +class Facebook(ProxyOnlyResource): + """Facebook. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_06_01.models.AppRegistration + :param graph_api_version: + :type graph_api_version: str + :param login: + :type login: ~azure.mgmt.web.v2020_06_01.models.LoginScopes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'AppRegistration'}, + 'graph_api_version': {'key': 'properties.graphApiVersion', 'type': 'str'}, + 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + registration: Optional["AppRegistration"] = None, + graph_api_version: Optional[str] = None, + login: Optional["LoginScopes"] = None, + **kwargs + ): + super(Facebook, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.registration = registration + self.graph_api_version = graph_api_version + self.login = login + + +class FileSystemApplicationLogsConfig(msrest.serialization.Model): + """Application logs to file system configuration. + + :param level: Log level. Possible values include: "Off", "Verbose", "Information", "Warning", + "Error". + :type level: str or ~azure.mgmt.web.v2020_06_01.models.LogLevel + """ + + _attribute_map = { + 'level': {'key': 'level', 'type': 'str'}, + } + + def __init__( + self, + *, + level: Optional[Union[str, "LogLevel"]] = None, + **kwargs + ): + super(FileSystemApplicationLogsConfig, self).__init__(**kwargs) + self.level = level + + +class FileSystemHttpLogsConfig(msrest.serialization.Model): + """Http logs to file system configuration. + + :param retention_in_mb: Maximum size in megabytes that http log files can use. + When reached old log files will be removed to make space for new ones. + Value can range between 25 and 100. + :type retention_in_mb: int + :param retention_in_days: Retention in days. + Remove files older than X days. + 0 or lower means no retention. + :type retention_in_days: int + :param enabled: True if configuration is enabled, false if it is disabled and null if + configuration is not set. + :type enabled: bool + """ + + _validation = { + 'retention_in_mb': {'maximum': 100, 'minimum': 25}, + } + + _attribute_map = { + 'retention_in_mb': {'key': 'retentionInMb', 'type': 'int'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + retention_in_mb: Optional[int] = None, + retention_in_days: Optional[int] = None, + enabled: Optional[bool] = None, + **kwargs + ): + super(FileSystemHttpLogsConfig, self).__init__(**kwargs) + self.retention_in_mb = retention_in_mb + self.retention_in_days = retention_in_days + self.enabled = enabled + + +class FileSystemTokenStore(ProxyOnlyResource): + """FileSystemTokenStore. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param directory: + :type directory: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'directory': {'key': 'properties.directory', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + directory: Optional[str] = None, + **kwargs + ): + super(FileSystemTokenStore, self).__init__(kind=kind, **kwargs) + self.directory = directory + + +class ForwardProxy(ProxyOnlyResource): + """ForwardProxy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param convention: Possible values include: "NoProxy", "Standard", "Custom". + :type convention: str or ~azure.mgmt.web.v2020_06_01.models.ForwardProxyConvention + :param custom_host_header_name: + :type custom_host_header_name: str + :param custom_proto_header_name: + :type custom_proto_header_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'convention': {'key': 'properties.convention', 'type': 'str'}, + 'custom_host_header_name': {'key': 'properties.customHostHeaderName', 'type': 'str'}, + 'custom_proto_header_name': {'key': 'properties.customProtoHeaderName', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + convention: Optional[Union[str, "ForwardProxyConvention"]] = None, + custom_host_header_name: Optional[str] = None, + custom_proto_header_name: Optional[str] = None, + **kwargs + ): + super(ForwardProxy, self).__init__(kind=kind, **kwargs) + self.convention = convention + self.custom_host_header_name = custom_host_header_name + self.custom_proto_header_name = custom_proto_header_name + + +class FunctionEnvelope(ProxyOnlyResource): + """Function information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param function_app_id: Function App ID. + :type function_app_id: str + :param script_root_path_href: Script root path URI. + :type script_root_path_href: str + :param script_href: Script URI. + :type script_href: str + :param config_href: Config URI. + :type config_href: str + :param test_data_href: Test data URI. + :type test_data_href: str + :param secrets_file_href: Secrets file URI. + :type secrets_file_href: str + :param href: Function URI. + :type href: str + :param config: Config information. + :type config: object + :param files: File list. + :type files: dict[str, str] + :param test_data: Test data used when testing via the Azure Portal. + :type test_data: str + :param invoke_url_template: The invocation URL. + :type invoke_url_template: str + :param language: The function language. + :type language: str + :param is_disabled: Gets or sets a value indicating whether the function is disabled. + :type is_disabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'function_app_id': {'key': 'properties.function_app_id', 'type': 'str'}, + 'script_root_path_href': {'key': 'properties.script_root_path_href', 'type': 'str'}, + 'script_href': {'key': 'properties.script_href', 'type': 'str'}, + 'config_href': {'key': 'properties.config_href', 'type': 'str'}, + 'test_data_href': {'key': 'properties.test_data_href', 'type': 'str'}, + 'secrets_file_href': {'key': 'properties.secrets_file_href', 'type': 'str'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'config': {'key': 'properties.config', 'type': 'object'}, + 'files': {'key': 'properties.files', 'type': '{str}'}, + 'test_data': {'key': 'properties.test_data', 'type': 'str'}, + 'invoke_url_template': {'key': 'properties.invoke_url_template', 'type': 'str'}, + 'language': {'key': 'properties.language', 'type': 'str'}, + 'is_disabled': {'key': 'properties.isDisabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + function_app_id: Optional[str] = None, + script_root_path_href: Optional[str] = None, + script_href: Optional[str] = None, + config_href: Optional[str] = None, + test_data_href: Optional[str] = None, + secrets_file_href: Optional[str] = None, + href: Optional[str] = None, + config: Optional[object] = None, + files: Optional[Dict[str, str]] = None, + test_data: Optional[str] = None, + invoke_url_template: Optional[str] = None, + language: Optional[str] = None, + is_disabled: Optional[bool] = None, + **kwargs + ): + super(FunctionEnvelope, self).__init__(kind=kind, **kwargs) + self.function_app_id = function_app_id + self.script_root_path_href = script_root_path_href + self.script_href = script_href + self.config_href = config_href + self.test_data_href = test_data_href + self.secrets_file_href = secrets_file_href + self.href = href + self.config = config + self.files = files + self.test_data = test_data + self.invoke_url_template = invoke_url_template + self.language = language + self.is_disabled = is_disabled + + +class FunctionEnvelopeCollection(msrest.serialization.Model): + """Collection of Kudu function information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.FunctionEnvelope] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FunctionEnvelope]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["FunctionEnvelope"], + **kwargs + ): + super(FunctionEnvelopeCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class FunctionSecrets(msrest.serialization.Model): + """Function secrets. + + :param key: Secret key. + :type key: str + :param trigger_url: Trigger URL. + :type trigger_url: str + """ + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'trigger_url': {'key': 'trigger_url', 'type': 'str'}, + } + + def __init__( + self, + *, + key: Optional[str] = None, + trigger_url: Optional[str] = None, + **kwargs + ): + super(FunctionSecrets, self).__init__(**kwargs) + self.key = key + self.trigger_url = trigger_url + + +class GeoRegion(ProxyOnlyResource): + """Geographical region. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar description: Region description. + :vartype description: str + :ivar display_name: Display name for region. + :vartype display_name: str + :ivar org_domain: Display name for region. + :vartype org_domain: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'display_name': {'readonly': True}, + 'org_domain': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'org_domain': {'key': 'properties.orgDomain', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(GeoRegion, self).__init__(kind=kind, **kwargs) + self.description = None + self.display_name = None + self.org_domain = None + + +class GeoRegionCollection(msrest.serialization.Model): + """Collection of geographical regions. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.GeoRegion] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GeoRegion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["GeoRegion"], + **kwargs + ): + super(GeoRegionCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class GitHub(ProxyOnlyResource): + """GitHub. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_06_01.models.ClientRegistration + :param login: + :type login: ~azure.mgmt.web.v2020_06_01.models.LoginScopes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + registration: Optional["ClientRegistration"] = None, + login: Optional["LoginScopes"] = None, + **kwargs + ): + super(GitHub, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.registration = registration + self.login = login + + +class GlobalCsmSkuDescription(msrest.serialization.Model): + """A Global SKU Description. + + :param name: Name of the resource SKU. + :type name: str + :param tier: Service Tier of the resource SKU. + :type tier: str + :param size: Size specifier of the resource SKU. + :type size: str + :param family: Family code of the resource SKU. + :type family: str + :param capacity: Min, max, and default scale values of the SKU. + :type capacity: ~azure.mgmt.web.v2020_06_01.models.SkuCapacity + :param locations: Locations of the SKU. + :type locations: list[str] + :param capabilities: Capabilities of the SKU, e.g., is traffic manager enabled?. + :type capabilities: list[~azure.mgmt.web.v2020_06_01.models.Capability] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[Capability]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + tier: Optional[str] = None, + size: Optional[str] = None, + family: Optional[str] = None, + capacity: Optional["SkuCapacity"] = None, + locations: Optional[List[str]] = None, + capabilities: Optional[List["Capability"]] = None, + **kwargs + ): + super(GlobalCsmSkuDescription, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.size = size + self.family = family + self.capacity = capacity + self.locations = locations + self.capabilities = capabilities + + +class GlobalValidation(ProxyOnlyResource): + """GlobalValidation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param require_authentication: + :type require_authentication: bool + :param unauthenticated_client_action: Possible values include: "RedirectToLoginPage", + "AllowAnonymous", "Return401", "Return403". + :type unauthenticated_client_action: str or + ~azure.mgmt.web.v2020_06_01.models.UnauthenticatedClientActionV2 + :param redirect_to_provider: + :type redirect_to_provider: str + :param excluded_paths: + :type excluded_paths: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'require_authentication': {'key': 'properties.requireAuthentication', 'type': 'bool'}, + 'unauthenticated_client_action': {'key': 'properties.unauthenticatedClientAction', 'type': 'str'}, + 'redirect_to_provider': {'key': 'properties.redirectToProvider', 'type': 'str'}, + 'excluded_paths': {'key': 'properties.excludedPaths', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + require_authentication: Optional[bool] = None, + unauthenticated_client_action: Optional[Union[str, "UnauthenticatedClientActionV2"]] = None, + redirect_to_provider: Optional[str] = None, + excluded_paths: Optional[List[str]] = None, + **kwargs + ): + super(GlobalValidation, self).__init__(kind=kind, **kwargs) + self.require_authentication = require_authentication + self.unauthenticated_client_action = unauthenticated_client_action + self.redirect_to_provider = redirect_to_provider + self.excluded_paths = excluded_paths + + +class Google(ProxyOnlyResource): + """Google. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_06_01.models.ClientRegistration + :param login: + :type login: ~azure.mgmt.web.v2020_06_01.models.LoginScopes + :param validation: + :type validation: ~azure.mgmt.web.v2020_06_01.models.AllowedAudiencesValidation + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'validation': {'key': 'properties.validation', 'type': 'AllowedAudiencesValidation'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + registration: Optional["ClientRegistration"] = None, + login: Optional["LoginScopes"] = None, + validation: Optional["AllowedAudiencesValidation"] = None, + **kwargs + ): + super(Google, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.registration = registration + self.login = login + self.validation = validation + + +class HandlerMapping(msrest.serialization.Model): + """The IIS handler mappings used to define which handler processes HTTP requests with certain extension. +For example, it is used to configure php-cgi.exe process to handle all HTTP requests with *.php extension. + + :param extension: Requests with this extension will be handled using the specified FastCGI + application. + :type extension: str + :param script_processor: The absolute path to the FastCGI application. + :type script_processor: str + :param arguments: Command-line arguments to be passed to the script processor. + :type arguments: str + """ + + _attribute_map = { + 'extension': {'key': 'extension', 'type': 'str'}, + 'script_processor': {'key': 'scriptProcessor', 'type': 'str'}, + 'arguments': {'key': 'arguments', 'type': 'str'}, + } + + def __init__( + self, + *, + extension: Optional[str] = None, + script_processor: Optional[str] = None, + arguments: Optional[str] = None, + **kwargs + ): + super(HandlerMapping, self).__init__(**kwargs) + self.extension = extension + self.script_processor = script_processor + self.arguments = arguments + + +class HostingEnvironmentDeploymentInfo(msrest.serialization.Model): + """Information needed to create resources on an App Service Environment. + + :param name: Name of the App Service Environment. + :type name: str + :param location: Location of the App Service Environment. + :type 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 + ): + super(HostingEnvironmentDeploymentInfo, self).__init__(**kwargs) + self.name = name + self.location = location + + +class HostingEnvironmentDiagnostics(msrest.serialization.Model): + """Diagnostics for an App Service Environment. + + :param name: Name/identifier of the diagnostics. + :type name: str + :param diagnostics_output: Diagnostics output. + :type diagnostics_output: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'diagnostics_output': {'key': 'diagnosticsOutput', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + diagnostics_output: Optional[str] = None, + **kwargs + ): + super(HostingEnvironmentDiagnostics, self).__init__(**kwargs) + self.name = name + self.diagnostics_output = diagnostics_output + + +class HostingEnvironmentProfile(msrest.serialization.Model): + """Specification for an App Service Environment to use for this resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID of the App Service Environment. + :type id: str + :ivar name: Name of the App Service Environment. + :vartype name: str + :ivar type: Resource type of the App Service Environment. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(HostingEnvironmentProfile, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + + +class HostKeys(msrest.serialization.Model): + """Functions host level keys. + + :param master_key: Secret key. + :type master_key: str + :param function_keys: Host level function keys. + :type function_keys: dict[str, str] + :param system_keys: System keys. + :type system_keys: dict[str, str] + """ + + _attribute_map = { + 'master_key': {'key': 'masterKey', 'type': 'str'}, + 'function_keys': {'key': 'functionKeys', 'type': '{str}'}, + 'system_keys': {'key': 'systemKeys', 'type': '{str}'}, + } + + def __init__( + self, + *, + master_key: Optional[str] = None, + function_keys: Optional[Dict[str, str]] = None, + system_keys: Optional[Dict[str, str]] = None, + **kwargs + ): + super(HostKeys, self).__init__(**kwargs) + self.master_key = master_key + self.function_keys = function_keys + self.system_keys = system_keys + + +class HostName(msrest.serialization.Model): + """Details of a hostname derived from a domain. + + :param name: Name of the hostname. + :type name: str + :param site_names: List of apps the hostname is assigned to. This list will have more than one + app only if the hostname is pointing to a Traffic Manager. + :type site_names: list[str] + :param azure_resource_name: Name of the Azure resource the hostname is assigned to. If it is + assigned to a Traffic Manager then it will be the Traffic Manager name otherwise it will be the + app name. + :type azure_resource_name: str + :param azure_resource_type: Type of the Azure resource the hostname is assigned to. Possible + values include: "Website", "TrafficManager". + :type azure_resource_type: str or ~azure.mgmt.web.v2020_06_01.models.AzureResourceType + :param custom_host_name_dns_record_type: Type of the DNS record. Possible values include: + "CName", "A". + :type custom_host_name_dns_record_type: str or + ~azure.mgmt.web.v2020_06_01.models.CustomHostNameDnsRecordType + :param host_name_type: Type of the hostname. Possible values include: "Verified", "Managed". + :type host_name_type: str or ~azure.mgmt.web.v2020_06_01.models.HostNameType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'site_names': {'key': 'siteNames', 'type': '[str]'}, + 'azure_resource_name': {'key': 'azureResourceName', 'type': 'str'}, + 'azure_resource_type': {'key': 'azureResourceType', 'type': 'str'}, + 'custom_host_name_dns_record_type': {'key': 'customHostNameDnsRecordType', 'type': 'str'}, + 'host_name_type': {'key': 'hostNameType', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + site_names: Optional[List[str]] = None, + azure_resource_name: Optional[str] = None, + azure_resource_type: Optional[Union[str, "AzureResourceType"]] = None, + custom_host_name_dns_record_type: Optional[Union[str, "CustomHostNameDnsRecordType"]] = None, + host_name_type: Optional[Union[str, "HostNameType"]] = None, + **kwargs + ): + super(HostName, self).__init__(**kwargs) + self.name = name + self.site_names = site_names + self.azure_resource_name = azure_resource_name + self.azure_resource_type = azure_resource_type + self.custom_host_name_dns_record_type = custom_host_name_dns_record_type + self.host_name_type = host_name_type + + +class HostNameBinding(ProxyOnlyResource): + """A hostname binding object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param site_name: App Service app name. + :type site_name: str + :param domain_id: Fully qualified ARM domain resource URI. + :type domain_id: str + :param azure_resource_name: Azure resource name. + :type azure_resource_name: str + :param azure_resource_type: Azure resource type. Possible values include: "Website", + "TrafficManager". + :type azure_resource_type: str or ~azure.mgmt.web.v2020_06_01.models.AzureResourceType + :param custom_host_name_dns_record_type: Custom DNS record type. Possible values include: + "CName", "A". + :type custom_host_name_dns_record_type: str or + ~azure.mgmt.web.v2020_06_01.models.CustomHostNameDnsRecordType + :param host_name_type: Hostname type. Possible values include: "Verified", "Managed". + :type host_name_type: str or ~azure.mgmt.web.v2020_06_01.models.HostNameType + :param ssl_state: SSL type. Possible values include: "Disabled", "SniEnabled", + "IpBasedEnabled". + :type ssl_state: str or ~azure.mgmt.web.v2020_06_01.models.SslState + :param thumbprint: SSL certificate thumbprint. + :type thumbprint: str + :ivar virtual_ip: Virtual IP address assigned to the hostname if IP based SSL is enabled. + :vartype virtual_ip: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_ip': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'domain_id': {'key': 'properties.domainId', 'type': 'str'}, + 'azure_resource_name': {'key': 'properties.azureResourceName', 'type': 'str'}, + 'azure_resource_type': {'key': 'properties.azureResourceType', 'type': 'str'}, + 'custom_host_name_dns_record_type': {'key': 'properties.customHostNameDnsRecordType', 'type': 'str'}, + 'host_name_type': {'key': 'properties.hostNameType', 'type': 'str'}, + 'ssl_state': {'key': 'properties.sslState', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'virtual_ip': {'key': 'properties.virtualIP', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + site_name: Optional[str] = None, + domain_id: Optional[str] = None, + azure_resource_name: Optional[str] = None, + azure_resource_type: Optional[Union[str, "AzureResourceType"]] = None, + custom_host_name_dns_record_type: Optional[Union[str, "CustomHostNameDnsRecordType"]] = None, + host_name_type: Optional[Union[str, "HostNameType"]] = None, + ssl_state: Optional[Union[str, "SslState"]] = None, + thumbprint: Optional[str] = None, + **kwargs + ): + super(HostNameBinding, self).__init__(kind=kind, **kwargs) + self.site_name = site_name + self.domain_id = domain_id + self.azure_resource_name = azure_resource_name + self.azure_resource_type = azure_resource_type + self.custom_host_name_dns_record_type = custom_host_name_dns_record_type + self.host_name_type = host_name_type + self.ssl_state = ssl_state + self.thumbprint = thumbprint + self.virtual_ip = None + + +class HostNameBindingCollection(msrest.serialization.Model): + """Collection of hostname bindings. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.HostNameBinding] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HostNameBinding]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["HostNameBinding"], + **kwargs + ): + super(HostNameBindingCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class HostNameSslState(msrest.serialization.Model): + """SSL-enabled hostname. + + :param name: Hostname. + :type name: str + :param ssl_state: SSL type. Possible values include: "Disabled", "SniEnabled", + "IpBasedEnabled". + :type ssl_state: str or ~azure.mgmt.web.v2020_06_01.models.SslState + :param virtual_ip: Virtual IP address assigned to the hostname if IP based SSL is enabled. + :type virtual_ip: str + :param thumbprint: SSL certificate thumbprint. + :type thumbprint: str + :param to_update: Set to :code:`true` to update existing hostname. + :type to_update: bool + :param host_type: Indicates whether the hostname is a standard or repository hostname. Possible + values include: "Standard", "Repository". + :type host_type: str or ~azure.mgmt.web.v2020_06_01.models.HostType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'ssl_state': {'key': 'sslState', 'type': 'str'}, + 'virtual_ip': {'key': 'virtualIP', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'to_update': {'key': 'toUpdate', 'type': 'bool'}, + 'host_type': {'key': 'hostType', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + ssl_state: Optional[Union[str, "SslState"]] = None, + virtual_ip: Optional[str] = None, + thumbprint: Optional[str] = None, + to_update: Optional[bool] = None, + host_type: Optional[Union[str, "HostType"]] = None, + **kwargs + ): + super(HostNameSslState, self).__init__(**kwargs) + self.name = name + self.ssl_state = ssl_state + self.virtual_ip = virtual_ip + self.thumbprint = thumbprint + self.to_update = to_update + self.host_type = host_type + + +class HttpLogsConfig(msrest.serialization.Model): + """Http logs configuration. + + :param file_system: Http logs to file system configuration. + :type file_system: ~azure.mgmt.web.v2020_06_01.models.FileSystemHttpLogsConfig + :param azure_blob_storage: Http logs to azure blob storage configuration. + :type azure_blob_storage: ~azure.mgmt.web.v2020_06_01.models.AzureBlobStorageHttpLogsConfig + """ + + _attribute_map = { + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemHttpLogsConfig'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'AzureBlobStorageHttpLogsConfig'}, + } + + def __init__( + self, + *, + file_system: Optional["FileSystemHttpLogsConfig"] = None, + azure_blob_storage: Optional["AzureBlobStorageHttpLogsConfig"] = None, + **kwargs + ): + super(HttpLogsConfig, self).__init__(**kwargs) + self.file_system = file_system + self.azure_blob_storage = azure_blob_storage + + +class HttpSettings(ProxyOnlyResource): + """HttpSettings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param require_https: + :type require_https: bool + :param routes: + :type routes: ~azure.mgmt.web.v2020_06_01.models.HttpSettingsRoutes + :param forward_proxy: + :type forward_proxy: ~azure.mgmt.web.v2020_06_01.models.ForwardProxy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'require_https': {'key': 'properties.requireHttps', 'type': 'bool'}, + 'routes': {'key': 'properties.routes', 'type': 'HttpSettingsRoutes'}, + 'forward_proxy': {'key': 'properties.forwardProxy', 'type': 'ForwardProxy'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + require_https: Optional[bool] = None, + routes: Optional["HttpSettingsRoutes"] = None, + forward_proxy: Optional["ForwardProxy"] = None, + **kwargs + ): + super(HttpSettings, self).__init__(kind=kind, **kwargs) + self.require_https = require_https + self.routes = routes + self.forward_proxy = forward_proxy + + +class HttpSettingsRoutes(ProxyOnlyResource): + """HttpSettingsRoutes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param api_prefix: + :type api_prefix: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'api_prefix': {'key': 'properties.apiPrefix', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + api_prefix: Optional[str] = None, + **kwargs + ): + super(HttpSettingsRoutes, self).__init__(kind=kind, **kwargs) + self.api_prefix = api_prefix + + +class HybridConnection(ProxyOnlyResource): + """Hybrid Connection contract. This is used to configure a Hybrid Connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param service_bus_namespace: The name of the Service Bus namespace. + :type service_bus_namespace: str + :param relay_name: The name of the Service Bus relay. + :type relay_name: str + :param relay_arm_uri: The ARM URI to the Service Bus relay. + :type relay_arm_uri: str + :param hostname: The hostname of the endpoint. + :type hostname: str + :param port: The port of the endpoint. + :type port: int + :param send_key_name: The name of the Service Bus key which has Send permissions. This is used + to authenticate to Service Bus. + :type send_key_name: str + :param send_key_value: The value of the Service Bus key. This is used to authenticate to + Service Bus. In ARM this key will not be returned + normally, use the POST /listKeys API instead. + :type send_key_value: str + :param service_bus_suffix: The suffix for the service bus endpoint. By default this is + .servicebus.windows.net. + :type service_bus_suffix: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'service_bus_namespace': {'key': 'properties.serviceBusNamespace', 'type': 'str'}, + 'relay_name': {'key': 'properties.relayName', 'type': 'str'}, + 'relay_arm_uri': {'key': 'properties.relayArmUri', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'send_key_name': {'key': 'properties.sendKeyName', 'type': 'str'}, + 'send_key_value': {'key': 'properties.sendKeyValue', 'type': 'str'}, + 'service_bus_suffix': {'key': 'properties.serviceBusSuffix', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + service_bus_namespace: Optional[str] = None, + relay_name: Optional[str] = None, + relay_arm_uri: Optional[str] = None, + hostname: Optional[str] = None, + port: Optional[int] = None, + send_key_name: Optional[str] = None, + send_key_value: Optional[str] = None, + service_bus_suffix: Optional[str] = None, + **kwargs + ): + super(HybridConnection, self).__init__(kind=kind, **kwargs) + self.service_bus_namespace = service_bus_namespace + self.relay_name = relay_name + self.relay_arm_uri = relay_arm_uri + self.hostname = hostname + self.port = port + self.send_key_name = send_key_name + self.send_key_value = send_key_value + self.service_bus_suffix = service_bus_suffix + + +class HybridConnectionCollection(msrest.serialization.Model): + """Collection of hostname bindings. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.HybridConnection] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HybridConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["HybridConnection"], + **kwargs + ): + super(HybridConnectionCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class HybridConnectionKey(ProxyOnlyResource): + """Hybrid Connection key contract. This has the send key name and value for a Hybrid Connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar send_key_name: The name of the send key. + :vartype send_key_name: str + :ivar send_key_value: The value of the send key. + :vartype send_key_value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'send_key_name': {'readonly': True}, + 'send_key_value': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'send_key_name': {'key': 'properties.sendKeyName', 'type': 'str'}, + 'send_key_value': {'key': 'properties.sendKeyValue', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(HybridConnectionKey, self).__init__(kind=kind, **kwargs) + self.send_key_name = None + self.send_key_value = None + + +class HybridConnectionLimits(ProxyOnlyResource): + """Hybrid Connection limits contract. This is used to return the plan limits of Hybrid Connections. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar current: The current number of Hybrid Connections. + :vartype current: int + :ivar maximum: The maximum number of Hybrid Connections allowed. + :vartype maximum: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'current': {'readonly': True}, + 'maximum': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'current': {'key': 'properties.current', 'type': 'int'}, + 'maximum': {'key': 'properties.maximum', 'type': 'int'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(HybridConnectionLimits, self).__init__(kind=kind, **kwargs) + self.current = None + self.maximum = None + + +class Identifier(ProxyOnlyResource): + """A domain specific resource identifier. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param value: String representation of the identity. + :type value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'properties.id', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(Identifier, self).__init__(kind=kind, **kwargs) + self.value = value + + +class IdentifierCollection(msrest.serialization.Model): + """Collection of identifiers. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.Identifier] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Identifier]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Identifier"], + **kwargs + ): + super(IdentifierCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class IdentityProviders(ProxyOnlyResource): + """IdentityProviders. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param azure_active_directory: + :type azure_active_directory: ~azure.mgmt.web.v2020_06_01.models.AzureActiveDirectory + :param facebook: + :type facebook: ~azure.mgmt.web.v2020_06_01.models.Facebook + :param git_hub: + :type git_hub: ~azure.mgmt.web.v2020_06_01.models.GitHub + :param google: + :type google: ~azure.mgmt.web.v2020_06_01.models.Google + :param twitter: + :type twitter: ~azure.mgmt.web.v2020_06_01.models.Twitter + :param custom_open_id_connect_providers: Dictionary of :code:``. + :type custom_open_id_connect_providers: dict[str, + ~azure.mgmt.web.v2020_06_01.models.CustomOpenIdConnectProvider] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'azure_active_directory': {'key': 'properties.azureActiveDirectory', 'type': 'AzureActiveDirectory'}, + 'facebook': {'key': 'properties.facebook', 'type': 'Facebook'}, + 'git_hub': {'key': 'properties.gitHub', 'type': 'GitHub'}, + 'google': {'key': 'properties.google', 'type': 'Google'}, + 'twitter': {'key': 'properties.twitter', 'type': 'Twitter'}, + 'custom_open_id_connect_providers': {'key': 'properties.customOpenIdConnectProviders', 'type': '{CustomOpenIdConnectProvider}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + azure_active_directory: Optional["AzureActiveDirectory"] = None, + facebook: Optional["Facebook"] = None, + git_hub: Optional["GitHub"] = None, + google: Optional["Google"] = None, + twitter: Optional["Twitter"] = None, + custom_open_id_connect_providers: Optional[Dict[str, "CustomOpenIdConnectProvider"]] = None, + **kwargs + ): + super(IdentityProviders, self).__init__(kind=kind, **kwargs) + self.azure_active_directory = azure_active_directory + self.facebook = facebook + self.git_hub = git_hub + self.google = google + self.twitter = twitter + self.custom_open_id_connect_providers = custom_open_id_connect_providers + + +class InboundEnvironmentEndpoint(msrest.serialization.Model): + """The IP Addresses and Ports that require inbound network access to and within the subnet of the App Service Environment. + + :param description: Short text describing the purpose of the network traffic. + :type description: str + :param endpoints: The IP addresses that network traffic will originate from in cidr notation. + :type endpoints: list[str] + :param ports: The ports that network traffic will arrive to the App Service Environment at. + :type ports: list[str] + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[str]'}, + 'ports': {'key': 'ports', 'type': '[str]'}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + endpoints: Optional[List[str]] = None, + ports: Optional[List[str]] = None, + **kwargs + ): + super(InboundEnvironmentEndpoint, self).__init__(**kwargs) + self.description = description + self.endpoints = endpoints + self.ports = ports + + +class InboundEnvironmentEndpointCollection(msrest.serialization.Model): + """Collection of Inbound Environment Endpoints. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.InboundEnvironmentEndpoint] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InboundEnvironmentEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["InboundEnvironmentEndpoint"], + **kwargs + ): + super(InboundEnvironmentEndpointCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class IpSecurityRestriction(msrest.serialization.Model): + """IP security restriction on an app. + + :param ip_address: IP address the security restriction is valid for. + It can be in form of pure ipv4 address (required SubnetMask property) or + CIDR notation such as ipv4/mask (leading bit match). For CIDR, + SubnetMask property must not be specified. + :type ip_address: str + :param subnet_mask: Subnet mask for the range of IP addresses the restriction is valid for. + :type subnet_mask: str + :param vnet_subnet_resource_id: Virtual network resource id. + :type vnet_subnet_resource_id: str + :param vnet_traffic_tag: (internal) Vnet traffic tag. + :type vnet_traffic_tag: int + :param subnet_traffic_tag: (internal) Subnet traffic tag. + :type subnet_traffic_tag: int + :param action: Allow or Deny access for this IP range. + :type action: str + :param tag: Defines what this IP filter will be used for. This is to support IP filtering on + proxies. Possible values include: "Default", "XffProxy", "ServiceTag". + :type tag: str or ~azure.mgmt.web.v2020_06_01.models.IpFilterTag + :param priority: Priority of IP restriction rule. + :type priority: int + :param name: IP restriction rule name. + :type name: str + :param description: IP restriction rule description. + :type description: str + :param headers: IP restriction rule headers. + X-Forwarded-Host (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded- + Host#Examples). + The matching logic is .. + + + * If the property is null or empty (default), all hosts(or lack of) are allowed. + * A value is compared using ordinal-ignore-case (excluding port number). + * Subdomain wildcards are permitted but don't match the root domain. For example, + *.contoso.com matches the subdomain foo.contoso.com + but not the root domain contoso.com or multi-level foo.bar.contoso.com + * Unicode host names are allowed but are converted to Punycode for matching. + + X-Forwarded-For (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded- + For#Examples). + The matching logic is .. + + + * If the property is null or empty (default), any forwarded-for chains (or lack of) are + allowed. + * If any address (excluding port number) in the chain (comma separated) matches the CIDR + defined by the property. + + X-Azure-FDID and X-FD-HealthProbe. + The matching logic is exact match. + :type headers: dict[str, list[str]] + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet_mask': {'key': 'subnetMask', 'type': 'str'}, + 'vnet_subnet_resource_id': {'key': 'vnetSubnetResourceId', 'type': 'str'}, + 'vnet_traffic_tag': {'key': 'vnetTrafficTag', 'type': 'int'}, + 'subnet_traffic_tag': {'key': 'subnetTrafficTag', 'type': 'int'}, + 'action': {'key': 'action', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '{[str]}'}, + } + + def __init__( + self, + *, + ip_address: Optional[str] = None, + subnet_mask: Optional[str] = None, + vnet_subnet_resource_id: Optional[str] = None, + vnet_traffic_tag: Optional[int] = None, + subnet_traffic_tag: Optional[int] = None, + action: Optional[str] = None, + tag: Optional[Union[str, "IpFilterTag"]] = None, + priority: Optional[int] = None, + name: Optional[str] = None, + description: Optional[str] = None, + headers: Optional[Dict[str, List[str]]] = None, + **kwargs + ): + super(IpSecurityRestriction, self).__init__(**kwargs) + self.ip_address = ip_address + self.subnet_mask = subnet_mask + self.vnet_subnet_resource_id = vnet_subnet_resource_id + self.vnet_traffic_tag = vnet_traffic_tag + self.subnet_traffic_tag = subnet_traffic_tag + self.action = action + self.tag = tag + self.priority = priority + self.name = name + self.description = description + self.headers = headers + + +class JwtClaimChecks(ProxyOnlyResource): + """JwtClaimChecks. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param allowed_groups: + :type allowed_groups: list[str] + :param allowed_client_applications: + :type allowed_client_applications: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'allowed_groups': {'key': 'properties.allowedGroups', 'type': '[str]'}, + 'allowed_client_applications': {'key': 'properties.allowedClientApplications', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + allowed_groups: Optional[List[str]] = None, + allowed_client_applications: Optional[List[str]] = None, + **kwargs + ): + super(JwtClaimChecks, self).__init__(kind=kind, **kwargs) + self.allowed_groups = allowed_groups + self.allowed_client_applications = allowed_client_applications + + +class KeyInfo(msrest.serialization.Model): + """Function key info. + + :param name: Key name. + :type name: str + :param value: Key value. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(KeyInfo, self).__init__(**kwargs) + self.name = name + self.value = value + + +class LocalizableString(msrest.serialization.Model): + """Localizable string object containing the name and a localized value. + + :param value: Non-localized name. + :type value: str + :param localized_value: Localized name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[str] = None, + localized_value: Optional[str] = None, + **kwargs + ): + super(LocalizableString, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value + + +class Login(ProxyOnlyResource): + """Login. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param routes: + :type routes: ~azure.mgmt.web.v2020_06_01.models.LoginRoutes + :param token_store: + :type token_store: ~azure.mgmt.web.v2020_06_01.models.TokenStore + :param preserve_url_fragments_for_logins: + :type preserve_url_fragments_for_logins: bool + :param allowed_external_redirect_urls: + :type allowed_external_redirect_urls: list[str] + :param cookie_expiration: + :type cookie_expiration: ~azure.mgmt.web.v2020_06_01.models.CookieExpiration + :param nonce: + :type nonce: ~azure.mgmt.web.v2020_06_01.models.Nonce + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'routes': {'key': 'properties.routes', 'type': 'LoginRoutes'}, + 'token_store': {'key': 'properties.tokenStore', 'type': 'TokenStore'}, + 'preserve_url_fragments_for_logins': {'key': 'properties.preserveUrlFragmentsForLogins', 'type': 'bool'}, + 'allowed_external_redirect_urls': {'key': 'properties.allowedExternalRedirectUrls', 'type': '[str]'}, + 'cookie_expiration': {'key': 'properties.cookieExpiration', 'type': 'CookieExpiration'}, + 'nonce': {'key': 'properties.nonce', 'type': 'Nonce'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + routes: Optional["LoginRoutes"] = None, + token_store: Optional["TokenStore"] = None, + preserve_url_fragments_for_logins: Optional[bool] = None, + allowed_external_redirect_urls: Optional[List[str]] = None, + cookie_expiration: Optional["CookieExpiration"] = None, + nonce: Optional["Nonce"] = None, + **kwargs + ): + super(Login, self).__init__(kind=kind, **kwargs) + self.routes = routes + self.token_store = token_store + self.preserve_url_fragments_for_logins = preserve_url_fragments_for_logins + self.allowed_external_redirect_urls = allowed_external_redirect_urls + self.cookie_expiration = cookie_expiration + self.nonce = nonce + + +class LoginRoutes(ProxyOnlyResource): + """LoginRoutes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param logout_endpoint: + :type logout_endpoint: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'logout_endpoint': {'key': 'properties.logoutEndpoint', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + logout_endpoint: Optional[str] = None, + **kwargs + ): + super(LoginRoutes, self).__init__(kind=kind, **kwargs) + self.logout_endpoint = logout_endpoint + + +class LoginScopes(ProxyOnlyResource): + """LoginScopes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param scopes: + :type scopes: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + scopes: Optional[List[str]] = None, + **kwargs + ): + super(LoginScopes, self).__init__(kind=kind, **kwargs) + self.scopes = scopes + + +class LogSpecification(msrest.serialization.Model): + """Log Definition of a single resource metric. + + :param name: + :type name: str + :param display_name: + :type display_name: str + :param blob_duration: + :type blob_duration: str + :param log_filter_pattern: + :type log_filter_pattern: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + 'log_filter_pattern': {'key': 'logFilterPattern', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + blob_duration: Optional[str] = None, + log_filter_pattern: Optional[str] = None, + **kwargs + ): + super(LogSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.blob_duration = blob_duration + self.log_filter_pattern = log_filter_pattern + + +class ManagedServiceIdentity(msrest.serialization.Model): + """Managed service identity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Type of managed service identity. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type: str or ~azure.mgmt.web.v2020_06_01.models.ManagedServiceIdentityType + :ivar tenant_id: Tenant of managed service identity. + :vartype tenant_id: str + :ivar principal_id: Principal Id of managed service identity. + :vartype principal_id: str + :param user_assigned_identities: The list of user assigned identities associated with the + resource. The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + :type user_assigned_identities: dict[str, + ~azure.mgmt.web.v2020_06_01.models.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties] + """ + + _validation = { + 'tenant_id': {'readonly': True}, + 'principal_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "ManagedServiceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + **kwargs + ): + super(ManagedServiceIdentity, self).__init__(**kwargs) + self.type = type + self.tenant_id = None + self.principal_id = None + self.user_assigned_identities = user_assigned_identities + + +class MetricAvailability(msrest.serialization.Model): + """Retention policy of a resource metric. + + :param time_grain: + :type time_grain: str + :param blob_duration: + :type blob_duration: str + """ + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__( + self, + *, + time_grain: Optional[str] = None, + blob_duration: Optional[str] = None, + **kwargs + ): + super(MetricAvailability, self).__init__(**kwargs) + self.time_grain = time_grain + self.blob_duration = blob_duration + + +class MetricSpecification(msrest.serialization.Model): + """Definition of a single resource metric. + + :param name: + :type name: str + :param display_name: + :type display_name: str + :param display_description: + :type display_description: str + :param unit: + :type unit: str + :param aggregation_type: + :type aggregation_type: str + :param supports_instance_level_aggregation: + :type supports_instance_level_aggregation: bool + :param enable_regional_mdm_account: + :type enable_regional_mdm_account: bool + :param source_mdm_account: + :type source_mdm_account: str + :param source_mdm_namespace: + :type source_mdm_namespace: str + :param metric_filter_pattern: + :type metric_filter_pattern: str + :param fill_gap_with_zero: + :type fill_gap_with_zero: bool + :param is_internal: + :type is_internal: bool + :param dimensions: + :type dimensions: list[~azure.mgmt.web.v2020_06_01.models.Dimension] + :param category: + :type category: str + :param availabilities: + :type availabilities: list[~azure.mgmt.web.v2020_06_01.models.MetricAvailability] + :param supported_time_grain_types: + :type supported_time_grain_types: list[str] + :param supported_aggregation_types: + :type supported_aggregation_types: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'supports_instance_level_aggregation': {'key': 'supportsInstanceLevelAggregation', 'type': 'bool'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'bool'}, + 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'metric_filter_pattern': {'key': 'metricFilterPattern', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'is_internal': {'key': 'isInternal', 'type': 'bool'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'category': {'key': 'category', 'type': 'str'}, + 'availabilities': {'key': 'availabilities', 'type': '[MetricAvailability]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + display_description: Optional[str] = None, + unit: Optional[str] = None, + aggregation_type: Optional[str] = None, + supports_instance_level_aggregation: Optional[bool] = None, + enable_regional_mdm_account: Optional[bool] = None, + source_mdm_account: Optional[str] = None, + source_mdm_namespace: Optional[str] = None, + metric_filter_pattern: Optional[str] = None, + fill_gap_with_zero: Optional[bool] = None, + is_internal: Optional[bool] = None, + dimensions: Optional[List["Dimension"]] = None, + category: Optional[str] = None, + availabilities: Optional[List["MetricAvailability"]] = None, + supported_time_grain_types: Optional[List[str]] = None, + supported_aggregation_types: Optional[List[str]] = None, + **kwargs + ): + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.supports_instance_level_aggregation = supports_instance_level_aggregation + self.enable_regional_mdm_account = enable_regional_mdm_account + self.source_mdm_account = source_mdm_account + self.source_mdm_namespace = source_mdm_namespace + self.metric_filter_pattern = metric_filter_pattern + self.fill_gap_with_zero = fill_gap_with_zero + self.is_internal = is_internal + self.dimensions = dimensions + self.category = category + self.availabilities = availabilities + self.supported_time_grain_types = supported_time_grain_types + self.supported_aggregation_types = supported_aggregation_types + + +class MigrateMySqlRequest(ProxyOnlyResource): + """MySQL migration request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param connection_string: Connection string to the remote MySQL database. + :type connection_string: str + :param migration_type: The type of migration operation to be done. Possible values include: + "LocalToRemote", "RemoteToLocal". + :type migration_type: str or ~azure.mgmt.web.v2020_06_01.models.MySqlMigrationType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'migration_type': {'key': 'properties.migrationType', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + connection_string: Optional[str] = None, + migration_type: Optional[Union[str, "MySqlMigrationType"]] = None, + **kwargs + ): + super(MigrateMySqlRequest, self).__init__(kind=kind, **kwargs) + self.connection_string = connection_string + self.migration_type = migration_type + + +class MigrateMySqlStatus(ProxyOnlyResource): + """MySQL migration status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar migration_operation_status: Status of the migration task. Possible values include: + "InProgress", "Failed", "Succeeded", "TimedOut", "Created". + :vartype migration_operation_status: str or ~azure.mgmt.web.v2020_06_01.models.OperationStatus + :ivar operation_id: Operation ID for the migration task. + :vartype operation_id: str + :ivar local_my_sql_enabled: True if the web app has in app MySql enabled. + :vartype local_my_sql_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'migration_operation_status': {'readonly': True}, + 'operation_id': {'readonly': True}, + 'local_my_sql_enabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'migration_operation_status': {'key': 'properties.migrationOperationStatus', 'type': 'str'}, + 'operation_id': {'key': 'properties.operationId', 'type': 'str'}, + 'local_my_sql_enabled': {'key': 'properties.localMySqlEnabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(MigrateMySqlStatus, self).__init__(kind=kind, **kwargs) + self.migration_operation_status = None + self.operation_id = None + self.local_my_sql_enabled = None + + +class MSDeploy(ProxyOnlyResource): + """MSDeploy ARM PUT information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param package_uri: Package URI. + :type package_uri: str + :param connection_string: SQL Connection String. + :type connection_string: str + :param db_type: Database Type. + :type db_type: str + :param set_parameters_xml_file_uri: URI of MSDeploy Parameters file. Must not be set if + SetParameters is used. + :type set_parameters_xml_file_uri: str + :param set_parameters: MSDeploy Parameters. Must not be set if SetParametersXmlFileUri is used. + :type set_parameters: dict[str, str] + :param skip_app_data: Controls whether the MSDeploy operation skips the App_Data directory. + If set to :code:`true`, the existing App_Data directory on the destination + will not be deleted, and any App_Data directory in the source will be ignored. + Setting is :code:`false` by default. + :type skip_app_data: bool + :param app_offline: Sets the AppOffline rule while the MSDeploy operation executes. + Setting is :code:`false` by default. + :type app_offline: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'package_uri': {'key': 'properties.packageUri', 'type': 'str'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'db_type': {'key': 'properties.dbType', 'type': 'str'}, + 'set_parameters_xml_file_uri': {'key': 'properties.setParametersXmlFileUri', 'type': 'str'}, + 'set_parameters': {'key': 'properties.setParameters', 'type': '{str}'}, + 'skip_app_data': {'key': 'properties.skipAppData', 'type': 'bool'}, + 'app_offline': {'key': 'properties.appOffline', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + package_uri: Optional[str] = None, + connection_string: Optional[str] = None, + db_type: Optional[str] = None, + set_parameters_xml_file_uri: Optional[str] = None, + set_parameters: Optional[Dict[str, str]] = None, + skip_app_data: Optional[bool] = None, + app_offline: Optional[bool] = None, + **kwargs + ): + super(MSDeploy, self).__init__(kind=kind, **kwargs) + self.package_uri = package_uri + self.connection_string = connection_string + self.db_type = db_type + self.set_parameters_xml_file_uri = set_parameters_xml_file_uri + self.set_parameters = set_parameters + self.skip_app_data = skip_app_data + self.app_offline = app_offline + + +class MSDeployLog(ProxyOnlyResource): + """MSDeploy log. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar entries: List of log entry messages. + :vartype entries: list[~azure.mgmt.web.v2020_06_01.models.MSDeployLogEntry] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'entries': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'entries': {'key': 'properties.entries', 'type': '[MSDeployLogEntry]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(MSDeployLog, self).__init__(kind=kind, **kwargs) + self.entries = None + + +class MSDeployLogEntry(msrest.serialization.Model): + """MSDeploy log entry. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar time: Timestamp of log entry. + :vartype time: ~datetime.datetime + :ivar type: Log entry type. Possible values include: "Message", "Warning", "Error". + :vartype type: str or ~azure.mgmt.web.v2020_06_01.models.MSDeployLogEntryType + :ivar message: Log entry message. + :vartype message: str + """ + + _validation = { + 'time': {'readonly': True}, + 'type': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MSDeployLogEntry, self).__init__(**kwargs) + self.time = None + self.type = None + self.message = None + + +class MSDeployStatus(ProxyOnlyResource): + """MSDeploy ARM response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar deployer: Username of deployer. + :vartype deployer: str + :ivar provisioning_state: Provisioning state. Possible values include: "accepted", "running", + "succeeded", "failed", "canceled". + :vartype provisioning_state: str or + ~azure.mgmt.web.v2020_06_01.models.MSDeployProvisioningState + :ivar start_time: Start time of deploy operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: End time of deploy operation. + :vartype end_time: ~datetime.datetime + :ivar complete: Whether the deployment operation has completed. + :vartype complete: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'deployer': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'complete': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'deployer': {'key': 'properties.deployer', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'complete': {'key': 'properties.complete', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(MSDeployStatus, self).__init__(kind=kind, **kwargs) + self.deployer = None + self.provisioning_state = None + self.start_time = None + self.end_time = None + self.complete = None + + +class NameIdentifier(msrest.serialization.Model): + """Identifies an object. + + :param name: Name of the object. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + **kwargs + ): + super(NameIdentifier, self).__init__(**kwargs) + self.name = name + + +class NameIdentifierCollection(msrest.serialization.Model): + """Collection of domain name identifiers. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.NameIdentifier] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NameIdentifier]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["NameIdentifier"], + **kwargs + ): + super(NameIdentifierCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class NameValuePair(msrest.serialization.Model): + """Name value pair. + + :param name: Pair name. + :type name: str + :param value: Pair value. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(NameValuePair, self).__init__(**kwargs) + self.name = name + self.value = value + + +class NetworkAccessControlEntry(msrest.serialization.Model): + """Network access control entry. + + :param action: Action object. Possible values include: "Permit", "Deny". + :type action: str or ~azure.mgmt.web.v2020_06_01.models.AccessControlEntryAction + :param description: Description of network access control entry. + :type description: str + :param order: Order of precedence. + :type order: int + :param remote_subnet: Remote subnet. + :type remote_subnet: str + """ + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'int'}, + 'remote_subnet': {'key': 'remoteSubnet', 'type': 'str'}, + } + + def __init__( + self, + *, + action: Optional[Union[str, "AccessControlEntryAction"]] = None, + description: Optional[str] = None, + order: Optional[int] = None, + remote_subnet: Optional[str] = None, + **kwargs + ): + super(NetworkAccessControlEntry, self).__init__(**kwargs) + self.action = action + self.description = description + self.order = order + self.remote_subnet = remote_subnet + + +class NetworkFeatures(ProxyOnlyResource): + """Full view of network features for an app (presently VNET integration and Hybrid Connections). + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar virtual_network_name: The Virtual Network name. + :vartype virtual_network_name: str + :ivar virtual_network_connection: The Virtual Network summary view. + :vartype virtual_network_connection: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :ivar hybrid_connections: The Hybrid Connections summary view. + :vartype hybrid_connections: + list[~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity] + :ivar hybrid_connections_v2: The Hybrid Connection V2 (Service Bus) view. + :vartype hybrid_connections_v2: list[~azure.mgmt.web.v2020_06_01.models.HybridConnection] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_name': {'readonly': True}, + 'virtual_network_connection': {'readonly': True}, + 'hybrid_connections': {'readonly': True}, + 'hybrid_connections_v2': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'virtual_network_name': {'key': 'properties.virtualNetworkName', 'type': 'str'}, + 'virtual_network_connection': {'key': 'properties.virtualNetworkConnection', 'type': 'VnetInfo'}, + 'hybrid_connections': {'key': 'properties.hybridConnections', 'type': '[RelayServiceConnectionEntity]'}, + 'hybrid_connections_v2': {'key': 'properties.hybridConnectionsV2', 'type': '[HybridConnection]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(NetworkFeatures, self).__init__(kind=kind, **kwargs) + self.virtual_network_name = None + self.virtual_network_connection = None + self.hybrid_connections = None + self.hybrid_connections_v2 = None + + +class NetworkTrace(msrest.serialization.Model): + """Network trace. + + :param path: Local file path for the captured network trace file. + :type path: str + :param status: Current status of the network trace operation, same as Operation.Status + (InProgress/Succeeded/Failed). + :type status: str + :param message: Detailed message of a network trace operation, e.g. error message in case of + failure. + :type message: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + path: Optional[str] = None, + status: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(NetworkTrace, self).__init__(**kwargs) + self.path = path + self.status = status + self.message = message + + +class Nonce(ProxyOnlyResource): + """Nonce. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param validate_nonce: + :type validate_nonce: bool + :param nonce_expiration_interval: + :type nonce_expiration_interval: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'validate_nonce': {'key': 'properties.validateNonce', 'type': 'bool'}, + 'nonce_expiration_interval': {'key': 'properties.nonceExpirationInterval', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + validate_nonce: Optional[bool] = None, + nonce_expiration_interval: Optional[str] = None, + **kwargs + ): + super(Nonce, self).__init__(kind=kind, **kwargs) + self.validate_nonce = validate_nonce + self.nonce_expiration_interval = nonce_expiration_interval + + +class OpenIdConnectClientCredential(ProxyOnlyResource): + """OpenIdConnectClientCredential. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar method: Default value: "ClientSecretPost". + :vartype method: str + :param client_secret_setting_name: + :type client_secret_setting_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'method': {'constant': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'method': {'key': 'properties.method', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + } + + method = "ClientSecretPost" + + def __init__( + self, + *, + kind: Optional[str] = None, + client_secret_setting_name: Optional[str] = None, + **kwargs + ): + super(OpenIdConnectClientCredential, self).__init__(kind=kind, **kwargs) + self.client_secret_setting_name = client_secret_setting_name + + +class OpenIdConnectConfig(ProxyOnlyResource): + """OpenIdConnectConfig. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param authorization_endpoint: + :type authorization_endpoint: str + :param token_endpoint: + :type token_endpoint: str + :param issuer: + :type issuer: str + :param certification_uri: + :type certification_uri: str + :param well_known_open_id_configuration: + :type well_known_open_id_configuration: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'authorization_endpoint': {'key': 'properties.authorizationEndpoint', 'type': 'str'}, + 'token_endpoint': {'key': 'properties.tokenEndpoint', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'certification_uri': {'key': 'properties.certificationUri', 'type': 'str'}, + 'well_known_open_id_configuration': {'key': 'properties.wellKnownOpenIdConfiguration', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + authorization_endpoint: Optional[str] = None, + token_endpoint: Optional[str] = None, + issuer: Optional[str] = None, + certification_uri: Optional[str] = None, + well_known_open_id_configuration: Optional[str] = None, + **kwargs + ): + super(OpenIdConnectConfig, self).__init__(kind=kind, **kwargs) + self.authorization_endpoint = authorization_endpoint + self.token_endpoint = token_endpoint + self.issuer = issuer + self.certification_uri = certification_uri + self.well_known_open_id_configuration = well_known_open_id_configuration + + +class OpenIdConnectLogin(ProxyOnlyResource): + """OpenIdConnectLogin. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param name_claim_type: + :type name_claim_type: str + :param scopes: + :type scopes: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name_claim_type': {'key': 'properties.nameClaimType', 'type': 'str'}, + 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + name_claim_type: Optional[str] = None, + scopes: Optional[List[str]] = None, + **kwargs + ): + super(OpenIdConnectLogin, self).__init__(kind=kind, **kwargs) + self.name_claim_type = name_claim_type + self.scopes = scopes + + +class OpenIdConnectRegistration(ProxyOnlyResource): + """OpenIdConnectRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param client_id: + :type client_id: str + :param client_credential: + :type client_credential: ~azure.mgmt.web.v2020_06_01.models.OpenIdConnectClientCredential + :param open_id_connect_configuration: + :type open_id_connect_configuration: ~azure.mgmt.web.v2020_06_01.models.OpenIdConnectConfig + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_credential': {'key': 'properties.clientCredential', 'type': 'OpenIdConnectClientCredential'}, + 'open_id_connect_configuration': {'key': 'properties.openIdConnectConfiguration', 'type': 'OpenIdConnectConfig'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + client_id: Optional[str] = None, + client_credential: Optional["OpenIdConnectClientCredential"] = None, + open_id_connect_configuration: Optional["OpenIdConnectConfig"] = None, + **kwargs + ): + super(OpenIdConnectRegistration, self).__init__(kind=kind, **kwargs) + self.client_id = client_id + self.client_credential = client_credential + self.open_id_connect_configuration = open_id_connect_configuration + + +class Operation(msrest.serialization.Model): + """An operation on a resource. + + :param id: Operation ID. + :type id: str + :param name: Operation name. + :type name: str + :param status: The current status of the operation. Possible values include: "InProgress", + "Failed", "Succeeded", "TimedOut", "Created". + :type status: str or ~azure.mgmt.web.v2020_06_01.models.OperationStatus + :param errors: Any errors associate with the operation. + :type errors: list[~azure.mgmt.web.v2020_06_01.models.ErrorEntity] + :param created_time: Time when operation has started. + :type created_time: ~datetime.datetime + :param modified_time: Time when operation has been updated. + :type modified_time: ~datetime.datetime + :param expiration_time: Time when operation will expire. + :type expiration_time: ~datetime.datetime + :param geo_master_operation_id: Applicable only for stamp operation ids. + :type geo_master_operation_id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[ErrorEntity]'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'modified_time': {'key': 'modifiedTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'expirationTime', 'type': 'iso-8601'}, + 'geo_master_operation_id': {'key': 'geoMasterOperationId', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + status: Optional[Union[str, "OperationStatus"]] = None, + errors: Optional[List["ErrorEntity"]] = None, + created_time: Optional[datetime.datetime] = None, + modified_time: Optional[datetime.datetime] = None, + expiration_time: Optional[datetime.datetime] = None, + geo_master_operation_id: Optional[str] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.id = id + self.name = name + self.status = status + self.errors = errors + self.created_time = created_time + self.modified_time = modified_time + self.expiration_time = expiration_time + self.geo_master_operation_id = geo_master_operation_id + + +class OutboundEnvironmentEndpoint(msrest.serialization.Model): + """Endpoints accessed for a common purpose that the App Service Environment requires outbound network access to. + + :param category: The type of service accessed by the App Service Environment, e.g., Azure + Storage, Azure SQL Database, and Azure Active Directory. + :type category: str + :param endpoints: The endpoints that the App Service Environment reaches the service at. + :type endpoints: list[~azure.mgmt.web.v2020_06_01.models.EndpointDependency] + """ + + _attribute_map = { + 'category': {'key': 'category', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[EndpointDependency]'}, + } + + def __init__( + self, + *, + category: Optional[str] = None, + endpoints: Optional[List["EndpointDependency"]] = None, + **kwargs + ): + super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) + self.category = category + self.endpoints = endpoints + + +class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): + """Collection of Outbound Environment Endpoints. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.OutboundEnvironmentEndpoint] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OutboundEnvironmentEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["OutboundEnvironmentEndpoint"], + **kwargs + ): + super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PerfMonCounterCollection(msrest.serialization.Model): + """Collection of performance monitor counters. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.PerfMonResponse] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PerfMonResponse]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["PerfMonResponse"], + **kwargs + ): + super(PerfMonCounterCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PerfMonResponse(msrest.serialization.Model): + """Performance monitor API response. + + :param code: The response code. + :type code: str + :param message: The message. + :type message: str + :param data: The performance monitor counters. + :type data: ~azure.mgmt.web.v2020_06_01.models.PerfMonSet + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'PerfMonSet'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + data: Optional["PerfMonSet"] = None, + **kwargs + ): + super(PerfMonResponse, self).__init__(**kwargs) + self.code = code + self.message = message + self.data = data + + +class PerfMonSample(msrest.serialization.Model): + """Performance monitor sample in a set. + + :param time: Point in time for which counter was measured. + :type time: ~datetime.datetime + :param instance_name: Name of the server on which the measurement is made. + :type instance_name: str + :param value: Value of counter at a certain time. + :type value: float + """ + + _attribute_map = { + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'instance_name': {'key': 'instanceName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__( + self, + *, + time: Optional[datetime.datetime] = None, + instance_name: Optional[str] = None, + value: Optional[float] = None, + **kwargs + ): + super(PerfMonSample, self).__init__(**kwargs) + self.time = time + self.instance_name = instance_name + self.value = value + + +class PerfMonSet(msrest.serialization.Model): + """Metric information. + + :param name: Unique key name of the counter. + :type name: str + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param time_grain: Presented time grain. + :type time_grain: str + :param values: Collection of workers that are active during this time. + :type values: list[~azure.mgmt.web.v2020_06_01.models.PerfMonSample] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[PerfMonSample]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + values: Optional[List["PerfMonSample"]] = None, + **kwargs + ): + super(PerfMonSet, self).__init__(**kwargs) + self.name = name + self.start_time = start_time + self.end_time = end_time + self.time_grain = time_grain + self.values = values + + +class PremierAddOn(Resource): + """Premier add-on. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: Premier add on SKU. + :type sku: str + :param product: Premier add on Product. + :type product: str + :param vendor: Premier add on Vendor. + :type vendor: str + :param marketplace_publisher: Premier add on Marketplace publisher. + :type marketplace_publisher: str + :param marketplace_offer: Premier add on Marketplace offer. + :type marketplace_offer: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'marketplace_publisher': {'key': 'properties.marketplacePublisher', 'type': 'str'}, + 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional[str] = None, + product: Optional[str] = None, + vendor: Optional[str] = None, + marketplace_publisher: Optional[str] = None, + marketplace_offer: Optional[str] = None, + **kwargs + ): + super(PremierAddOn, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.sku = sku + self.product = product + self.vendor = vendor + self.marketplace_publisher = marketplace_publisher + self.marketplace_offer = marketplace_offer + + +class PremierAddOnOffer(ProxyOnlyResource): + """Premier add-on offer. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param sku: Premier add on SKU. + :type sku: str + :param product: Premier add on offer Product. + :type product: str + :param vendor: Premier add on offer Vendor. + :type vendor: str + :param promo_code_required: :code:`true` if promotion code is required; otherwise, + :code:`false`. + :type promo_code_required: bool + :param quota: Premier add on offer Quota. + :type quota: int + :param web_hosting_plan_restrictions: App Service plans this offer is restricted to. Possible + values include: "None", "Free", "Shared", "Basic", "Standard", "Premium". + :type web_hosting_plan_restrictions: str or + ~azure.mgmt.web.v2020_06_01.models.AppServicePlanRestrictions + :param privacy_policy_url: Privacy policy URL. + :type privacy_policy_url: str + :param legal_terms_url: Legal terms URL. + :type legal_terms_url: str + :param marketplace_publisher: Marketplace publisher. + :type marketplace_publisher: str + :param marketplace_offer: Marketplace offer. + :type marketplace_offer: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'promo_code_required': {'key': 'properties.promoCodeRequired', 'type': 'bool'}, + 'quota': {'key': 'properties.quota', 'type': 'int'}, + 'web_hosting_plan_restrictions': {'key': 'properties.webHostingPlanRestrictions', 'type': 'str'}, + 'privacy_policy_url': {'key': 'properties.privacyPolicyUrl', 'type': 'str'}, + 'legal_terms_url': {'key': 'properties.legalTermsUrl', 'type': 'str'}, + 'marketplace_publisher': {'key': 'properties.marketplacePublisher', 'type': 'str'}, + 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + sku: Optional[str] = None, + product: Optional[str] = None, + vendor: Optional[str] = None, + promo_code_required: Optional[bool] = None, + quota: Optional[int] = None, + web_hosting_plan_restrictions: Optional[Union[str, "AppServicePlanRestrictions"]] = None, + privacy_policy_url: Optional[str] = None, + legal_terms_url: Optional[str] = None, + marketplace_publisher: Optional[str] = None, + marketplace_offer: Optional[str] = None, + **kwargs + ): + super(PremierAddOnOffer, self).__init__(kind=kind, **kwargs) + self.sku = sku + self.product = product + self.vendor = vendor + self.promo_code_required = promo_code_required + self.quota = quota + self.web_hosting_plan_restrictions = web_hosting_plan_restrictions + self.privacy_policy_url = privacy_policy_url + self.legal_terms_url = legal_terms_url + self.marketplace_publisher = marketplace_publisher + self.marketplace_offer = marketplace_offer + + +class PremierAddOnOfferCollection(msrest.serialization.Model): + """Collection of premier add-on offers. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.PremierAddOnOffer] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PremierAddOnOffer]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["PremierAddOnOffer"], + **kwargs + ): + super(PremierAddOnOfferCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PremierAddOnPatchResource(ProxyOnlyResource): + """ARM resource for a PremierAddOn. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param sku: Premier add on SKU. + :type sku: str + :param product: Premier add on Product. + :type product: str + :param vendor: Premier add on Vendor. + :type vendor: str + :param marketplace_publisher: Premier add on Marketplace publisher. + :type marketplace_publisher: str + :param marketplace_offer: Premier add on Marketplace offer. + :type marketplace_offer: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'marketplace_publisher': {'key': 'properties.marketplacePublisher', 'type': 'str'}, + 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + sku: Optional[str] = None, + product: Optional[str] = None, + vendor: Optional[str] = None, + marketplace_publisher: Optional[str] = None, + marketplace_offer: Optional[str] = None, + **kwargs + ): + super(PremierAddOnPatchResource, self).__init__(kind=kind, **kwargs) + self.sku = sku + self.product = product + self.vendor = vendor + self.marketplace_publisher = marketplace_publisher + self.marketplace_offer = marketplace_offer + + +class PrivateAccess(ProxyOnlyResource): + """Description of the parameters of Private Access for a Web Site. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: Whether private access is enabled or not. + :type enabled: bool + :param virtual_networks: The Virtual Networks (and subnets) allowed to access the site + privately. + :type virtual_networks: list[~azure.mgmt.web.v2020_06_01.models.PrivateAccessVirtualNetwork] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'virtual_networks': {'key': 'properties.virtualNetworks', 'type': '[PrivateAccessVirtualNetwork]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + virtual_networks: Optional[List["PrivateAccessVirtualNetwork"]] = None, + **kwargs + ): + super(PrivateAccess, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.virtual_networks = virtual_networks + + +class PrivateAccessSubnet(msrest.serialization.Model): + """Description of a Virtual Network subnet that is useable for private site access. + + :param name: The name of the subnet. + :type name: str + :param key: The key (ID) of the subnet. + :type key: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'int'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + key: Optional[int] = None, + **kwargs + ): + super(PrivateAccessSubnet, self).__init__(**kwargs) + self.name = name + self.key = key + + +class PrivateAccessVirtualNetwork(msrest.serialization.Model): + """Description of a Virtual Network that is useable for private site access. + + :param name: The name of the Virtual Network. + :type name: str + :param key: The key (ID) of the Virtual Network. + :type key: int + :param resource_id: The ARM uri of the Virtual Network. + :type resource_id: str + :param subnets: A List of subnets that access is allowed to on this Virtual Network. An empty + array (but not null) is interpreted to mean that all subnets are allowed within this Virtual + Network. + :type subnets: list[~azure.mgmt.web.v2020_06_01.models.PrivateAccessSubnet] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'int'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'subnets': {'key': 'subnets', 'type': '[PrivateAccessSubnet]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + key: Optional[int] = None, + resource_id: Optional[str] = None, + subnets: Optional[List["PrivateAccessSubnet"]] = None, + **kwargs + ): + super(PrivateAccessVirtualNetwork, self).__init__(**kwargs) + self.name = name + self.key = key + self.resource_id = resource_id + self.subnets = subnets + + +class PrivateEndpointConnectionResource(ProxyOnlyResource): + """Private Endpoint Connection ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar provisioning_state: + :vartype provisioning_state: str + :param private_endpoint: PrivateEndpoint of a remote private endpoint connection. + :type private_endpoint: ~azure.mgmt.web.v2020_06_01.models.ArmIdWrapper + :param private_link_service_connection_state: The state of a private link connection. + :type private_link_service_connection_state: + ~azure.mgmt.web.v2020_06_01.models.PrivateLinkConnectionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'ArmIdWrapper'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkConnectionState'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + private_endpoint: Optional["ArmIdWrapper"] = None, + private_link_service_connection_state: Optional["PrivateLinkConnectionState"] = None, + **kwargs + ): + super(PrivateEndpointConnectionResource, self).__init__(kind=kind, **kwargs) + self.provisioning_state = None + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + + +class PrivateLinkConnectionApprovalRequestResource(ProxyOnlyResource): + """Private Endpoint Connection Approval ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param private_link_service_connection_state: The state of a private link connection. + :type private_link_service_connection_state: + ~azure.mgmt.web.v2020_06_01.models.PrivateLinkConnectionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkConnectionState'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + private_link_service_connection_state: Optional["PrivateLinkConnectionState"] = None, + **kwargs + ): + super(PrivateLinkConnectionApprovalRequestResource, self).__init__(kind=kind, **kwargs) + self.private_link_service_connection_state = private_link_service_connection_state + + +class PrivateLinkConnectionState(msrest.serialization.Model): + """The state of a private link connection. + + :param status: Status of a private link connection. + :type status: str + :param description: Description of a private link connection. + :type description: str + :param actions_required: ActionsRequired for a private link connection. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[str] = None, + description: Optional[str] = None, + actions_required: Optional[str] = None, + **kwargs + ): + super(PrivateLinkConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + +class PrivateLinkResource(msrest.serialization.Model): + """A private link resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. + :type id: str + :param name: Required. Name of a private link resource. + :type name: str + :param type: Required. + :type type: str + :param properties: Required. Properties of a private link resource. + :type properties: ~azure.mgmt.web.v2020_06_01.models.PrivateLinkResourceProperties + """ + + _validation = { + 'id': {'required': True}, + 'name': {'required': True}, + 'type': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateLinkResourceProperties'}, + } + + def __init__( + self, + *, + id: str, + name: str, + type: str, + properties: "PrivateLinkResourceProperties", + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.properties = properties + + +class PrivateLinkResourceProperties(msrest.serialization.Model): + """Properties of a private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar group_id: GroupId of a private link resource. + :vartype group_id: str + :ivar required_members: RequiredMembers of a private link resource. + :vartype required_members: list[str] + :ivar required_zone_names: RequiredZoneNames of a private link resource. + :vartype required_zone_names: list[str] + """ + + _validation = { + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + 'required_zone_names': {'readonly': True}, + } + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourceProperties, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = None + + +class PrivateLinkResourcesWrapper(msrest.serialization.Model): + """Wrapper for a collection of private link resources. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. + :type value: list[~azure.mgmt.web.v2020_06_01.models.PrivateLinkResource] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + *, + value: List["PrivateLinkResource"], + **kwargs + ): + super(PrivateLinkResourcesWrapper, self).__init__(**kwargs) + self.value = value + + +class ProcessInfo(ProxyOnlyResource): + """Process Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar identifier: ARM Identifier for deployment. + :vartype identifier: int + :param deployment_name: Deployment name. + :type deployment_name: str + :param href: HRef URI. + :type href: str + :param minidump: Minidump URI. + :type minidump: str + :param is_profile_running: Is profile running?. + :type is_profile_running: bool + :param is_iis_profile_running: Is the IIS Profile running?. + :type is_iis_profile_running: bool + :param iis_profile_timeout_in_seconds: IIS Profile timeout (seconds). + :type iis_profile_timeout_in_seconds: float + :param parent: Parent process. + :type parent: str + :param children: Child process list. + :type children: list[str] + :param threads: Thread list. + :type threads: list[~azure.mgmt.web.v2020_06_01.models.ProcessThreadInfo] + :param open_file_handles: List of open files. + :type open_file_handles: list[str] + :param modules: List of modules. + :type modules: list[~azure.mgmt.web.v2020_06_01.models.ProcessModuleInfo] + :param file_name: File name of this process. + :type file_name: str + :param command_line: Command line. + :type command_line: str + :param user_name: User name. + :type user_name: str + :param handle_count: Handle count. + :type handle_count: int + :param module_count: Module count. + :type module_count: int + :param thread_count: Thread count. + :type thread_count: int + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param total_cpu_time: Total CPU time. + :type total_cpu_time: str + :param user_cpu_time: User CPU time. + :type user_cpu_time: str + :param privileged_cpu_time: Privileged CPU time. + :type privileged_cpu_time: str + :param working_set: Working set. + :type working_set: long + :param peak_working_set: Peak working set. + :type peak_working_set: long + :param private_memory: Private memory size. + :type private_memory: long + :param virtual_memory: Virtual memory size. + :type virtual_memory: long + :param peak_virtual_memory: Peak virtual memory usage. + :type peak_virtual_memory: long + :param paged_system_memory: Paged system memory. + :type paged_system_memory: long + :param non_paged_system_memory: Non-paged system memory. + :type non_paged_system_memory: long + :param paged_memory: Paged memory. + :type paged_memory: long + :param peak_paged_memory: Peak paged memory. + :type peak_paged_memory: long + :param time_stamp: Time stamp. + :type time_stamp: ~datetime.datetime + :param environment_variables: List of environment variables. + :type environment_variables: dict[str, str] + :param is_scm_site: Is this the SCM site?. + :type is_scm_site: bool + :param is_webjob: Is this a Web Job?. + :type is_webjob: bool + :param description: Description of process. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'identifier': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identifier': {'key': 'properties.identifier', 'type': 'int'}, + 'deployment_name': {'key': 'properties.deployment_name', 'type': 'str'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'minidump': {'key': 'properties.minidump', 'type': 'str'}, + 'is_profile_running': {'key': 'properties.is_profile_running', 'type': 'bool'}, + 'is_iis_profile_running': {'key': 'properties.is_iis_profile_running', 'type': 'bool'}, + 'iis_profile_timeout_in_seconds': {'key': 'properties.iis_profile_timeout_in_seconds', 'type': 'float'}, + 'parent': {'key': 'properties.parent', 'type': 'str'}, + 'children': {'key': 'properties.children', 'type': '[str]'}, + 'threads': {'key': 'properties.threads', 'type': '[ProcessThreadInfo]'}, + 'open_file_handles': {'key': 'properties.open_file_handles', 'type': '[str]'}, + 'modules': {'key': 'properties.modules', 'type': '[ProcessModuleInfo]'}, + 'file_name': {'key': 'properties.file_name', 'type': 'str'}, + 'command_line': {'key': 'properties.command_line', 'type': 'str'}, + 'user_name': {'key': 'properties.user_name', 'type': 'str'}, + 'handle_count': {'key': 'properties.handle_count', 'type': 'int'}, + 'module_count': {'key': 'properties.module_count', 'type': 'int'}, + 'thread_count': {'key': 'properties.thread_count', 'type': 'int'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'total_cpu_time': {'key': 'properties.total_cpu_time', 'type': 'str'}, + 'user_cpu_time': {'key': 'properties.user_cpu_time', 'type': 'str'}, + 'privileged_cpu_time': {'key': 'properties.privileged_cpu_time', 'type': 'str'}, + 'working_set': {'key': 'properties.working_set', 'type': 'long'}, + 'peak_working_set': {'key': 'properties.peak_working_set', 'type': 'long'}, + 'private_memory': {'key': 'properties.private_memory', 'type': 'long'}, + 'virtual_memory': {'key': 'properties.virtual_memory', 'type': 'long'}, + 'peak_virtual_memory': {'key': 'properties.peak_virtual_memory', 'type': 'long'}, + 'paged_system_memory': {'key': 'properties.paged_system_memory', 'type': 'long'}, + 'non_paged_system_memory': {'key': 'properties.non_paged_system_memory', 'type': 'long'}, + 'paged_memory': {'key': 'properties.paged_memory', 'type': 'long'}, + 'peak_paged_memory': {'key': 'properties.peak_paged_memory', 'type': 'long'}, + 'time_stamp': {'key': 'properties.time_stamp', 'type': 'iso-8601'}, + 'environment_variables': {'key': 'properties.environment_variables', 'type': '{str}'}, + 'is_scm_site': {'key': 'properties.is_scm_site', 'type': 'bool'}, + 'is_webjob': {'key': 'properties.is_webjob', 'type': 'bool'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + deployment_name: Optional[str] = None, + href: Optional[str] = None, + minidump: Optional[str] = None, + is_profile_running: Optional[bool] = None, + is_iis_profile_running: Optional[bool] = None, + iis_profile_timeout_in_seconds: Optional[float] = None, + parent: Optional[str] = None, + children: Optional[List[str]] = None, + threads: Optional[List["ProcessThreadInfo"]] = None, + open_file_handles: Optional[List[str]] = None, + modules: Optional[List["ProcessModuleInfo"]] = None, + file_name: Optional[str] = None, + command_line: Optional[str] = None, + user_name: Optional[str] = None, + handle_count: Optional[int] = None, + module_count: Optional[int] = None, + thread_count: Optional[int] = None, + start_time: Optional[datetime.datetime] = None, + total_cpu_time: Optional[str] = None, + user_cpu_time: Optional[str] = None, + privileged_cpu_time: Optional[str] = None, + working_set: Optional[int] = None, + peak_working_set: Optional[int] = None, + private_memory: Optional[int] = None, + virtual_memory: Optional[int] = None, + peak_virtual_memory: Optional[int] = None, + paged_system_memory: Optional[int] = None, + non_paged_system_memory: Optional[int] = None, + paged_memory: Optional[int] = None, + peak_paged_memory: Optional[int] = None, + time_stamp: Optional[datetime.datetime] = None, + environment_variables: Optional[Dict[str, str]] = None, + is_scm_site: Optional[bool] = None, + is_webjob: Optional[bool] = None, + description: Optional[str] = None, + **kwargs + ): + super(ProcessInfo, self).__init__(kind=kind, **kwargs) + self.identifier = None + self.deployment_name = deployment_name + self.href = href + self.minidump = minidump + self.is_profile_running = is_profile_running + self.is_iis_profile_running = is_iis_profile_running + self.iis_profile_timeout_in_seconds = iis_profile_timeout_in_seconds + self.parent = parent + self.children = children + self.threads = threads + self.open_file_handles = open_file_handles + self.modules = modules + self.file_name = file_name + self.command_line = command_line + self.user_name = user_name + self.handle_count = handle_count + self.module_count = module_count + self.thread_count = thread_count + self.start_time = start_time + self.total_cpu_time = total_cpu_time + self.user_cpu_time = user_cpu_time + self.privileged_cpu_time = privileged_cpu_time + self.working_set = working_set + self.peak_working_set = peak_working_set + self.private_memory = private_memory + self.virtual_memory = virtual_memory + self.peak_virtual_memory = peak_virtual_memory + self.paged_system_memory = paged_system_memory + self.non_paged_system_memory = non_paged_system_memory + self.paged_memory = paged_memory + self.peak_paged_memory = peak_paged_memory + self.time_stamp = time_stamp + self.environment_variables = environment_variables + self.is_scm_site = is_scm_site + self.is_webjob = is_webjob + self.description = description + + +class ProcessInfoCollection(msrest.serialization.Model): + """Collection of Kudu process information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.ProcessInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProcessInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ProcessInfo"], + **kwargs + ): + super(ProcessInfoCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ProcessModuleInfo(ProxyOnlyResource): + """Process Module Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param base_address: Base address. Used as module identifier in ARM resource URI. + :type base_address: str + :param file_name: File name. + :type file_name: str + :param href: HRef URI. + :type href: str + :param file_path: File path. + :type file_path: str + :param module_memory_size: Module memory size. + :type module_memory_size: int + :param file_version: File version. + :type file_version: str + :param file_description: File description. + :type file_description: str + :param product: Product name. + :type product: str + :param product_version: Product version. + :type product_version: str + :param is_debug: Is debug?. + :type is_debug: bool + :param language: Module language (locale). + :type language: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'base_address': {'key': 'properties.base_address', 'type': 'str'}, + 'file_name': {'key': 'properties.file_name', 'type': 'str'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'file_path': {'key': 'properties.file_path', 'type': 'str'}, + 'module_memory_size': {'key': 'properties.module_memory_size', 'type': 'int'}, + 'file_version': {'key': 'properties.file_version', 'type': 'str'}, + 'file_description': {'key': 'properties.file_description', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'product_version': {'key': 'properties.product_version', 'type': 'str'}, + 'is_debug': {'key': 'properties.is_debug', 'type': 'bool'}, + 'language': {'key': 'properties.language', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + base_address: Optional[str] = None, + file_name: Optional[str] = None, + href: Optional[str] = None, + file_path: Optional[str] = None, + module_memory_size: Optional[int] = None, + file_version: Optional[str] = None, + file_description: Optional[str] = None, + product: Optional[str] = None, + product_version: Optional[str] = None, + is_debug: Optional[bool] = None, + language: Optional[str] = None, + **kwargs + ): + super(ProcessModuleInfo, self).__init__(kind=kind, **kwargs) + self.base_address = base_address + self.file_name = file_name + self.href = href + self.file_path = file_path + self.module_memory_size = module_memory_size + self.file_version = file_version + self.file_description = file_description + self.product = product + self.product_version = product_version + self.is_debug = is_debug + self.language = language + + +class ProcessModuleInfoCollection(msrest.serialization.Model): + """Collection of Kudu thread information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.ProcessModuleInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProcessModuleInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ProcessModuleInfo"], + **kwargs + ): + super(ProcessModuleInfoCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ProcessThreadInfo(ProxyOnlyResource): + """Process Thread Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar identifier: Site extension ID. + :vartype identifier: int + :param href: HRef URI. + :type href: str + :param process: Process URI. + :type process: str + :param start_address: Start address. + :type start_address: str + :param current_priority: Current thread priority. + :type current_priority: int + :param priority_level: Thread priority level. + :type priority_level: str + :param base_priority: Base priority. + :type base_priority: int + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param total_processor_time: Total processor time. + :type total_processor_time: str + :param user_processor_time: User processor time. + :type user_processor_time: str + :param state: Thread state. + :type state: str + :param wait_reason: Wait reason. + :type wait_reason: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'identifier': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identifier': {'key': 'properties.identifier', 'type': 'int'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'process': {'key': 'properties.process', 'type': 'str'}, + 'start_address': {'key': 'properties.start_address', 'type': 'str'}, + 'current_priority': {'key': 'properties.current_priority', 'type': 'int'}, + 'priority_level': {'key': 'properties.priority_level', 'type': 'str'}, + 'base_priority': {'key': 'properties.base_priority', 'type': 'int'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'total_processor_time': {'key': 'properties.total_processor_time', 'type': 'str'}, + 'user_processor_time': {'key': 'properties.user_processor_time', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'wait_reason': {'key': 'properties.wait_reason', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + href: Optional[str] = None, + process: Optional[str] = None, + start_address: Optional[str] = None, + current_priority: Optional[int] = None, + priority_level: Optional[str] = None, + base_priority: Optional[int] = None, + start_time: Optional[datetime.datetime] = None, + total_processor_time: Optional[str] = None, + user_processor_time: Optional[str] = None, + state: Optional[str] = None, + wait_reason: Optional[str] = None, + **kwargs + ): + super(ProcessThreadInfo, self).__init__(kind=kind, **kwargs) + self.identifier = None + self.href = href + self.process = process + self.start_address = start_address + self.current_priority = current_priority + self.priority_level = priority_level + self.base_priority = base_priority + self.start_time = start_time + self.total_processor_time = total_processor_time + self.user_processor_time = user_processor_time + self.state = state + self.wait_reason = wait_reason + + +class ProcessThreadInfoCollection(msrest.serialization.Model): + """Collection of Kudu thread information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.ProcessThreadInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProcessThreadInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ProcessThreadInfo"], + **kwargs + ): + super(ProcessThreadInfoCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PublicCertificate(ProxyOnlyResource): + """Public certificate object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param blob: Public Certificate byte array. + :type blob: bytearray + :param public_certificate_location: Public Certificate Location. Possible values include: + "CurrentUserMy", "LocalMachineMy", "Unknown". + :type public_certificate_location: str or + ~azure.mgmt.web.v2020_06_01.models.PublicCertificateLocation + :ivar thumbprint: Certificate Thumbprint. + :vartype thumbprint: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'thumbprint': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'blob': {'key': 'properties.blob', 'type': 'bytearray'}, + 'public_certificate_location': {'key': 'properties.publicCertificateLocation', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + blob: Optional[bytearray] = None, + public_certificate_location: Optional[Union[str, "PublicCertificateLocation"]] = None, + **kwargs + ): + super(PublicCertificate, self).__init__(kind=kind, **kwargs) + self.blob = blob + self.public_certificate_location = public_certificate_location + self.thumbprint = None + + +class PublicCertificateCollection(msrest.serialization.Model): + """Collection of public certificates. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.PublicCertificate] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PublicCertificate]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["PublicCertificate"], + **kwargs + ): + super(PublicCertificateCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PushSettings(ProxyOnlyResource): + """Push settings for the App. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param is_push_enabled: Gets or sets a flag indicating whether the Push endpoint is enabled. + :type is_push_enabled: bool + :param tag_whitelist_json: Gets or sets a JSON string containing a list of tags that are + whitelisted for use by the push registration endpoint. + :type tag_whitelist_json: str + :param tags_requiring_auth: Gets or sets a JSON string containing a list of tags that require + user authentication to be used in the push registration endpoint. + Tags can consist of alphanumeric characters and the following: + '_', '@', '#', '.', ':', '-'. + Validation should be performed at the PushRequestHandler. + :type tags_requiring_auth: str + :param dynamic_tags_json: Gets or sets a JSON string containing a list of dynamic tags that + will be evaluated from user claims in the push registration endpoint. + :type dynamic_tags_json: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_push_enabled': {'key': 'properties.isPushEnabled', 'type': 'bool'}, + 'tag_whitelist_json': {'key': 'properties.tagWhitelistJson', 'type': 'str'}, + 'tags_requiring_auth': {'key': 'properties.tagsRequiringAuth', 'type': 'str'}, + 'dynamic_tags_json': {'key': 'properties.dynamicTagsJson', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + is_push_enabled: Optional[bool] = None, + tag_whitelist_json: Optional[str] = None, + tags_requiring_auth: Optional[str] = None, + dynamic_tags_json: Optional[str] = None, + **kwargs + ): + super(PushSettings, self).__init__(kind=kind, **kwargs) + self.is_push_enabled = is_push_enabled + self.tag_whitelist_json = tag_whitelist_json + self.tags_requiring_auth = tags_requiring_auth + self.dynamic_tags_json = dynamic_tags_json + + +class RampUpRule(msrest.serialization.Model): + """Routing rules for ramp up testing. This rule allows to redirect static traffic % to a slot or to gradually change routing % based on performance. + + :param action_host_name: Hostname of a slot to which the traffic will be redirected if decided + to. E.g. myapp-stage.azurewebsites.net. + :type action_host_name: str + :param reroute_percentage: Percentage of the traffic which will be redirected to + :code:`ActionHostName`. + :type reroute_percentage: float + :param change_step: In auto ramp up scenario this is the step to add/remove from + :code:`ReroutePercentage` until it reaches + \n:code:`MinReroutePercentage` or + :code:`MaxReroutePercentage`. Site metrics are checked every N minutes specified + in :code:`ChangeIntervalInMinutes`.\nCustom decision algorithm + can be provided in TiPCallback site extension which URL can be specified in + :code:`ChangeDecisionCallbackUrl`. + :type change_step: float + :param change_interval_in_minutes: Specifies interval in minutes to reevaluate + ReroutePercentage. + :type change_interval_in_minutes: int + :param min_reroute_percentage: Specifies lower boundary above which ReroutePercentage will + stay. + :type min_reroute_percentage: float + :param max_reroute_percentage: Specifies upper boundary below which ReroutePercentage will + stay. + :type max_reroute_percentage: float + :param change_decision_callback_url: Custom decision algorithm can be provided in TiPCallback + site extension which URL can be specified. See TiPCallback site extension for the scaffold and + contracts. + https://www.siteextensions.net/packages/TiPCallback/. + :type change_decision_callback_url: str + :param name: Name of the routing rule. The recommended name would be to point to the slot which + will receive the traffic in the experiment. + :type name: str + """ + + _attribute_map = { + 'action_host_name': {'key': 'actionHostName', 'type': 'str'}, + 'reroute_percentage': {'key': 'reroutePercentage', 'type': 'float'}, + 'change_step': {'key': 'changeStep', 'type': 'float'}, + 'change_interval_in_minutes': {'key': 'changeIntervalInMinutes', 'type': 'int'}, + 'min_reroute_percentage': {'key': 'minReroutePercentage', 'type': 'float'}, + 'max_reroute_percentage': {'key': 'maxReroutePercentage', 'type': 'float'}, + 'change_decision_callback_url': {'key': 'changeDecisionCallbackUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + action_host_name: Optional[str] = None, + reroute_percentage: Optional[float] = None, + change_step: Optional[float] = None, + change_interval_in_minutes: Optional[int] = None, + min_reroute_percentage: Optional[float] = None, + max_reroute_percentage: Optional[float] = None, + change_decision_callback_url: Optional[str] = None, + name: Optional[str] = None, + **kwargs + ): + super(RampUpRule, self).__init__(**kwargs) + self.action_host_name = action_host_name + self.reroute_percentage = reroute_percentage + self.change_step = change_step + self.change_interval_in_minutes = change_interval_in_minutes + self.min_reroute_percentage = min_reroute_percentage + self.max_reroute_percentage = max_reroute_percentage + self.change_decision_callback_url = change_decision_callback_url + self.name = name + + +class Recommendation(ProxyOnlyResource): + """Represents a recommendation result generated by the recommendation engine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param creation_time: Timestamp when this instance was created. + :type creation_time: ~datetime.datetime + :param recommendation_id: A GUID value that each recommendation object is associated with. + :type recommendation_id: str + :param resource_id: Full ARM resource ID string that this recommendation object is associated + with. + :type resource_id: str + :param resource_scope: Name of a resource type this recommendation applies, e.g. Subscription, + ServerFarm, Site. Possible values include: "ServerFarm", "Subscription", "WebSite". + :type resource_scope: str or ~azure.mgmt.web.v2020_06_01.models.ResourceScopeType + :param rule_name: Unique name of the rule. + :type rule_name: str + :param display_name: UI friendly name of the rule (may not be unique). + :type display_name: str + :param message: Recommendation text. + :type message: str + :param level: Level indicating how critical this recommendation can impact. Possible values + include: "Critical", "Warning", "Information", "NonUrgentSuggestion". + :type level: str or ~azure.mgmt.web.v2020_06_01.models.NotificationLevel + :param channels: List of channels that this recommendation can apply. Possible values include: + "Notification", "Api", "Email", "Webhook", "All". + :type channels: str or ~azure.mgmt.web.v2020_06_01.models.Channels + :ivar category_tags: The list of category tags that this recommendation belongs to. + :vartype category_tags: list[str] + :param action_name: Name of action recommended by this object. + :type action_name: str + :param enabled: True if this recommendation is still valid (i.e. "actionable"). False if it is + invalid. + :type enabled: int + :param states: The list of states of this recommendation. If it's null then it should be + considered "Active". + :type states: list[str] + :param start_time: The beginning time in UTC of a range that the recommendation refers to. + :type start_time: ~datetime.datetime + :param end_time: The end time in UTC of a range that the recommendation refers to. + :type end_time: ~datetime.datetime + :param next_notification_time: When to notify this recommendation next in UTC. Null means that + this will never be notified anymore. + :type next_notification_time: ~datetime.datetime + :param notification_expiration_time: Date and time in UTC when this notification expires. + :type notification_expiration_time: ~datetime.datetime + :param notified_time: Last timestamp in UTC this instance was actually notified. Null means + that this recommendation hasn't been notified yet. + :type notified_time: ~datetime.datetime + :param score: A metric value measured by the rule. + :type score: float + :param is_dynamic: True if this is associated with a dynamically added rule. + :type is_dynamic: bool + :param extension_name: Extension name of the portal if exists. + :type extension_name: str + :param blade_name: Deep link to a blade on the portal. + :type blade_name: str + :param forward_link: Forward link to an external document associated with the rule. + :type forward_link: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'category_tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'recommendation_id': {'key': 'properties.recommendationId', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'resource_scope': {'key': 'properties.resourceScope', 'type': 'str'}, + 'rule_name': {'key': 'properties.ruleName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'level': {'key': 'properties.level', 'type': 'str'}, + 'channels': {'key': 'properties.channels', 'type': 'str'}, + 'category_tags': {'key': 'properties.categoryTags', 'type': '[str]'}, + 'action_name': {'key': 'properties.actionName', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'int'}, + 'states': {'key': 'properties.states', 'type': '[str]'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'next_notification_time': {'key': 'properties.nextNotificationTime', 'type': 'iso-8601'}, + 'notification_expiration_time': {'key': 'properties.notificationExpirationTime', 'type': 'iso-8601'}, + 'notified_time': {'key': 'properties.notifiedTime', 'type': 'iso-8601'}, + 'score': {'key': 'properties.score', 'type': 'float'}, + 'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'}, + 'extension_name': {'key': 'properties.extensionName', 'type': 'str'}, + 'blade_name': {'key': 'properties.bladeName', 'type': 'str'}, + 'forward_link': {'key': 'properties.forwardLink', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + creation_time: Optional[datetime.datetime] = None, + recommendation_id: Optional[str] = None, + resource_id: Optional[str] = None, + resource_scope: Optional[Union[str, "ResourceScopeType"]] = None, + rule_name: Optional[str] = None, + display_name: Optional[str] = None, + message: Optional[str] = None, + level: Optional[Union[str, "NotificationLevel"]] = None, + channels: Optional[Union[str, "Channels"]] = None, + action_name: Optional[str] = None, + enabled: Optional[int] = None, + states: Optional[List[str]] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + next_notification_time: Optional[datetime.datetime] = None, + notification_expiration_time: Optional[datetime.datetime] = None, + notified_time: Optional[datetime.datetime] = None, + score: Optional[float] = None, + is_dynamic: Optional[bool] = None, + extension_name: Optional[str] = None, + blade_name: Optional[str] = None, + forward_link: Optional[str] = None, + **kwargs + ): + super(Recommendation, self).__init__(kind=kind, **kwargs) + self.creation_time = creation_time + self.recommendation_id = recommendation_id + self.resource_id = resource_id + self.resource_scope = resource_scope + self.rule_name = rule_name + self.display_name = display_name + self.message = message + self.level = level + self.channels = channels + self.category_tags = None + self.action_name = action_name + self.enabled = enabled + self.states = states + self.start_time = start_time + self.end_time = end_time + self.next_notification_time = next_notification_time + self.notification_expiration_time = notification_expiration_time + self.notified_time = notified_time + self.score = score + self.is_dynamic = is_dynamic + self.extension_name = extension_name + self.blade_name = blade_name + self.forward_link = forward_link + + +class RecommendationCollection(msrest.serialization.Model): + """Collection of recommendations. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.Recommendation] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Recommendation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Recommendation"], + **kwargs + ): + super(RecommendationCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class RecommendationRule(ProxyOnlyResource): + """Represents a recommendation rule that the recommendation engine can perform. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param recommendation_name: Unique name of the rule. + :type recommendation_name: str + :param display_name: UI friendly name of the rule. + :type display_name: str + :param message: Localized name of the rule (Good for UI). + :type message: str + :param recommendation_id: Recommendation ID of an associated recommendation object tied to the + rule, if exists. + If such an object doesn't exist, it is set to null. + :type recommendation_id: str + :param description: Localized detailed description of the rule. + :type description: str + :param action_name: Name of action that is recommended by this rule in string. + :type action_name: str + :param level: Level of impact indicating how critical this rule is. Possible values include: + "Critical", "Warning", "Information", "NonUrgentSuggestion". + :type level: str or ~azure.mgmt.web.v2020_06_01.models.NotificationLevel + :param channels: List of available channels that this rule applies. Possible values include: + "Notification", "Api", "Email", "Webhook", "All". + :type channels: str or ~azure.mgmt.web.v2020_06_01.models.Channels + :ivar category_tags: The list of category tags that this recommendation rule belongs to. + :vartype category_tags: list[str] + :param is_dynamic: True if this is associated with a dynamically added rule. + :type is_dynamic: bool + :param extension_name: Extension name of the portal if exists. Applicable to dynamic rule only. + :type extension_name: str + :param blade_name: Deep link to a blade on the portal. Applicable to dynamic rule only. + :type blade_name: str + :param forward_link: Forward link to an external document associated with the rule. Applicable + to dynamic rule only. + :type forward_link: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'category_tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recommendation_name': {'key': 'properties.recommendationName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'recommendation_id': {'key': 'properties.recommendationId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'action_name': {'key': 'properties.actionName', 'type': 'str'}, + 'level': {'key': 'properties.level', 'type': 'str'}, + 'channels': {'key': 'properties.channels', 'type': 'str'}, + 'category_tags': {'key': 'properties.categoryTags', 'type': '[str]'}, + 'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'}, + 'extension_name': {'key': 'properties.extensionName', 'type': 'str'}, + 'blade_name': {'key': 'properties.bladeName', 'type': 'str'}, + 'forward_link': {'key': 'properties.forwardLink', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + recommendation_name: Optional[str] = None, + display_name: Optional[str] = None, + message: Optional[str] = None, + recommendation_id: Optional[str] = None, + description: Optional[str] = None, + action_name: Optional[str] = None, + level: Optional[Union[str, "NotificationLevel"]] = None, + channels: Optional[Union[str, "Channels"]] = None, + is_dynamic: Optional[bool] = None, + extension_name: Optional[str] = None, + blade_name: Optional[str] = None, + forward_link: Optional[str] = None, + **kwargs + ): + super(RecommendationRule, self).__init__(kind=kind, **kwargs) + self.recommendation_name = recommendation_name + self.display_name = display_name + self.message = message + self.recommendation_id = recommendation_id + self.description = description + self.action_name = action_name + self.level = level + self.channels = channels + self.category_tags = None + self.is_dynamic = is_dynamic + self.extension_name = extension_name + self.blade_name = blade_name + self.forward_link = forward_link + + +class ReissueCertificateOrderRequest(ProxyOnlyResource): + """Class representing certificate reissue request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param key_size: Certificate Key Size. + :type key_size: int + :param delay_existing_revoke_in_hours: Delay in hours to revoke existing certificate after the + new certificate is issued. + :type delay_existing_revoke_in_hours: int + :param csr: Csr to be used for re-key operation. + :type csr: str + :param is_private_key_external: Should we change the ASC type (from managed private key to + external private key and vice versa). + :type is_private_key_external: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'delay_existing_revoke_in_hours': {'key': 'properties.delayExistingRevokeInHours', 'type': 'int'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + key_size: Optional[int] = None, + delay_existing_revoke_in_hours: Optional[int] = None, + csr: Optional[str] = None, + is_private_key_external: Optional[bool] = None, + **kwargs + ): + super(ReissueCertificateOrderRequest, self).__init__(kind=kind, **kwargs) + self.key_size = key_size + self.delay_existing_revoke_in_hours = delay_existing_revoke_in_hours + self.csr = csr + self.is_private_key_external = is_private_key_external + + +class RelayServiceConnectionEntity(ProxyOnlyResource): + """Hybrid Connection for an App Service app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param entity_name: + :type entity_name: str + :param entity_connection_string: + :type entity_connection_string: str + :param resource_type: + :type resource_type: str + :param resource_connection_string: + :type resource_connection_string: str + :param hostname: + :type hostname: str + :param port: + :type port: int + :param biztalk_uri: + :type biztalk_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'entity_name': {'key': 'properties.entityName', 'type': 'str'}, + 'entity_connection_string': {'key': 'properties.entityConnectionString', 'type': 'str'}, + 'resource_type': {'key': 'properties.resourceType', 'type': 'str'}, + 'resource_connection_string': {'key': 'properties.resourceConnectionString', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'biztalk_uri': {'key': 'properties.biztalkUri', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + entity_name: Optional[str] = None, + entity_connection_string: Optional[str] = None, + resource_type: Optional[str] = None, + resource_connection_string: Optional[str] = None, + hostname: Optional[str] = None, + port: Optional[int] = None, + biztalk_uri: Optional[str] = None, + **kwargs + ): + super(RelayServiceConnectionEntity, self).__init__(kind=kind, **kwargs) + self.entity_name = entity_name + self.entity_connection_string = entity_connection_string + self.resource_type = resource_type + self.resource_connection_string = resource_connection_string + self.hostname = hostname + self.port = port + self.biztalk_uri = biztalk_uri + + +class Rendering(msrest.serialization.Model): + """Instructions for rendering the data. + + :param type: Rendering Type. Possible values include: "NoGraph", "Table", "TimeSeries", + "TimeSeriesPerInstance". + :type type: str or ~azure.mgmt.web.v2020_06_01.models.RenderingType + :param title: Title of data. + :type title: str + :param description: Description of the data that will help it be interpreted. + :type description: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "RenderingType"]] = None, + title: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(Rendering, self).__init__(**kwargs) + self.type = type + self.title = title + self.description = description + + +class RenewCertificateOrderRequest(ProxyOnlyResource): + """Class representing certificate renew request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param key_size: Certificate Key Size. + :type key_size: int + :param csr: Csr to be used for re-key operation. + :type csr: str + :param is_private_key_external: Should we change the ASC type (from managed private key to + external private key and vice versa). + :type is_private_key_external: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + key_size: Optional[int] = None, + csr: Optional[str] = None, + is_private_key_external: Optional[bool] = None, + **kwargs + ): + super(RenewCertificateOrderRequest, self).__init__(kind=kind, **kwargs) + self.key_size = key_size + self.csr = csr + self.is_private_key_external = is_private_key_external + + +class RequestsBasedTrigger(msrest.serialization.Model): + """Trigger based on total requests. + + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + } + + def __init__( + self, + *, + count: Optional[int] = None, + time_interval: Optional[str] = None, + **kwargs + ): + super(RequestsBasedTrigger, self).__init__(**kwargs) + self.count = count + self.time_interval = time_interval + + +class ResourceCollection(msrest.serialization.Model): + """Collection of resources. + + 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. + + :param value: Required. Collection of resources. + :type value: list[str] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[str]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List[str], + **kwargs + ): + super(ResourceCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ResourceHealthMetadata(ProxyOnlyResource): + """Used for getting ResourceHealthCheck settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param category: The category that the resource matches in the RHC Policy File. + :type category: str + :param signal_availability: Is there a health signal for the resource. + :type signal_availability: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'signal_availability': {'key': 'properties.signalAvailability', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + category: Optional[str] = None, + signal_availability: Optional[bool] = None, + **kwargs + ): + super(ResourceHealthMetadata, self).__init__(kind=kind, **kwargs) + self.category = category + self.signal_availability = signal_availability + + +class ResourceHealthMetadataCollection(msrest.serialization.Model): + """Collection of resource health metadata. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.ResourceHealthMetadata] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceHealthMetadata]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ResourceHealthMetadata"], + **kwargs + ): + super(ResourceHealthMetadataCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ResourceMetricAvailability(msrest.serialization.Model): + """Metrics availability and retention. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar time_grain: Time grain . + :vartype time_grain: str + :ivar retention: Retention period for the current time grain. + :vartype retention: str + """ + + _validation = { + 'time_grain': {'readonly': True}, + 'retention': {'readonly': True}, + } + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'retention': {'key': 'retention', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceMetricAvailability, self).__init__(**kwargs) + self.time_grain = None + self.retention = None + + +class ResourceMetricDefinition(ProxyOnlyResource): + """Metadata for the metrics. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar unit: Unit of the metric. + :vartype unit: str + :ivar primary_aggregation_type: Primary aggregation type. + :vartype primary_aggregation_type: str + :ivar metric_availabilities: List of time grains supported for the metric together with + retention period. + :vartype metric_availabilities: + list[~azure.mgmt.web.v2020_06_01.models.ResourceMetricAvailability] + :ivar resource_uri: Resource URI. + :vartype resource_uri: str + :ivar properties: Resource metric definition properties. + :vartype properties: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'unit': {'readonly': True}, + 'primary_aggregation_type': {'readonly': True}, + 'metric_availabilities': {'readonly': True}, + 'resource_uri': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'unit': {'key': 'properties.unit', 'type': 'str'}, + 'primary_aggregation_type': {'key': 'properties.primaryAggregationType', 'type': 'str'}, + 'metric_availabilities': {'key': 'properties.metricAvailabilities', 'type': '[ResourceMetricAvailability]'}, + 'resource_uri': {'key': 'properties.resourceUri', 'type': 'str'}, + 'properties': {'key': 'properties.properties', 'type': '{str}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(ResourceMetricDefinition, self).__init__(kind=kind, **kwargs) + self.unit = None + self.primary_aggregation_type = None + self.metric_availabilities = None + self.resource_uri = None + self.properties = None + + +class ResourceMetricDefinitionCollection(msrest.serialization.Model): + """Collection of metric definitions. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.ResourceMetricDefinition] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceMetricDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ResourceMetricDefinition"], + **kwargs + ): + super(ResourceMetricDefinitionCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ResourceNameAvailability(msrest.serialization.Model): + """Information regarding availability of a resource name. + + :param name_available: :code:`true` indicates name is valid and available. + :code:`false` indicates the name is invalid, unavailable, or both. + :type name_available: bool + :param reason: :code:`Invalid` indicates the name provided does not match Azure + App Service naming requirements. :code:`AlreadyExists` indicates that the name is + already in use and is therefore unavailable. Possible values include: "Invalid", + "AlreadyExists". + :type reason: str or ~azure.mgmt.web.v2020_06_01.models.InAvailabilityReasonType + :param message: If reason == invalid, provide the user with the reason why the given name is + invalid, and provide the resource naming requirements so that the user can select a valid name. + If reason == AlreadyExists, explain that resource name is already in use, and direct them to + select a different name. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + name_available: Optional[bool] = None, + reason: Optional[Union[str, "InAvailabilityReasonType"]] = None, + message: Optional[str] = None, + **kwargs + ): + super(ResourceNameAvailability, self).__init__(**kwargs) + self.name_available = name_available + self.reason = reason + self.message = message + + +class ResourceNameAvailabilityRequest(msrest.serialization.Model): + """Resource name availability request content. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name to verify. + :type name: str + :param type: Required. Resource type used for verification. Possible values include: "Site", + "Slot", "HostingEnvironment", "PublishingUser", "Microsoft.Web/sites", + "Microsoft.Web/sites/slots", "Microsoft.Web/hostingEnvironments", + "Microsoft.Web/publishingUsers". + :type type: str or ~azure.mgmt.web.v2020_06_01.models.CheckNameResourceTypes + :param is_fqdn: Is fully qualified domain name. + :type is_fqdn: bool + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_fqdn': {'key': 'isFqdn', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: str, + type: Union[str, "CheckNameResourceTypes"], + is_fqdn: Optional[bool] = None, + **kwargs + ): + super(ResourceNameAvailabilityRequest, self).__init__(**kwargs) + self.name = name + self.type = type + self.is_fqdn = is_fqdn + + +class ResponseMetaData(msrest.serialization.Model): + """ResponseMetaData. + + :param data_source: Source of the Data. + :type data_source: ~azure.mgmt.web.v2020_06_01.models.DataSource + """ + + _attribute_map = { + 'data_source': {'key': 'dataSource', 'type': 'DataSource'}, + } + + def __init__( + self, + *, + data_source: Optional["DataSource"] = None, + **kwargs + ): + super(ResponseMetaData, self).__init__(**kwargs) + self.data_source = data_source + + +class RestoreRequest(ProxyOnlyResource): + """Description of a restore request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param storage_account_url: SAS URL to the container. + :type storage_account_url: str + :param blob_name: Name of a blob which contains the backup. + :type blob_name: str + :param overwrite: :code:`true` if the restore operation can overwrite target app; + otherwise, :code:`false`. :code:`true` is needed if trying to restore + over an existing app. + :type overwrite: bool + :param site_name: Name of an app. + :type site_name: str + :param databases: Collection of databases which should be restored. This list has to match the + list of databases included in the backup. + :type databases: list[~azure.mgmt.web.v2020_06_01.models.DatabaseBackupSetting] + :param ignore_conflicting_host_names: Changes a logic when restoring an app with custom + domains. :code:`true` to remove custom domains automatically. If + :code:`false`, custom domains are added to + the app's object when it is being restored, but that might fail due to conflicts during the + operation. + :type ignore_conflicting_host_names: bool + :param ignore_databases: Ignore the databases and only restore the site content. + :type ignore_databases: bool + :param app_service_plan: Specify app service plan that will own restored site. + :type app_service_plan: str + :param operation_type: Operation type. Possible values include: "Default", "Clone", + "Relocation", "Snapshot", "CloudFS". Default value: "Default". + :type operation_type: str or ~azure.mgmt.web.v2020_06_01.models.BackupRestoreOperationType + :param adjust_connection_strings: :code:`true` if SiteConfig.ConnectionStrings + should be set in new app; otherwise, :code:`false`. + :type adjust_connection_strings: bool + :param hosting_environment: App Service Environment name, if needed (only when restoring an app + to an App Service Environment). + :type hosting_environment: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'storage_account_url': {'key': 'properties.storageAccountUrl', 'type': 'str'}, + 'blob_name': {'key': 'properties.blobName', 'type': 'str'}, + 'overwrite': {'key': 'properties.overwrite', 'type': 'bool'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'databases': {'key': 'properties.databases', 'type': '[DatabaseBackupSetting]'}, + 'ignore_conflicting_host_names': {'key': 'properties.ignoreConflictingHostNames', 'type': 'bool'}, + 'ignore_databases': {'key': 'properties.ignoreDatabases', 'type': 'bool'}, + 'app_service_plan': {'key': 'properties.appServicePlan', 'type': 'str'}, + 'operation_type': {'key': 'properties.operationType', 'type': 'str'}, + 'adjust_connection_strings': {'key': 'properties.adjustConnectionStrings', 'type': 'bool'}, + 'hosting_environment': {'key': 'properties.hostingEnvironment', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + storage_account_url: Optional[str] = None, + blob_name: Optional[str] = None, + overwrite: Optional[bool] = None, + site_name: Optional[str] = None, + databases: Optional[List["DatabaseBackupSetting"]] = None, + ignore_conflicting_host_names: Optional[bool] = False, + ignore_databases: Optional[bool] = False, + app_service_plan: Optional[str] = None, + operation_type: Optional[Union[str, "BackupRestoreOperationType"]] = "Default", + adjust_connection_strings: Optional[bool] = None, + hosting_environment: Optional[str] = None, + **kwargs + ): + super(RestoreRequest, self).__init__(kind=kind, **kwargs) + self.storage_account_url = storage_account_url + self.blob_name = blob_name + self.overwrite = overwrite + self.site_name = site_name + self.databases = databases + self.ignore_conflicting_host_names = ignore_conflicting_host_names + self.ignore_databases = ignore_databases + self.app_service_plan = app_service_plan + self.operation_type = operation_type + self.adjust_connection_strings = adjust_connection_strings + self.hosting_environment = hosting_environment + + +class ServiceSpecification(msrest.serialization.Model): + """Resource metrics service provided by Microsoft.Insights resource provider. + + :param metric_specifications: + :type metric_specifications: list[~azure.mgmt.web.v2020_06_01.models.MetricSpecification] + :param log_specifications: + :type log_specifications: list[~azure.mgmt.web.v2020_06_01.models.LogSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + } + + def __init__( + self, + *, + metric_specifications: Optional[List["MetricSpecification"]] = None, + log_specifications: Optional[List["LogSpecification"]] = None, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + self.log_specifications = log_specifications + + +class Site(Resource): + """A web app, a mobile app backend, or an API app. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param identity: Managed service identity. + :type identity: ~azure.mgmt.web.v2020_06_01.models.ManagedServiceIdentity + :ivar state: Current state of the app. + :vartype state: str + :ivar host_names: Hostnames associated with the app. + :vartype host_names: list[str] + :ivar repository_site_name: Name of the repository site. + :vartype repository_site_name: str + :ivar usage_state: State indicating whether the app has exceeded its quota usage. Read-only. + Possible values include: "Normal", "Exceeded". + :vartype usage_state: str or ~azure.mgmt.web.v2020_06_01.models.UsageState + :param enabled: :code:`true` if the app is enabled; otherwise, + :code:`false`. Setting this value to false disables the app (takes the app + offline). + :type enabled: bool + :ivar enabled_host_names: Enabled hostnames for the app.Hostnames need to be assigned (see + HostNames) AND enabled. Otherwise, + the app is not served on those hostnames. + :vartype enabled_host_names: list[str] + :ivar availability_state: Management information availability state for the app. Possible + values include: "Normal", "Limited", "DisasterRecoveryMode". + :vartype availability_state: str or ~azure.mgmt.web.v2020_06_01.models.SiteAvailabilityState + :param host_name_ssl_states: Hostname SSL states are used to manage the SSL bindings for app's + hostnames. + :type host_name_ssl_states: list[~azure.mgmt.web.v2020_06_01.models.HostNameSslState] + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param reserved: :code:`true` if reserved; otherwise, :code:`false`. + :type reserved: bool + :param is_xenon: Obsolete: Hyper-V sandbox. + :type is_xenon: bool + :param hyper_v: Hyper-V sandbox. + :type hyper_v: bool + :ivar last_modified_time_utc: Last time the app was modified, in UTC. Read-only. + :vartype last_modified_time_utc: ~datetime.datetime + :param site_config: Configuration of the app. + :type site_config: ~azure.mgmt.web.v2020_06_01.models.SiteConfig + :ivar traffic_manager_host_names: Azure Traffic Manager hostnames associated with the app. + Read-only. + :vartype traffic_manager_host_names: list[str] + :param scm_site_also_stopped: :code:`true` to stop SCM (KUDU) site when the app is + stopped; otherwise, :code:`false`. The default is :code:`false`. + :type scm_site_also_stopped: bool + :ivar target_swap_slot: Specifies which deployment slot this app will swap into. Read-only. + :vartype target_swap_slot: str + :param hosting_environment_profile: App Service Environment to use for the app. + :type hosting_environment_profile: ~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentProfile + :param client_affinity_enabled: :code:`true` to enable client affinity; + :code:`false` to stop sending session affinity cookies, which route client + requests in the same session to the same instance. Default is :code:`true`. + :type client_affinity_enabled: bool + :param client_cert_enabled: :code:`true` to enable client certificate + authentication (TLS mutual authentication); otherwise, :code:`false`. Default is + :code:`false`. + :type client_cert_enabled: bool + :param client_cert_mode: This composes with ClientCertEnabled setting. + + + * ClientCertEnabled: false means ClientCert is ignored. + * ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + * ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or + accepted. Possible values include: "Required", "Optional". + :type client_cert_mode: str or ~azure.mgmt.web.v2020_06_01.models.ClientCertMode + :param client_cert_exclusion_paths: client certificate authentication comma-separated exclusion + paths. + :type client_cert_exclusion_paths: str + :param host_names_disabled: :code:`true` to disable the public hostnames of the + app; otherwise, :code:`false`. + If :code:`true`, the app is only accessible via API management process. + :type host_names_disabled: bool + :param custom_domain_verification_id: Unique identifier that verifies the custom domains + assigned to the app. Customer will add this id to a txt record for verification. + :type custom_domain_verification_id: str + :ivar outbound_ip_addresses: List of IP addresses that the app uses for outbound connections + (e.g. database access). Includes VIPs from tenants that site can be hosted with current + settings. Read-only. + :vartype outbound_ip_addresses: str + :ivar possible_outbound_ip_addresses: List of IP addresses that the app uses for outbound + connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read- + only. + :vartype possible_outbound_ip_addresses: str + :param container_size: Size of the function container. + :type container_size: int + :param daily_memory_time_quota: Maximum allowed daily memory-time quota (applicable on dynamic + apps only). + :type daily_memory_time_quota: int + :ivar suspended_till: App suspended till in case memory-time quota is exceeded. + :vartype suspended_till: ~datetime.datetime + :ivar max_number_of_workers: Maximum number of workers. + This only applies to Functions container. + :vartype max_number_of_workers: int + :param cloning_info: If specified during app creation, the app is cloned from a source app. + :type cloning_info: ~azure.mgmt.web.v2020_06_01.models.CloningInfo + :ivar resource_group: Name of the resource group the app belongs to. Read-only. + :vartype resource_group: str + :ivar is_default_container: :code:`true` if the app is a default container; + otherwise, :code:`false`. + :vartype is_default_container: bool + :ivar default_host_name: Default hostname of the app. Read-only. + :vartype default_host_name: str + :ivar slot_swap_status: Status of the last deployment slot swap operation. + :vartype slot_swap_status: ~azure.mgmt.web.v2020_06_01.models.SlotSwapStatus + :param https_only: HttpsOnly: configures a web site to accept only https requests. Issues + redirect for + http requests. + :type https_only: bool + :param redundancy_mode: Site redundancy mode. Possible values include: "None", "Manual", + "Failover", "ActiveActive", "GeoRedundant". + :type redundancy_mode: str or ~azure.mgmt.web.v2020_06_01.models.RedundancyMode + :ivar in_progress_operation_id: Specifies an operation id if this site has a pending operation. + :vartype in_progress_operation_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'host_names': {'readonly': True}, + 'repository_site_name': {'readonly': True}, + 'usage_state': {'readonly': True}, + 'enabled_host_names': {'readonly': True}, + 'availability_state': {'readonly': True}, + 'last_modified_time_utc': {'readonly': True}, + 'traffic_manager_host_names': {'readonly': True}, + 'target_swap_slot': {'readonly': True}, + 'outbound_ip_addresses': {'readonly': True}, + 'possible_outbound_ip_addresses': {'readonly': True}, + 'suspended_till': {'readonly': True}, + 'max_number_of_workers': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'is_default_container': {'readonly': True}, + 'default_host_name': {'readonly': True}, + 'slot_swap_status': {'readonly': True}, + 'in_progress_operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'repository_site_name': {'key': 'properties.repositorySiteName', 'type': 'str'}, + 'usage_state': {'key': 'properties.usageState', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'enabled_host_names': {'key': 'properties.enabledHostNames', 'type': '[str]'}, + 'availability_state': {'key': 'properties.availabilityState', 'type': 'str'}, + 'host_name_ssl_states': {'key': 'properties.hostNameSslStates', 'type': '[HostNameSslState]'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'last_modified_time_utc': {'key': 'properties.lastModifiedTimeUtc', 'type': 'iso-8601'}, + 'site_config': {'key': 'properties.siteConfig', 'type': 'SiteConfig'}, + 'traffic_manager_host_names': {'key': 'properties.trafficManagerHostNames', 'type': '[str]'}, + 'scm_site_also_stopped': {'key': 'properties.scmSiteAlsoStopped', 'type': 'bool'}, + 'target_swap_slot': {'key': 'properties.targetSwapSlot', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'client_affinity_enabled': {'key': 'properties.clientAffinityEnabled', 'type': 'bool'}, + 'client_cert_enabled': {'key': 'properties.clientCertEnabled', 'type': 'bool'}, + 'client_cert_mode': {'key': 'properties.clientCertMode', 'type': 'str'}, + 'client_cert_exclusion_paths': {'key': 'properties.clientCertExclusionPaths', 'type': 'str'}, + 'host_names_disabled': {'key': 'properties.hostNamesDisabled', 'type': 'bool'}, + 'custom_domain_verification_id': {'key': 'properties.customDomainVerificationId', 'type': 'str'}, + 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': 'str'}, + 'possible_outbound_ip_addresses': {'key': 'properties.possibleOutboundIpAddresses', 'type': 'str'}, + 'container_size': {'key': 'properties.containerSize', 'type': 'int'}, + 'daily_memory_time_quota': {'key': 'properties.dailyMemoryTimeQuota', 'type': 'int'}, + 'suspended_till': {'key': 'properties.suspendedTill', 'type': 'iso-8601'}, + 'max_number_of_workers': {'key': 'properties.maxNumberOfWorkers', 'type': 'int'}, + 'cloning_info': {'key': 'properties.cloningInfo', 'type': 'CloningInfo'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'is_default_container': {'key': 'properties.isDefaultContainer', 'type': 'bool'}, + 'default_host_name': {'key': 'properties.defaultHostName', 'type': 'str'}, + 'slot_swap_status': {'key': 'properties.slotSwapStatus', 'type': 'SlotSwapStatus'}, + 'https_only': {'key': 'properties.httpsOnly', 'type': 'bool'}, + 'redundancy_mode': {'key': 'properties.redundancyMode', 'type': 'str'}, + 'in_progress_operation_id': {'key': 'properties.inProgressOperationId', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, + enabled: Optional[bool] = None, + host_name_ssl_states: Optional[List["HostNameSslState"]] = None, + server_farm_id: Optional[str] = None, + reserved: Optional[bool] = False, + is_xenon: Optional[bool] = False, + hyper_v: Optional[bool] = False, + site_config: Optional["SiteConfig"] = None, + scm_site_also_stopped: Optional[bool] = False, + hosting_environment_profile: Optional["HostingEnvironmentProfile"] = None, + client_affinity_enabled: Optional[bool] = None, + client_cert_enabled: Optional[bool] = None, + client_cert_mode: Optional[Union[str, "ClientCertMode"]] = None, + client_cert_exclusion_paths: Optional[str] = None, + host_names_disabled: Optional[bool] = None, + custom_domain_verification_id: Optional[str] = None, + container_size: Optional[int] = None, + daily_memory_time_quota: Optional[int] = None, + cloning_info: Optional["CloningInfo"] = None, + https_only: Optional[bool] = None, + redundancy_mode: Optional[Union[str, "RedundancyMode"]] = None, + **kwargs + ): + super(Site, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.identity = identity + self.state = None + self.host_names = None + self.repository_site_name = None + self.usage_state = None + self.enabled = enabled + self.enabled_host_names = None + self.availability_state = None + self.host_name_ssl_states = host_name_ssl_states + self.server_farm_id = server_farm_id + self.reserved = reserved + self.is_xenon = is_xenon + self.hyper_v = hyper_v + self.last_modified_time_utc = None + self.site_config = site_config + self.traffic_manager_host_names = None + self.scm_site_also_stopped = scm_site_also_stopped + self.target_swap_slot = None + self.hosting_environment_profile = hosting_environment_profile + self.client_affinity_enabled = client_affinity_enabled + self.client_cert_enabled = client_cert_enabled + self.client_cert_mode = client_cert_mode + self.client_cert_exclusion_paths = client_cert_exclusion_paths + self.host_names_disabled = host_names_disabled + self.custom_domain_verification_id = custom_domain_verification_id + self.outbound_ip_addresses = None + self.possible_outbound_ip_addresses = None + self.container_size = container_size + self.daily_memory_time_quota = daily_memory_time_quota + self.suspended_till = None + self.max_number_of_workers = None + self.cloning_info = cloning_info + self.resource_group = None + self.is_default_container = None + self.default_host_name = None + self.slot_swap_status = None + self.https_only = https_only + self.redundancy_mode = redundancy_mode + self.in_progress_operation_id = None + + +class SiteAuthSettings(ProxyOnlyResource): + """Configuration settings for the Azure App Service Authentication / Authorization feature. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: :code:`true` if the Authentication / Authorization feature is + enabled for the current app; otherwise, :code:`false`. + :type enabled: bool + :param runtime_version: The RuntimeVersion of the Authentication / Authorization feature in use + for the current app. + The setting in this value can control the behavior of certain features in the Authentication / + Authorization module. + :type runtime_version: str + :param unauthenticated_client_action: The action to take when an unauthenticated client + attempts to access the app. Possible values include: "RedirectToLoginPage", "AllowAnonymous". + :type unauthenticated_client_action: str or + ~azure.mgmt.web.v2020_06_01.models.UnauthenticatedClientAction + :param token_store_enabled: :code:`true` to durably store platform-specific + security tokens that are obtained during login flows; otherwise, :code:`false`. + The default is :code:`false`. + :type token_store_enabled: bool + :param allowed_external_redirect_urls: External URLs that can be redirected to as part of + logging in or logging out of the app. Note that the query string part of the URL is ignored. + This is an advanced setting typically only needed by Windows Store application backends. + Note that URLs within the current domain are always implicitly allowed. + :type allowed_external_redirect_urls: list[str] + :param default_provider: The default authentication provider to use when multiple providers are + configured. + This setting is only needed if multiple providers are configured and the unauthenticated + client + action is set to "RedirectToLoginPage". Possible values include: "AzureActiveDirectory", + "Facebook", "Google", "MicrosoftAccount", "Twitter", "Github". + :type default_provider: str or ~azure.mgmt.web.v2020_06_01.models.BuiltInAuthenticationProvider + :param token_refresh_extension_hours: The number of hours after session token expiration that a + session token can be used to + call the token refresh API. The default is 72 hours. + :type token_refresh_extension_hours: float + :param client_id: The Client ID of this relying party application, known as the client_id. + This setting is required for enabling OpenID Connection authentication with Azure Active + Directory or + other 3rd party OpenID Connect providers. + More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. + :type client_id: str + :param client_secret: The Client Secret of this relying party application (in Azure Active + Directory, this is also referred to as the Key). + This setting is optional. If no client secret is configured, the OpenID Connect implicit auth + flow is used to authenticate end users. + Otherwise, the OpenID Connect Authorization Code Flow is used to authenticate end users. + More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. + :type client_secret: str + :param client_secret_setting_name: The app setting name that contains the client secret of the + relying party application. + :type client_secret_setting_name: str + :param client_secret_certificate_thumbprint: An alternative to the client secret, that is the + thumbprint of a certificate used for signing purposes. This property acts as + a replacement for the Client Secret. It is also optional. + :type client_secret_certificate_thumbprint: str + :param issuer: The OpenID Connect Issuer URI that represents the entity which issues access + tokens for this application. + When using Azure Active Directory, this value is the URI of the directory tenant, e.g. + https://sts.windows.net/{tenant-guid}/. + This URI is a case-sensitive identifier for the token issuer. + More information on OpenID Connect Discovery: http://openid.net/specs/openid-connect- + discovery-1_0.html. + :type issuer: str + :param validate_issuer: Gets a value indicating whether the issuer should be a valid HTTPS url + and be validated as such. + :type validate_issuer: bool + :param allowed_audiences: Allowed audience values to consider when validating JWTs issued by + Azure Active Directory. Note that the :code:`ClientID` value is always considered + an + allowed audience, regardless of this setting. + :type allowed_audiences: list[str] + :param additional_login_params: Login parameters to send to the OpenID Connect authorization + endpoint when + a user logs in. Each parameter must be in the form "key=value". + :type additional_login_params: list[str] + :param aad_claims_authorization: Gets a JSON string containing the Azure AD Acl settings. + :type aad_claims_authorization: str + :param google_client_id: The OpenID Connect Client ID for the Google web application. + This setting is required for enabling Google Sign-In. + Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + :type google_client_id: str + :param google_client_secret: The client secret associated with the Google web application. + This setting is required for enabling Google Sign-In. + Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + :type google_client_secret: str + :param google_client_secret_setting_name: The app setting name that contains the client secret + associated with + the Google web application. + :type google_client_secret_setting_name: str + :param google_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of Google + Sign-In authentication. + This setting is optional. If not specified, "openid", "profile", and "email" are used as + default scopes. + Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + :type google_o_auth_scopes: list[str] + :param facebook_app_id: The App ID of the Facebook app used for login. + This setting is required for enabling Facebook Login. + Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + :type facebook_app_id: str + :param facebook_app_secret: The App Secret of the Facebook app used for Facebook Login. + This setting is required for enabling Facebook Login. + Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + :type facebook_app_secret: str + :param facebook_app_secret_setting_name: The app setting name that contains the app secret used + for Facebook Login. + :type facebook_app_secret_setting_name: str + :param facebook_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of Facebook + Login authentication. + This setting is optional. + Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + :type facebook_o_auth_scopes: list[str] + :param git_hub_client_id: The Client Id of the GitHub app used for login. + This setting is required for enabling Github login. + :type git_hub_client_id: str + :param git_hub_client_secret: The Client Secret of the GitHub app used for Github Login. + This setting is required for enabling Github login. + :type git_hub_client_secret: str + :param git_hub_client_secret_setting_name: The app setting name that contains the client secret + of the Github + app used for GitHub Login. + :type git_hub_client_secret_setting_name: str + :param git_hub_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of GitHub + Login authentication. + This setting is optional. + :type git_hub_o_auth_scopes: list[str] + :param twitter_consumer_key: The OAuth 1.0a consumer key of the Twitter application used for + sign-in. + This setting is required for enabling Twitter Sign-In. + Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. + :type twitter_consumer_key: str + :param twitter_consumer_secret: The OAuth 1.0a consumer secret of the Twitter application used + for sign-in. + This setting is required for enabling Twitter Sign-In. + Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. + :type twitter_consumer_secret: str + :param twitter_consumer_secret_setting_name: The app setting name that contains the OAuth 1.0a + consumer secret of the Twitter + application used for sign-in. + :type twitter_consumer_secret_setting_name: str + :param microsoft_account_client_id: The OAuth 2.0 client ID that was created for the app used + for authentication. + This setting is required for enabling Microsoft Account authentication. + Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm. + :type microsoft_account_client_id: str + :param microsoft_account_client_secret: The OAuth 2.0 client secret that was created for the + app used for authentication. + This setting is required for enabling Microsoft Account authentication. + Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm. + :type microsoft_account_client_secret: str + :param microsoft_account_client_secret_setting_name: The app setting name containing the OAuth + 2.0 client secret that was created for the + app used for authentication. + :type microsoft_account_client_secret_setting_name: str + :param microsoft_account_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of + Microsoft Account authentication. + This setting is optional. If not specified, "wl.basic" is used as the default scope. + Microsoft Account Scopes and permissions documentation: https://msdn.microsoft.com/en- + us/library/dn631845.aspx. + :type microsoft_account_o_auth_scopes: list[str] + :param is_auth_from_file: "true" if the auth config settings should be read from a file, + "false" otherwise. + :type is_auth_from_file: str + :param auth_file_path: The path of the config file containing auth settings. + If the path is relative, base will the site's root directory. + :type auth_file_path: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'runtime_version': {'key': 'properties.runtimeVersion', 'type': 'str'}, + 'unauthenticated_client_action': {'key': 'properties.unauthenticatedClientAction', 'type': 'str'}, + 'token_store_enabled': {'key': 'properties.tokenStoreEnabled', 'type': 'bool'}, + 'allowed_external_redirect_urls': {'key': 'properties.allowedExternalRedirectUrls', 'type': '[str]'}, + 'default_provider': {'key': 'properties.defaultProvider', 'type': 'str'}, + 'token_refresh_extension_hours': {'key': 'properties.tokenRefreshExtensionHours', 'type': 'float'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_secret_certificate_thumbprint': {'key': 'properties.clientSecretCertificateThumbprint', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'validate_issuer': {'key': 'properties.validateIssuer', 'type': 'bool'}, + 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + 'additional_login_params': {'key': 'properties.additionalLoginParams', 'type': '[str]'}, + 'aad_claims_authorization': {'key': 'properties.aadClaimsAuthorization', 'type': 'str'}, + 'google_client_id': {'key': 'properties.googleClientId', 'type': 'str'}, + 'google_client_secret': {'key': 'properties.googleClientSecret', 'type': 'str'}, + 'google_client_secret_setting_name': {'key': 'properties.googleClientSecretSettingName', 'type': 'str'}, + 'google_o_auth_scopes': {'key': 'properties.googleOAuthScopes', 'type': '[str]'}, + 'facebook_app_id': {'key': 'properties.facebookAppId', 'type': 'str'}, + 'facebook_app_secret': {'key': 'properties.facebookAppSecret', 'type': 'str'}, + 'facebook_app_secret_setting_name': {'key': 'properties.facebookAppSecretSettingName', 'type': 'str'}, + 'facebook_o_auth_scopes': {'key': 'properties.facebookOAuthScopes', 'type': '[str]'}, + 'git_hub_client_id': {'key': 'properties.gitHubClientId', 'type': 'str'}, + 'git_hub_client_secret': {'key': 'properties.gitHubClientSecret', 'type': 'str'}, + 'git_hub_client_secret_setting_name': {'key': 'properties.gitHubClientSecretSettingName', 'type': 'str'}, + 'git_hub_o_auth_scopes': {'key': 'properties.gitHubOAuthScopes', 'type': '[str]'}, + 'twitter_consumer_key': {'key': 'properties.twitterConsumerKey', 'type': 'str'}, + 'twitter_consumer_secret': {'key': 'properties.twitterConsumerSecret', 'type': 'str'}, + 'twitter_consumer_secret_setting_name': {'key': 'properties.twitterConsumerSecretSettingName', 'type': 'str'}, + 'microsoft_account_client_id': {'key': 'properties.microsoftAccountClientId', 'type': 'str'}, + 'microsoft_account_client_secret': {'key': 'properties.microsoftAccountClientSecret', 'type': 'str'}, + 'microsoft_account_client_secret_setting_name': {'key': 'properties.microsoftAccountClientSecretSettingName', 'type': 'str'}, + 'microsoft_account_o_auth_scopes': {'key': 'properties.microsoftAccountOAuthScopes', 'type': '[str]'}, + 'is_auth_from_file': {'key': 'properties.isAuthFromFile', 'type': 'str'}, + 'auth_file_path': {'key': 'properties.authFilePath', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + runtime_version: Optional[str] = None, + unauthenticated_client_action: Optional[Union[str, "UnauthenticatedClientAction"]] = None, + token_store_enabled: Optional[bool] = None, + allowed_external_redirect_urls: Optional[List[str]] = None, + default_provider: Optional[Union[str, "BuiltInAuthenticationProvider"]] = None, + token_refresh_extension_hours: Optional[float] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + client_secret_setting_name: Optional[str] = None, + client_secret_certificate_thumbprint: Optional[str] = None, + issuer: Optional[str] = None, + validate_issuer: Optional[bool] = None, + allowed_audiences: Optional[List[str]] = None, + additional_login_params: Optional[List[str]] = None, + aad_claims_authorization: Optional[str] = None, + google_client_id: Optional[str] = None, + google_client_secret: Optional[str] = None, + google_client_secret_setting_name: Optional[str] = None, + google_o_auth_scopes: Optional[List[str]] = None, + facebook_app_id: Optional[str] = None, + facebook_app_secret: Optional[str] = None, + facebook_app_secret_setting_name: Optional[str] = None, + facebook_o_auth_scopes: Optional[List[str]] = None, + git_hub_client_id: Optional[str] = None, + git_hub_client_secret: Optional[str] = None, + git_hub_client_secret_setting_name: Optional[str] = None, + git_hub_o_auth_scopes: Optional[List[str]] = None, + twitter_consumer_key: Optional[str] = None, + twitter_consumer_secret: Optional[str] = None, + twitter_consumer_secret_setting_name: Optional[str] = None, + microsoft_account_client_id: Optional[str] = None, + microsoft_account_client_secret: Optional[str] = None, + microsoft_account_client_secret_setting_name: Optional[str] = None, + microsoft_account_o_auth_scopes: Optional[List[str]] = None, + is_auth_from_file: Optional[str] = None, + auth_file_path: Optional[str] = None, + **kwargs + ): + super(SiteAuthSettings, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.runtime_version = runtime_version + self.unauthenticated_client_action = unauthenticated_client_action + self.token_store_enabled = token_store_enabled + self.allowed_external_redirect_urls = allowed_external_redirect_urls + self.default_provider = default_provider + self.token_refresh_extension_hours = token_refresh_extension_hours + self.client_id = client_id + self.client_secret = client_secret + self.client_secret_setting_name = client_secret_setting_name + self.client_secret_certificate_thumbprint = client_secret_certificate_thumbprint + self.issuer = issuer + self.validate_issuer = validate_issuer + self.allowed_audiences = allowed_audiences + self.additional_login_params = additional_login_params + self.aad_claims_authorization = aad_claims_authorization + self.google_client_id = google_client_id + self.google_client_secret = google_client_secret + self.google_client_secret_setting_name = google_client_secret_setting_name + self.google_o_auth_scopes = google_o_auth_scopes + self.facebook_app_id = facebook_app_id + self.facebook_app_secret = facebook_app_secret + self.facebook_app_secret_setting_name = facebook_app_secret_setting_name + self.facebook_o_auth_scopes = facebook_o_auth_scopes + self.git_hub_client_id = git_hub_client_id + self.git_hub_client_secret = git_hub_client_secret + self.git_hub_client_secret_setting_name = git_hub_client_secret_setting_name + self.git_hub_o_auth_scopes = git_hub_o_auth_scopes + self.twitter_consumer_key = twitter_consumer_key + self.twitter_consumer_secret = twitter_consumer_secret + self.twitter_consumer_secret_setting_name = twitter_consumer_secret_setting_name + self.microsoft_account_client_id = microsoft_account_client_id + self.microsoft_account_client_secret = microsoft_account_client_secret + self.microsoft_account_client_secret_setting_name = microsoft_account_client_secret_setting_name + self.microsoft_account_o_auth_scopes = microsoft_account_o_auth_scopes + self.is_auth_from_file = is_auth_from_file + self.auth_file_path = auth_file_path + + +class SiteAuthSettingsV2(ProxyOnlyResource): + """SiteAuthSettingsV2. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param platform: + :type platform: ~azure.mgmt.web.v2020_06_01.models.AuthPlatform + :param global_validation: + :type global_validation: ~azure.mgmt.web.v2020_06_01.models.GlobalValidation + :param identity_providers: + :type identity_providers: ~azure.mgmt.web.v2020_06_01.models.IdentityProviders + :param login: + :type login: ~azure.mgmt.web.v2020_06_01.models.Login + :param http_settings: + :type http_settings: ~azure.mgmt.web.v2020_06_01.models.HttpSettings + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'platform': {'key': 'properties.platform', 'type': 'AuthPlatform'}, + 'global_validation': {'key': 'properties.globalValidation', 'type': 'GlobalValidation'}, + 'identity_providers': {'key': 'properties.identityProviders', 'type': 'IdentityProviders'}, + 'login': {'key': 'properties.login', 'type': 'Login'}, + 'http_settings': {'key': 'properties.httpSettings', 'type': 'HttpSettings'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + platform: Optional["AuthPlatform"] = None, + global_validation: Optional["GlobalValidation"] = None, + identity_providers: Optional["IdentityProviders"] = None, + login: Optional["Login"] = None, + http_settings: Optional["HttpSettings"] = None, + **kwargs + ): + super(SiteAuthSettingsV2, self).__init__(kind=kind, **kwargs) + self.platform = platform + self.global_validation = global_validation + self.identity_providers = identity_providers + self.login = login + self.http_settings = http_settings + + +class SiteCloneability(msrest.serialization.Model): + """Represents whether or not an app is cloneable. + + :param result: Name of app. Possible values include: "Cloneable", "PartiallyCloneable", + "NotCloneable". + :type result: str or ~azure.mgmt.web.v2020_06_01.models.CloneAbilityResult + :param blocking_features: List of features enabled on app that prevent cloning. + :type blocking_features: list[~azure.mgmt.web.v2020_06_01.models.SiteCloneabilityCriterion] + :param unsupported_features: List of features enabled on app that are non-blocking but cannot + be cloned. The app can still be cloned + but the features in this list will not be set up on cloned app. + :type unsupported_features: list[~azure.mgmt.web.v2020_06_01.models.SiteCloneabilityCriterion] + :param blocking_characteristics: List of blocking application characteristics. + :type blocking_characteristics: + list[~azure.mgmt.web.v2020_06_01.models.SiteCloneabilityCriterion] + """ + + _attribute_map = { + 'result': {'key': 'result', 'type': 'str'}, + 'blocking_features': {'key': 'blockingFeatures', 'type': '[SiteCloneabilityCriterion]'}, + 'unsupported_features': {'key': 'unsupportedFeatures', 'type': '[SiteCloneabilityCriterion]'}, + 'blocking_characteristics': {'key': 'blockingCharacteristics', 'type': '[SiteCloneabilityCriterion]'}, + } + + def __init__( + self, + *, + result: Optional[Union[str, "CloneAbilityResult"]] = None, + blocking_features: Optional[List["SiteCloneabilityCriterion"]] = None, + unsupported_features: Optional[List["SiteCloneabilityCriterion"]] = None, + blocking_characteristics: Optional[List["SiteCloneabilityCriterion"]] = None, + **kwargs + ): + super(SiteCloneability, self).__init__(**kwargs) + self.result = result + self.blocking_features = blocking_features + self.unsupported_features = unsupported_features + self.blocking_characteristics = blocking_characteristics + + +class SiteCloneabilityCriterion(msrest.serialization.Model): + """An app cloneability criterion. + + :param name: Name of criterion. + :type name: str + :param description: Description of criterion. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(SiteCloneabilityCriterion, self).__init__(**kwargs) + self.name = name + self.description = description + + +class SiteConfig(msrest.serialization.Model): + """Configuration of an App Service app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param number_of_workers: Number of workers. + :type number_of_workers: int + :param default_documents: Default documents. + :type default_documents: list[str] + :param net_framework_version: .NET Framework version. + :type net_framework_version: str + :param php_version: Version of PHP. + :type php_version: str + :param python_version: Version of Python. + :type python_version: str + :param node_version: Version of Node.js. + :type node_version: str + :param power_shell_version: Version of PowerShell. + :type power_shell_version: str + :param linux_fx_version: Linux App Framework and version. + :type linux_fx_version: str + :param windows_fx_version: Xenon App Framework and version. + :type windows_fx_version: str + :param request_tracing_enabled: :code:`true` if request tracing is enabled; + otherwise, :code:`false`. + :type request_tracing_enabled: bool + :param request_tracing_expiration_time: Request tracing expiration time. + :type request_tracing_expiration_time: ~datetime.datetime + :param remote_debugging_enabled: :code:`true` if remote debugging is enabled; + otherwise, :code:`false`. + :type remote_debugging_enabled: bool + :param remote_debugging_version: Remote debugging version. + :type remote_debugging_version: str + :param http_logging_enabled: :code:`true` if HTTP logging is enabled; otherwise, + :code:`false`. + :type http_logging_enabled: bool + :param logs_directory_size_limit: HTTP logs directory size limit. + :type logs_directory_size_limit: int + :param detailed_error_logging_enabled: :code:`true` if detailed error logging is + enabled; otherwise, :code:`false`. + :type detailed_error_logging_enabled: bool + :param publishing_username: Publishing user name. + :type publishing_username: str + :param app_settings: Application settings. + :type app_settings: list[~azure.mgmt.web.v2020_06_01.models.NameValuePair] + :param connection_strings: Connection strings. + :type connection_strings: list[~azure.mgmt.web.v2020_06_01.models.ConnStringInfo] + :ivar machine_key: Site MachineKey. + :vartype machine_key: ~azure.mgmt.web.v2020_06_01.models.SiteMachineKey + :param handler_mappings: Handler mappings. + :type handler_mappings: list[~azure.mgmt.web.v2020_06_01.models.HandlerMapping] + :param document_root: Document root. + :type document_root: str + :param scm_type: SCM type. Possible values include: "None", "Dropbox", "Tfs", "LocalGit", + "GitHub", "CodePlexGit", "CodePlexHg", "BitbucketGit", "BitbucketHg", "ExternalGit", + "ExternalHg", "OneDrive", "VSO", "VSTSRM". + :type scm_type: str or ~azure.mgmt.web.v2020_06_01.models.ScmType + :param use32_bit_worker_process: :code:`true` to use 32-bit worker process; + otherwise, :code:`false`. + :type use32_bit_worker_process: bool + :param web_sockets_enabled: :code:`true` if WebSocket is enabled; otherwise, + :code:`false`. + :type web_sockets_enabled: bool + :param always_on: :code:`true` if Always On is enabled; otherwise, + :code:`false`. + :type always_on: bool + :param java_version: Java version. + :type java_version: str + :param java_container: Java container. + :type java_container: str + :param java_container_version: Java container version. + :type java_container_version: str + :param app_command_line: App command line to launch. + :type app_command_line: str + :param managed_pipeline_mode: Managed pipeline mode. Possible values include: "Integrated", + "Classic". + :type managed_pipeline_mode: str or ~azure.mgmt.web.v2020_06_01.models.ManagedPipelineMode + :param virtual_applications: Virtual applications. + :type virtual_applications: list[~azure.mgmt.web.v2020_06_01.models.VirtualApplication] + :param load_balancing: Site load balancing. Possible values include: "WeightedRoundRobin", + "LeastRequests", "LeastResponseTime", "WeightedTotalTraffic", "RequestHash". + :type load_balancing: str or ~azure.mgmt.web.v2020_06_01.models.SiteLoadBalancing + :param experiments: This is work around for polymorphic types. + :type experiments: ~azure.mgmt.web.v2020_06_01.models.Experiments + :param limits: Site limits. + :type limits: ~azure.mgmt.web.v2020_06_01.models.SiteLimits + :param auto_heal_enabled: :code:`true` if Auto Heal is enabled; otherwise, + :code:`false`. + :type auto_heal_enabled: bool + :param auto_heal_rules: Auto Heal rules. + :type auto_heal_rules: ~azure.mgmt.web.v2020_06_01.models.AutoHealRules + :param tracing_options: Tracing options. + :type tracing_options: str + :param vnet_name: Virtual Network name. + :type vnet_name: str + :param vnet_route_all_enabled: Virtual Network Route All enabled. This causes all outbound + traffic to have Virtual Network Security Groups and User Defined Routes applied. + :type vnet_route_all_enabled: bool + :param vnet_private_ports_count: The number of private ports assigned to this app. These will + be assigned dynamically on runtime. + :type vnet_private_ports_count: int + :param cors: Cross-Origin Resource Sharing (CORS) settings. + :type cors: ~azure.mgmt.web.v2020_06_01.models.CorsSettings + :param push: Push endpoint settings. + :type push: ~azure.mgmt.web.v2020_06_01.models.PushSettings + :param api_definition: Information about the formal API definition for the app. + :type api_definition: ~azure.mgmt.web.v2020_06_01.models.ApiDefinitionInfo + :param api_management_config: Azure API management settings linked to the app. + :type api_management_config: ~azure.mgmt.web.v2020_06_01.models.ApiManagementConfig + :param auto_swap_slot_name: Auto-swap slot name. + :type auto_swap_slot_name: str + :param local_my_sql_enabled: :code:`true` to enable local MySQL; otherwise, + :code:`false`. + :type local_my_sql_enabled: bool + :param managed_service_identity_id: Managed Service Identity Id. + :type managed_service_identity_id: int + :param x_managed_service_identity_id: Explicit Managed Service Identity Id. + :type x_managed_service_identity_id: int + :param ip_security_restrictions: IP security restrictions for main. + :type ip_security_restrictions: list[~azure.mgmt.web.v2020_06_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions: IP security restrictions for scm. + :type scm_ip_security_restrictions: + list[~azure.mgmt.web.v2020_06_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions_use_main: IP security restrictions for scm to use main. + :type scm_ip_security_restrictions_use_main: bool + :param http20_enabled: Http20Enabled: configures a web site to allow clients to connect over + http2.0. + :type http20_enabled: bool + :param min_tls_version: MinTlsVersion: configures the minimum version of TLS required for SSL + requests. Possible values include: "1.0", "1.1", "1.2". + :type min_tls_version: str or ~azure.mgmt.web.v2020_06_01.models.SupportedTlsVersions + :param scm_min_tls_version: ScmMinTlsVersion: configures the minimum version of TLS required + for SSL requests for SCM site. Possible values include: "1.0", "1.1", "1.2". + :type scm_min_tls_version: str or ~azure.mgmt.web.v2020_06_01.models.SupportedTlsVersions + :param ftps_state: State of FTP / FTPS service. Possible values include: "AllAllowed", + "FtpsOnly", "Disabled". + :type ftps_state: str or ~azure.mgmt.web.v2020_06_01.models.FtpsState + :param pre_warmed_instance_count: Number of preWarmed instances. + This setting only applies to the Consumption and Elastic Plans. + :type pre_warmed_instance_count: int + :param health_check_path: Health check path. + :type health_check_path: str + """ + + _validation = { + 'machine_key': {'readonly': True}, + 'pre_warmed_instance_count': {'maximum': 10, 'minimum': 0}, + } + + _attribute_map = { + 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, + 'default_documents': {'key': 'defaultDocuments', 'type': '[str]'}, + 'net_framework_version': {'key': 'netFrameworkVersion', 'type': 'str'}, + 'php_version': {'key': 'phpVersion', 'type': 'str'}, + 'python_version': {'key': 'pythonVersion', 'type': 'str'}, + 'node_version': {'key': 'nodeVersion', 'type': 'str'}, + 'power_shell_version': {'key': 'powerShellVersion', 'type': 'str'}, + 'linux_fx_version': {'key': 'linuxFxVersion', 'type': 'str'}, + 'windows_fx_version': {'key': 'windowsFxVersion', 'type': 'str'}, + 'request_tracing_enabled': {'key': 'requestTracingEnabled', 'type': 'bool'}, + 'request_tracing_expiration_time': {'key': 'requestTracingExpirationTime', 'type': 'iso-8601'}, + 'remote_debugging_enabled': {'key': 'remoteDebuggingEnabled', 'type': 'bool'}, + 'remote_debugging_version': {'key': 'remoteDebuggingVersion', 'type': 'str'}, + 'http_logging_enabled': {'key': 'httpLoggingEnabled', 'type': 'bool'}, + 'logs_directory_size_limit': {'key': 'logsDirectorySizeLimit', 'type': 'int'}, + 'detailed_error_logging_enabled': {'key': 'detailedErrorLoggingEnabled', 'type': 'bool'}, + 'publishing_username': {'key': 'publishingUsername', 'type': 'str'}, + 'app_settings': {'key': 'appSettings', 'type': '[NameValuePair]'}, + 'connection_strings': {'key': 'connectionStrings', 'type': '[ConnStringInfo]'}, + 'machine_key': {'key': 'machineKey', 'type': 'SiteMachineKey'}, + 'handler_mappings': {'key': 'handlerMappings', 'type': '[HandlerMapping]'}, + 'document_root': {'key': 'documentRoot', 'type': 'str'}, + 'scm_type': {'key': 'scmType', 'type': 'str'}, + 'use32_bit_worker_process': {'key': 'use32BitWorkerProcess', 'type': 'bool'}, + 'web_sockets_enabled': {'key': 'webSocketsEnabled', 'type': 'bool'}, + 'always_on': {'key': 'alwaysOn', 'type': 'bool'}, + 'java_version': {'key': 'javaVersion', 'type': 'str'}, + 'java_container': {'key': 'javaContainer', 'type': 'str'}, + 'java_container_version': {'key': 'javaContainerVersion', 'type': 'str'}, + 'app_command_line': {'key': 'appCommandLine', 'type': 'str'}, + 'managed_pipeline_mode': {'key': 'managedPipelineMode', 'type': 'str'}, + 'virtual_applications': {'key': 'virtualApplications', 'type': '[VirtualApplication]'}, + 'load_balancing': {'key': 'loadBalancing', 'type': 'str'}, + 'experiments': {'key': 'experiments', 'type': 'Experiments'}, + 'limits': {'key': 'limits', 'type': 'SiteLimits'}, + 'auto_heal_enabled': {'key': 'autoHealEnabled', 'type': 'bool'}, + 'auto_heal_rules': {'key': 'autoHealRules', 'type': 'AutoHealRules'}, + 'tracing_options': {'key': 'tracingOptions', 'type': 'str'}, + 'vnet_name': {'key': 'vnetName', 'type': 'str'}, + 'vnet_route_all_enabled': {'key': 'vnetRouteAllEnabled', 'type': 'bool'}, + 'vnet_private_ports_count': {'key': 'vnetPrivatePortsCount', 'type': 'int'}, + 'cors': {'key': 'cors', 'type': 'CorsSettings'}, + 'push': {'key': 'push', 'type': 'PushSettings'}, + 'api_definition': {'key': 'apiDefinition', 'type': 'ApiDefinitionInfo'}, + 'api_management_config': {'key': 'apiManagementConfig', 'type': 'ApiManagementConfig'}, + 'auto_swap_slot_name': {'key': 'autoSwapSlotName', 'type': 'str'}, + 'local_my_sql_enabled': {'key': 'localMySqlEnabled', 'type': 'bool'}, + 'managed_service_identity_id': {'key': 'managedServiceIdentityId', 'type': 'int'}, + 'x_managed_service_identity_id': {'key': 'xManagedServiceIdentityId', 'type': 'int'}, + 'ip_security_restrictions': {'key': 'ipSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions': {'key': 'scmIpSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions_use_main': {'key': 'scmIpSecurityRestrictionsUseMain', 'type': 'bool'}, + 'http20_enabled': {'key': 'http20Enabled', 'type': 'bool'}, + 'min_tls_version': {'key': 'minTlsVersion', 'type': 'str'}, + 'scm_min_tls_version': {'key': 'scmMinTlsVersion', 'type': 'str'}, + 'ftps_state': {'key': 'ftpsState', 'type': 'str'}, + 'pre_warmed_instance_count': {'key': 'preWarmedInstanceCount', 'type': 'int'}, + 'health_check_path': {'key': 'healthCheckPath', 'type': 'str'}, + } + + def __init__( + self, + *, + number_of_workers: Optional[int] = None, + default_documents: Optional[List[str]] = None, + net_framework_version: Optional[str] = "v4.6", + php_version: Optional[str] = None, + python_version: Optional[str] = None, + node_version: Optional[str] = None, + power_shell_version: Optional[str] = None, + linux_fx_version: Optional[str] = None, + windows_fx_version: Optional[str] = None, + request_tracing_enabled: Optional[bool] = None, + request_tracing_expiration_time: Optional[datetime.datetime] = None, + remote_debugging_enabled: Optional[bool] = None, + remote_debugging_version: Optional[str] = None, + http_logging_enabled: Optional[bool] = None, + logs_directory_size_limit: Optional[int] = None, + detailed_error_logging_enabled: Optional[bool] = None, + publishing_username: Optional[str] = None, + app_settings: Optional[List["NameValuePair"]] = None, + connection_strings: Optional[List["ConnStringInfo"]] = None, + handler_mappings: Optional[List["HandlerMapping"]] = None, + document_root: Optional[str] = None, + scm_type: Optional[Union[str, "ScmType"]] = None, + use32_bit_worker_process: Optional[bool] = None, + web_sockets_enabled: Optional[bool] = None, + always_on: Optional[bool] = None, + java_version: Optional[str] = None, + java_container: Optional[str] = None, + java_container_version: Optional[str] = None, + app_command_line: Optional[str] = None, + managed_pipeline_mode: Optional[Union[str, "ManagedPipelineMode"]] = None, + virtual_applications: Optional[List["VirtualApplication"]] = None, + load_balancing: Optional[Union[str, "SiteLoadBalancing"]] = None, + experiments: Optional["Experiments"] = None, + limits: Optional["SiteLimits"] = None, + auto_heal_enabled: Optional[bool] = None, + auto_heal_rules: Optional["AutoHealRules"] = None, + tracing_options: Optional[str] = None, + vnet_name: Optional[str] = None, + vnet_route_all_enabled: Optional[bool] = None, + vnet_private_ports_count: Optional[int] = None, + cors: Optional["CorsSettings"] = None, + push: Optional["PushSettings"] = None, + api_definition: Optional["ApiDefinitionInfo"] = None, + api_management_config: Optional["ApiManagementConfig"] = None, + auto_swap_slot_name: Optional[str] = None, + local_my_sql_enabled: Optional[bool] = False, + managed_service_identity_id: Optional[int] = None, + x_managed_service_identity_id: Optional[int] = None, + ip_security_restrictions: Optional[List["IpSecurityRestriction"]] = None, + scm_ip_security_restrictions: Optional[List["IpSecurityRestriction"]] = None, + scm_ip_security_restrictions_use_main: Optional[bool] = None, + http20_enabled: Optional[bool] = True, + min_tls_version: Optional[Union[str, "SupportedTlsVersions"]] = None, + scm_min_tls_version: Optional[Union[str, "SupportedTlsVersions"]] = None, + ftps_state: Optional[Union[str, "FtpsState"]] = None, + pre_warmed_instance_count: Optional[int] = None, + health_check_path: Optional[str] = None, + **kwargs + ): + super(SiteConfig, self).__init__(**kwargs) + self.number_of_workers = number_of_workers + self.default_documents = default_documents + self.net_framework_version = net_framework_version + self.php_version = php_version + self.python_version = python_version + self.node_version = node_version + self.power_shell_version = power_shell_version + self.linux_fx_version = linux_fx_version + self.windows_fx_version = windows_fx_version + self.request_tracing_enabled = request_tracing_enabled + self.request_tracing_expiration_time = request_tracing_expiration_time + self.remote_debugging_enabled = remote_debugging_enabled + self.remote_debugging_version = remote_debugging_version + self.http_logging_enabled = http_logging_enabled + self.logs_directory_size_limit = logs_directory_size_limit + self.detailed_error_logging_enabled = detailed_error_logging_enabled + self.publishing_username = publishing_username + self.app_settings = app_settings + self.connection_strings = connection_strings + self.machine_key = None + self.handler_mappings = handler_mappings + self.document_root = document_root + self.scm_type = scm_type + self.use32_bit_worker_process = use32_bit_worker_process + self.web_sockets_enabled = web_sockets_enabled + self.always_on = always_on + self.java_version = java_version + self.java_container = java_container + self.java_container_version = java_container_version + self.app_command_line = app_command_line + self.managed_pipeline_mode = managed_pipeline_mode + self.virtual_applications = virtual_applications + self.load_balancing = load_balancing + self.experiments = experiments + self.limits = limits + self.auto_heal_enabled = auto_heal_enabled + self.auto_heal_rules = auto_heal_rules + self.tracing_options = tracing_options + self.vnet_name = vnet_name + self.vnet_route_all_enabled = vnet_route_all_enabled + self.vnet_private_ports_count = vnet_private_ports_count + self.cors = cors + self.push = push + self.api_definition = api_definition + self.api_management_config = api_management_config + self.auto_swap_slot_name = auto_swap_slot_name + self.local_my_sql_enabled = local_my_sql_enabled + self.managed_service_identity_id = managed_service_identity_id + self.x_managed_service_identity_id = x_managed_service_identity_id + self.ip_security_restrictions = ip_security_restrictions + self.scm_ip_security_restrictions = scm_ip_security_restrictions + self.scm_ip_security_restrictions_use_main = scm_ip_security_restrictions_use_main + self.http20_enabled = http20_enabled + self.min_tls_version = min_tls_version + self.scm_min_tls_version = scm_min_tls_version + self.ftps_state = ftps_state + self.pre_warmed_instance_count = pre_warmed_instance_count + self.health_check_path = health_check_path + + +class SiteConfigResource(ProxyOnlyResource): + """Web app configuration ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param number_of_workers: Number of workers. + :type number_of_workers: int + :param default_documents: Default documents. + :type default_documents: list[str] + :param net_framework_version: .NET Framework version. + :type net_framework_version: str + :param php_version: Version of PHP. + :type php_version: str + :param python_version: Version of Python. + :type python_version: str + :param node_version: Version of Node.js. + :type node_version: str + :param power_shell_version: Version of PowerShell. + :type power_shell_version: str + :param linux_fx_version: Linux App Framework and version. + :type linux_fx_version: str + :param windows_fx_version: Xenon App Framework and version. + :type windows_fx_version: str + :param request_tracing_enabled: :code:`true` if request tracing is enabled; + otherwise, :code:`false`. + :type request_tracing_enabled: bool + :param request_tracing_expiration_time: Request tracing expiration time. + :type request_tracing_expiration_time: ~datetime.datetime + :param remote_debugging_enabled: :code:`true` if remote debugging is enabled; + otherwise, :code:`false`. + :type remote_debugging_enabled: bool + :param remote_debugging_version: Remote debugging version. + :type remote_debugging_version: str + :param http_logging_enabled: :code:`true` if HTTP logging is enabled; otherwise, + :code:`false`. + :type http_logging_enabled: bool + :param logs_directory_size_limit: HTTP logs directory size limit. + :type logs_directory_size_limit: int + :param detailed_error_logging_enabled: :code:`true` if detailed error logging is + enabled; otherwise, :code:`false`. + :type detailed_error_logging_enabled: bool + :param publishing_username: Publishing user name. + :type publishing_username: str + :param app_settings: Application settings. + :type app_settings: list[~azure.mgmt.web.v2020_06_01.models.NameValuePair] + :param connection_strings: Connection strings. + :type connection_strings: list[~azure.mgmt.web.v2020_06_01.models.ConnStringInfo] + :ivar machine_key: Site MachineKey. + :vartype machine_key: ~azure.mgmt.web.v2020_06_01.models.SiteMachineKey + :param handler_mappings: Handler mappings. + :type handler_mappings: list[~azure.mgmt.web.v2020_06_01.models.HandlerMapping] + :param document_root: Document root. + :type document_root: str + :param scm_type: SCM type. Possible values include: "None", "Dropbox", "Tfs", "LocalGit", + "GitHub", "CodePlexGit", "CodePlexHg", "BitbucketGit", "BitbucketHg", "ExternalGit", + "ExternalHg", "OneDrive", "VSO", "VSTSRM". + :type scm_type: str or ~azure.mgmt.web.v2020_06_01.models.ScmType + :param use32_bit_worker_process: :code:`true` to use 32-bit worker process; + otherwise, :code:`false`. + :type use32_bit_worker_process: bool + :param web_sockets_enabled: :code:`true` if WebSocket is enabled; otherwise, + :code:`false`. + :type web_sockets_enabled: bool + :param always_on: :code:`true` if Always On is enabled; otherwise, + :code:`false`. + :type always_on: bool + :param java_version: Java version. + :type java_version: str + :param java_container: Java container. + :type java_container: str + :param java_container_version: Java container version. + :type java_container_version: str + :param app_command_line: App command line to launch. + :type app_command_line: str + :param managed_pipeline_mode: Managed pipeline mode. Possible values include: "Integrated", + "Classic". + :type managed_pipeline_mode: str or ~azure.mgmt.web.v2020_06_01.models.ManagedPipelineMode + :param virtual_applications: Virtual applications. + :type virtual_applications: list[~azure.mgmt.web.v2020_06_01.models.VirtualApplication] + :param load_balancing: Site load balancing. Possible values include: "WeightedRoundRobin", + "LeastRequests", "LeastResponseTime", "WeightedTotalTraffic", "RequestHash". + :type load_balancing: str or ~azure.mgmt.web.v2020_06_01.models.SiteLoadBalancing + :param experiments: This is work around for polymorphic types. + :type experiments: ~azure.mgmt.web.v2020_06_01.models.Experiments + :param limits: Site limits. + :type limits: ~azure.mgmt.web.v2020_06_01.models.SiteLimits + :param auto_heal_enabled: :code:`true` if Auto Heal is enabled; otherwise, + :code:`false`. + :type auto_heal_enabled: bool + :param auto_heal_rules: Auto Heal rules. + :type auto_heal_rules: ~azure.mgmt.web.v2020_06_01.models.AutoHealRules + :param tracing_options: Tracing options. + :type tracing_options: str + :param vnet_name: Virtual Network name. + :type vnet_name: str + :param vnet_route_all_enabled: Virtual Network Route All enabled. This causes all outbound + traffic to have Virtual Network Security Groups and User Defined Routes applied. + :type vnet_route_all_enabled: bool + :param vnet_private_ports_count: The number of private ports assigned to this app. These will + be assigned dynamically on runtime. + :type vnet_private_ports_count: int + :param cors: Cross-Origin Resource Sharing (CORS) settings. + :type cors: ~azure.mgmt.web.v2020_06_01.models.CorsSettings + :param push: Push endpoint settings. + :type push: ~azure.mgmt.web.v2020_06_01.models.PushSettings + :param api_definition: Information about the formal API definition for the app. + :type api_definition: ~azure.mgmt.web.v2020_06_01.models.ApiDefinitionInfo + :param api_management_config: Azure API management settings linked to the app. + :type api_management_config: ~azure.mgmt.web.v2020_06_01.models.ApiManagementConfig + :param auto_swap_slot_name: Auto-swap slot name. + :type auto_swap_slot_name: str + :param local_my_sql_enabled: :code:`true` to enable local MySQL; otherwise, + :code:`false`. + :type local_my_sql_enabled: bool + :param managed_service_identity_id: Managed Service Identity Id. + :type managed_service_identity_id: int + :param x_managed_service_identity_id: Explicit Managed Service Identity Id. + :type x_managed_service_identity_id: int + :param ip_security_restrictions: IP security restrictions for main. + :type ip_security_restrictions: list[~azure.mgmt.web.v2020_06_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions: IP security restrictions for scm. + :type scm_ip_security_restrictions: + list[~azure.mgmt.web.v2020_06_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions_use_main: IP security restrictions for scm to use main. + :type scm_ip_security_restrictions_use_main: bool + :param http20_enabled: Http20Enabled: configures a web site to allow clients to connect over + http2.0. + :type http20_enabled: bool + :param min_tls_version: MinTlsVersion: configures the minimum version of TLS required for SSL + requests. Possible values include: "1.0", "1.1", "1.2". + :type min_tls_version: str or ~azure.mgmt.web.v2020_06_01.models.SupportedTlsVersions + :param scm_min_tls_version: ScmMinTlsVersion: configures the minimum version of TLS required + for SSL requests for SCM site. Possible values include: "1.0", "1.1", "1.2". + :type scm_min_tls_version: str or ~azure.mgmt.web.v2020_06_01.models.SupportedTlsVersions + :param ftps_state: State of FTP / FTPS service. Possible values include: "AllAllowed", + "FtpsOnly", "Disabled". + :type ftps_state: str or ~azure.mgmt.web.v2020_06_01.models.FtpsState + :param pre_warmed_instance_count: Number of preWarmed instances. + This setting only applies to the Consumption and Elastic Plans. + :type pre_warmed_instance_count: int + :param health_check_path: Health check path. + :type health_check_path: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'machine_key': {'readonly': True}, + 'pre_warmed_instance_count': {'maximum': 10, 'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'number_of_workers': {'key': 'properties.numberOfWorkers', 'type': 'int'}, + 'default_documents': {'key': 'properties.defaultDocuments', 'type': '[str]'}, + 'net_framework_version': {'key': 'properties.netFrameworkVersion', 'type': 'str'}, + 'php_version': {'key': 'properties.phpVersion', 'type': 'str'}, + 'python_version': {'key': 'properties.pythonVersion', 'type': 'str'}, + 'node_version': {'key': 'properties.nodeVersion', 'type': 'str'}, + 'power_shell_version': {'key': 'properties.powerShellVersion', 'type': 'str'}, + 'linux_fx_version': {'key': 'properties.linuxFxVersion', 'type': 'str'}, + 'windows_fx_version': {'key': 'properties.windowsFxVersion', 'type': 'str'}, + 'request_tracing_enabled': {'key': 'properties.requestTracingEnabled', 'type': 'bool'}, + 'request_tracing_expiration_time': {'key': 'properties.requestTracingExpirationTime', 'type': 'iso-8601'}, + 'remote_debugging_enabled': {'key': 'properties.remoteDebuggingEnabled', 'type': 'bool'}, + 'remote_debugging_version': {'key': 'properties.remoteDebuggingVersion', 'type': 'str'}, + 'http_logging_enabled': {'key': 'properties.httpLoggingEnabled', 'type': 'bool'}, + 'logs_directory_size_limit': {'key': 'properties.logsDirectorySizeLimit', 'type': 'int'}, + 'detailed_error_logging_enabled': {'key': 'properties.detailedErrorLoggingEnabled', 'type': 'bool'}, + 'publishing_username': {'key': 'properties.publishingUsername', 'type': 'str'}, + 'app_settings': {'key': 'properties.appSettings', 'type': '[NameValuePair]'}, + 'connection_strings': {'key': 'properties.connectionStrings', 'type': '[ConnStringInfo]'}, + 'machine_key': {'key': 'properties.machineKey', 'type': 'SiteMachineKey'}, + 'handler_mappings': {'key': 'properties.handlerMappings', 'type': '[HandlerMapping]'}, + 'document_root': {'key': 'properties.documentRoot', 'type': 'str'}, + 'scm_type': {'key': 'properties.scmType', 'type': 'str'}, + 'use32_bit_worker_process': {'key': 'properties.use32BitWorkerProcess', 'type': 'bool'}, + 'web_sockets_enabled': {'key': 'properties.webSocketsEnabled', 'type': 'bool'}, + 'always_on': {'key': 'properties.alwaysOn', 'type': 'bool'}, + 'java_version': {'key': 'properties.javaVersion', 'type': 'str'}, + 'java_container': {'key': 'properties.javaContainer', 'type': 'str'}, + 'java_container_version': {'key': 'properties.javaContainerVersion', 'type': 'str'}, + 'app_command_line': {'key': 'properties.appCommandLine', 'type': 'str'}, + 'managed_pipeline_mode': {'key': 'properties.managedPipelineMode', 'type': 'str'}, + 'virtual_applications': {'key': 'properties.virtualApplications', 'type': '[VirtualApplication]'}, + 'load_balancing': {'key': 'properties.loadBalancing', 'type': 'str'}, + 'experiments': {'key': 'properties.experiments', 'type': 'Experiments'}, + 'limits': {'key': 'properties.limits', 'type': 'SiteLimits'}, + 'auto_heal_enabled': {'key': 'properties.autoHealEnabled', 'type': 'bool'}, + 'auto_heal_rules': {'key': 'properties.autoHealRules', 'type': 'AutoHealRules'}, + 'tracing_options': {'key': 'properties.tracingOptions', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_route_all_enabled': {'key': 'properties.vnetRouteAllEnabled', 'type': 'bool'}, + 'vnet_private_ports_count': {'key': 'properties.vnetPrivatePortsCount', 'type': 'int'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsSettings'}, + 'push': {'key': 'properties.push', 'type': 'PushSettings'}, + 'api_definition': {'key': 'properties.apiDefinition', 'type': 'ApiDefinitionInfo'}, + 'api_management_config': {'key': 'properties.apiManagementConfig', 'type': 'ApiManagementConfig'}, + 'auto_swap_slot_name': {'key': 'properties.autoSwapSlotName', 'type': 'str'}, + 'local_my_sql_enabled': {'key': 'properties.localMySqlEnabled', 'type': 'bool'}, + 'managed_service_identity_id': {'key': 'properties.managedServiceIdentityId', 'type': 'int'}, + 'x_managed_service_identity_id': {'key': 'properties.xManagedServiceIdentityId', 'type': 'int'}, + 'ip_security_restrictions': {'key': 'properties.ipSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions': {'key': 'properties.scmIpSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions_use_main': {'key': 'properties.scmIpSecurityRestrictionsUseMain', 'type': 'bool'}, + 'http20_enabled': {'key': 'properties.http20Enabled', 'type': 'bool'}, + 'min_tls_version': {'key': 'properties.minTlsVersion', 'type': 'str'}, + 'scm_min_tls_version': {'key': 'properties.scmMinTlsVersion', 'type': 'str'}, + 'ftps_state': {'key': 'properties.ftpsState', 'type': 'str'}, + 'pre_warmed_instance_count': {'key': 'properties.preWarmedInstanceCount', 'type': 'int'}, + 'health_check_path': {'key': 'properties.healthCheckPath', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + number_of_workers: Optional[int] = None, + default_documents: Optional[List[str]] = None, + net_framework_version: Optional[str] = "v4.6", + php_version: Optional[str] = None, + python_version: Optional[str] = None, + node_version: Optional[str] = None, + power_shell_version: Optional[str] = None, + linux_fx_version: Optional[str] = None, + windows_fx_version: Optional[str] = None, + request_tracing_enabled: Optional[bool] = None, + request_tracing_expiration_time: Optional[datetime.datetime] = None, + remote_debugging_enabled: Optional[bool] = None, + remote_debugging_version: Optional[str] = None, + http_logging_enabled: Optional[bool] = None, + logs_directory_size_limit: Optional[int] = None, + detailed_error_logging_enabled: Optional[bool] = None, + publishing_username: Optional[str] = None, + app_settings: Optional[List["NameValuePair"]] = None, + connection_strings: Optional[List["ConnStringInfo"]] = None, + handler_mappings: Optional[List["HandlerMapping"]] = None, + document_root: Optional[str] = None, + scm_type: Optional[Union[str, "ScmType"]] = None, + use32_bit_worker_process: Optional[bool] = None, + web_sockets_enabled: Optional[bool] = None, + always_on: Optional[bool] = None, + java_version: Optional[str] = None, + java_container: Optional[str] = None, + java_container_version: Optional[str] = None, + app_command_line: Optional[str] = None, + managed_pipeline_mode: Optional[Union[str, "ManagedPipelineMode"]] = None, + virtual_applications: Optional[List["VirtualApplication"]] = None, + load_balancing: Optional[Union[str, "SiteLoadBalancing"]] = None, + experiments: Optional["Experiments"] = None, + limits: Optional["SiteLimits"] = None, + auto_heal_enabled: Optional[bool] = None, + auto_heal_rules: Optional["AutoHealRules"] = None, + tracing_options: Optional[str] = None, + vnet_name: Optional[str] = None, + vnet_route_all_enabled: Optional[bool] = None, + vnet_private_ports_count: Optional[int] = None, + cors: Optional["CorsSettings"] = None, + push: Optional["PushSettings"] = None, + api_definition: Optional["ApiDefinitionInfo"] = None, + api_management_config: Optional["ApiManagementConfig"] = None, + auto_swap_slot_name: Optional[str] = None, + local_my_sql_enabled: Optional[bool] = False, + managed_service_identity_id: Optional[int] = None, + x_managed_service_identity_id: Optional[int] = None, + ip_security_restrictions: Optional[List["IpSecurityRestriction"]] = None, + scm_ip_security_restrictions: Optional[List["IpSecurityRestriction"]] = None, + scm_ip_security_restrictions_use_main: Optional[bool] = None, + http20_enabled: Optional[bool] = True, + min_tls_version: Optional[Union[str, "SupportedTlsVersions"]] = None, + scm_min_tls_version: Optional[Union[str, "SupportedTlsVersions"]] = None, + ftps_state: Optional[Union[str, "FtpsState"]] = None, + pre_warmed_instance_count: Optional[int] = None, + health_check_path: Optional[str] = None, + **kwargs + ): + super(SiteConfigResource, self).__init__(kind=kind, **kwargs) + self.number_of_workers = number_of_workers + self.default_documents = default_documents + self.net_framework_version = net_framework_version + self.php_version = php_version + self.python_version = python_version + self.node_version = node_version + self.power_shell_version = power_shell_version + self.linux_fx_version = linux_fx_version + self.windows_fx_version = windows_fx_version + self.request_tracing_enabled = request_tracing_enabled + self.request_tracing_expiration_time = request_tracing_expiration_time + self.remote_debugging_enabled = remote_debugging_enabled + self.remote_debugging_version = remote_debugging_version + self.http_logging_enabled = http_logging_enabled + self.logs_directory_size_limit = logs_directory_size_limit + self.detailed_error_logging_enabled = detailed_error_logging_enabled + self.publishing_username = publishing_username + self.app_settings = app_settings + self.connection_strings = connection_strings + self.machine_key = None + self.handler_mappings = handler_mappings + self.document_root = document_root + self.scm_type = scm_type + self.use32_bit_worker_process = use32_bit_worker_process + self.web_sockets_enabled = web_sockets_enabled + self.always_on = always_on + self.java_version = java_version + self.java_container = java_container + self.java_container_version = java_container_version + self.app_command_line = app_command_line + self.managed_pipeline_mode = managed_pipeline_mode + self.virtual_applications = virtual_applications + self.load_balancing = load_balancing + self.experiments = experiments + self.limits = limits + self.auto_heal_enabled = auto_heal_enabled + self.auto_heal_rules = auto_heal_rules + self.tracing_options = tracing_options + self.vnet_name = vnet_name + self.vnet_route_all_enabled = vnet_route_all_enabled + self.vnet_private_ports_count = vnet_private_ports_count + self.cors = cors + self.push = push + self.api_definition = api_definition + self.api_management_config = api_management_config + self.auto_swap_slot_name = auto_swap_slot_name + self.local_my_sql_enabled = local_my_sql_enabled + self.managed_service_identity_id = managed_service_identity_id + self.x_managed_service_identity_id = x_managed_service_identity_id + self.ip_security_restrictions = ip_security_restrictions + self.scm_ip_security_restrictions = scm_ip_security_restrictions + self.scm_ip_security_restrictions_use_main = scm_ip_security_restrictions_use_main + self.http20_enabled = http20_enabled + self.min_tls_version = min_tls_version + self.scm_min_tls_version = scm_min_tls_version + self.ftps_state = ftps_state + self.pre_warmed_instance_count = pre_warmed_instance_count + self.health_check_path = health_check_path + + +class SiteConfigResourceCollection(msrest.serialization.Model): + """Collection of site configurations. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.SiteConfigResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SiteConfigResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SiteConfigResource"], + **kwargs + ): + super(SiteConfigResourceCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SiteConfigurationSnapshotInfo(ProxyOnlyResource): + """A snapshot of a web app configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar time: The time the snapshot was taken. + :vartype time: ~datetime.datetime + :ivar snapshot_id: The id of the snapshot. + :vartype snapshot_id: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'time': {'readonly': True}, + 'snapshot_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'iso-8601'}, + 'snapshot_id': {'key': 'properties.snapshotId', 'type': 'int'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(SiteConfigurationSnapshotInfo, self).__init__(kind=kind, **kwargs) + self.time = None + self.snapshot_id = None + + +class SiteConfigurationSnapshotInfoCollection(msrest.serialization.Model): + """Collection of metadata for the app configuration snapshots that can be restored. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.SiteConfigurationSnapshotInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SiteConfigurationSnapshotInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SiteConfigurationSnapshotInfo"], + **kwargs + ): + super(SiteConfigurationSnapshotInfoCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SiteExtensionInfo(ProxyOnlyResource): + """Site Extension Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param extension_id: Site extension ID. + :type extension_id: str + :param title: + :type title: str + :param extension_type: Site extension type. Possible values include: "Gallery", "WebRoot". + :type extension_type: str or ~azure.mgmt.web.v2020_06_01.models.SiteExtensionType + :param summary: Summary description. + :type summary: str + :param description: Detailed description. + :type description: str + :param version: Version information. + :type version: str + :param extension_url: Extension URL. + :type extension_url: str + :param project_url: Project URL. + :type project_url: str + :param icon_url: Icon URL. + :type icon_url: str + :param license_url: License URL. + :type license_url: str + :param feed_url: Feed URL. + :type feed_url: str + :param authors: List of authors. + :type authors: list[str] + :param installer_command_line_params: Installer command line parameters. + :type installer_command_line_params: str + :param published_date_time: Published timestamp. + :type published_date_time: ~datetime.datetime + :param download_count: Count of downloads. + :type download_count: int + :param local_is_latest_version: :code:`true` if the local version is the latest + version; :code:`false` otherwise. + :type local_is_latest_version: bool + :param local_path: Local path. + :type local_path: str + :param installed_date_time: Installed timestamp. + :type installed_date_time: ~datetime.datetime + :param provisioning_state: Provisioning state. + :type provisioning_state: str + :param comment: Site Extension comment. + :type comment: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'extension_id': {'key': 'properties.extension_id', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'extension_type': {'key': 'properties.extension_type', 'type': 'str'}, + 'summary': {'key': 'properties.summary', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'extension_url': {'key': 'properties.extension_url', 'type': 'str'}, + 'project_url': {'key': 'properties.project_url', 'type': 'str'}, + 'icon_url': {'key': 'properties.icon_url', 'type': 'str'}, + 'license_url': {'key': 'properties.license_url', 'type': 'str'}, + 'feed_url': {'key': 'properties.feed_url', 'type': 'str'}, + 'authors': {'key': 'properties.authors', 'type': '[str]'}, + 'installer_command_line_params': {'key': 'properties.installer_command_line_params', 'type': 'str'}, + 'published_date_time': {'key': 'properties.published_date_time', 'type': 'iso-8601'}, + 'download_count': {'key': 'properties.download_count', 'type': 'int'}, + 'local_is_latest_version': {'key': 'properties.local_is_latest_version', 'type': 'bool'}, + 'local_path': {'key': 'properties.local_path', 'type': 'str'}, + 'installed_date_time': {'key': 'properties.installed_date_time', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'comment': {'key': 'properties.comment', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + extension_id: Optional[str] = None, + title: Optional[str] = None, + extension_type: Optional[Union[str, "SiteExtensionType"]] = None, + summary: Optional[str] = None, + description: Optional[str] = None, + version: Optional[str] = None, + extension_url: Optional[str] = None, + project_url: Optional[str] = None, + icon_url: Optional[str] = None, + license_url: Optional[str] = None, + feed_url: Optional[str] = None, + authors: Optional[List[str]] = None, + installer_command_line_params: Optional[str] = None, + published_date_time: Optional[datetime.datetime] = None, + download_count: Optional[int] = None, + local_is_latest_version: Optional[bool] = None, + local_path: Optional[str] = None, + installed_date_time: Optional[datetime.datetime] = None, + provisioning_state: Optional[str] = None, + comment: Optional[str] = None, + **kwargs + ): + super(SiteExtensionInfo, self).__init__(kind=kind, **kwargs) + self.extension_id = extension_id + self.title = title + self.extension_type = extension_type + self.summary = summary + self.description = description + self.version = version + self.extension_url = extension_url + self.project_url = project_url + self.icon_url = icon_url + self.license_url = license_url + self.feed_url = feed_url + self.authors = authors + self.installer_command_line_params = installer_command_line_params + self.published_date_time = published_date_time + self.download_count = download_count + self.local_is_latest_version = local_is_latest_version + self.local_path = local_path + self.installed_date_time = installed_date_time + self.provisioning_state = provisioning_state + self.comment = comment + + +class SiteExtensionInfoCollection(msrest.serialization.Model): + """Collection of Kudu site extension information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.SiteExtensionInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SiteExtensionInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SiteExtensionInfo"], + **kwargs + ): + super(SiteExtensionInfoCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SiteLimits(msrest.serialization.Model): + """Metric limits set on an app. + + :param max_percentage_cpu: Maximum allowed CPU usage percentage. + :type max_percentage_cpu: float + :param max_memory_in_mb: Maximum allowed memory usage in MB. + :type max_memory_in_mb: long + :param max_disk_size_in_mb: Maximum allowed disk size usage in MB. + :type max_disk_size_in_mb: long + """ + + _attribute_map = { + 'max_percentage_cpu': {'key': 'maxPercentageCpu', 'type': 'float'}, + 'max_memory_in_mb': {'key': 'maxMemoryInMb', 'type': 'long'}, + 'max_disk_size_in_mb': {'key': 'maxDiskSizeInMb', 'type': 'long'}, + } + + def __init__( + self, + *, + max_percentage_cpu: Optional[float] = None, + max_memory_in_mb: Optional[int] = None, + max_disk_size_in_mb: Optional[int] = None, + **kwargs + ): + super(SiteLimits, self).__init__(**kwargs) + self.max_percentage_cpu = max_percentage_cpu + self.max_memory_in_mb = max_memory_in_mb + self.max_disk_size_in_mb = max_disk_size_in_mb + + +class SiteLogsConfig(ProxyOnlyResource): + """Configuration of App Service site logs. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param application_logs: Application logs configuration. + :type application_logs: ~azure.mgmt.web.v2020_06_01.models.ApplicationLogsConfig + :param http_logs: HTTP logs configuration. + :type http_logs: ~azure.mgmt.web.v2020_06_01.models.HttpLogsConfig + :param failed_requests_tracing: Failed requests tracing configuration. + :type failed_requests_tracing: ~azure.mgmt.web.v2020_06_01.models.EnabledConfig + :param detailed_error_messages: Detailed error messages configuration. + :type detailed_error_messages: ~azure.mgmt.web.v2020_06_01.models.EnabledConfig + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'application_logs': {'key': 'properties.applicationLogs', 'type': 'ApplicationLogsConfig'}, + 'http_logs': {'key': 'properties.httpLogs', 'type': 'HttpLogsConfig'}, + 'failed_requests_tracing': {'key': 'properties.failedRequestsTracing', 'type': 'EnabledConfig'}, + 'detailed_error_messages': {'key': 'properties.detailedErrorMessages', 'type': 'EnabledConfig'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + application_logs: Optional["ApplicationLogsConfig"] = None, + http_logs: Optional["HttpLogsConfig"] = None, + failed_requests_tracing: Optional["EnabledConfig"] = None, + detailed_error_messages: Optional["EnabledConfig"] = None, + **kwargs + ): + super(SiteLogsConfig, self).__init__(kind=kind, **kwargs) + self.application_logs = application_logs + self.http_logs = http_logs + self.failed_requests_tracing = failed_requests_tracing + self.detailed_error_messages = detailed_error_messages + + +class SiteMachineKey(msrest.serialization.Model): + """MachineKey of an app. + + :param validation: MachineKey validation. + :type validation: str + :param validation_key: Validation key. + :type validation_key: str + :param decryption: Algorithm used for decryption. + :type decryption: str + :param decryption_key: Decryption key. + :type decryption_key: str + """ + + _attribute_map = { + 'validation': {'key': 'validation', 'type': 'str'}, + 'validation_key': {'key': 'validationKey', 'type': 'str'}, + 'decryption': {'key': 'decryption', 'type': 'str'}, + 'decryption_key': {'key': 'decryptionKey', 'type': 'str'}, + } + + def __init__( + self, + *, + validation: Optional[str] = None, + validation_key: Optional[str] = None, + decryption: Optional[str] = None, + decryption_key: Optional[str] = None, + **kwargs + ): + super(SiteMachineKey, self).__init__(**kwargs) + self.validation = validation + self.validation_key = validation_key + self.decryption = decryption + self.decryption_key = decryption_key + + +class SitePatchResource(ProxyOnlyResource): + """ARM resource for a site. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param identity: Managed service identity. + :type identity: ~azure.mgmt.web.v2020_06_01.models.ManagedServiceIdentity + :ivar state: Current state of the app. + :vartype state: str + :ivar host_names: Hostnames associated with the app. + :vartype host_names: list[str] + :ivar repository_site_name: Name of the repository site. + :vartype repository_site_name: str + :ivar usage_state: State indicating whether the app has exceeded its quota usage. Read-only. + Possible values include: "Normal", "Exceeded". + :vartype usage_state: str or ~azure.mgmt.web.v2020_06_01.models.UsageState + :param enabled: :code:`true` if the app is enabled; otherwise, + :code:`false`. Setting this value to false disables the app (takes the app + offline). + :type enabled: bool + :ivar enabled_host_names: Enabled hostnames for the app.Hostnames need to be assigned (see + HostNames) AND enabled. Otherwise, + the app is not served on those hostnames. + :vartype enabled_host_names: list[str] + :ivar availability_state: Management information availability state for the app. Possible + values include: "Normal", "Limited", "DisasterRecoveryMode". + :vartype availability_state: str or ~azure.mgmt.web.v2020_06_01.models.SiteAvailabilityState + :param host_name_ssl_states: Hostname SSL states are used to manage the SSL bindings for app's + hostnames. + :type host_name_ssl_states: list[~azure.mgmt.web.v2020_06_01.models.HostNameSslState] + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param reserved: :code:`true` if reserved; otherwise, :code:`false`. + :type reserved: bool + :param is_xenon: Obsolete: Hyper-V sandbox. + :type is_xenon: bool + :param hyper_v: Hyper-V sandbox. + :type hyper_v: bool + :ivar last_modified_time_utc: Last time the app was modified, in UTC. Read-only. + :vartype last_modified_time_utc: ~datetime.datetime + :param site_config: Configuration of the app. + :type site_config: ~azure.mgmt.web.v2020_06_01.models.SiteConfig + :ivar traffic_manager_host_names: Azure Traffic Manager hostnames associated with the app. + Read-only. + :vartype traffic_manager_host_names: list[str] + :param scm_site_also_stopped: :code:`true` to stop SCM (KUDU) site when the app is + stopped; otherwise, :code:`false`. The default is :code:`false`. + :type scm_site_also_stopped: bool + :ivar target_swap_slot: Specifies which deployment slot this app will swap into. Read-only. + :vartype target_swap_slot: str + :param hosting_environment_profile: App Service Environment to use for the app. + :type hosting_environment_profile: ~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentProfile + :param client_affinity_enabled: :code:`true` to enable client affinity; + :code:`false` to stop sending session affinity cookies, which route client + requests in the same session to the same instance. Default is :code:`true`. + :type client_affinity_enabled: bool + :param client_cert_enabled: :code:`true` to enable client certificate + authentication (TLS mutual authentication); otherwise, :code:`false`. Default is + :code:`false`. + :type client_cert_enabled: bool + :param client_cert_mode: This composes with ClientCertEnabled setting. + + + * ClientCertEnabled: false means ClientCert is ignored. + * ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + * ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or + accepted. Possible values include: "Required", "Optional". + :type client_cert_mode: str or ~azure.mgmt.web.v2020_06_01.models.ClientCertMode + :param client_cert_exclusion_paths: client certificate authentication comma-separated exclusion + paths. + :type client_cert_exclusion_paths: str + :param host_names_disabled: :code:`true` to disable the public hostnames of the + app; otherwise, :code:`false`. + If :code:`true`, the app is only accessible via API management process. + :type host_names_disabled: bool + :param custom_domain_verification_id: Unique identifier that verifies the custom domains + assigned to the app. Customer will add this id to a txt record for verification. + :type custom_domain_verification_id: str + :ivar outbound_ip_addresses: List of IP addresses that the app uses for outbound connections + (e.g. database access). Includes VIPs from tenants that site can be hosted with current + settings. Read-only. + :vartype outbound_ip_addresses: str + :ivar possible_outbound_ip_addresses: List of IP addresses that the app uses for outbound + connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read- + only. + :vartype possible_outbound_ip_addresses: str + :param container_size: Size of the function container. + :type container_size: int + :param daily_memory_time_quota: Maximum allowed daily memory-time quota (applicable on dynamic + apps only). + :type daily_memory_time_quota: int + :ivar suspended_till: App suspended till in case memory-time quota is exceeded. + :vartype suspended_till: ~datetime.datetime + :ivar max_number_of_workers: Maximum number of workers. + This only applies to Functions container. + :vartype max_number_of_workers: int + :param cloning_info: If specified during app creation, the app is cloned from a source app. + :type cloning_info: ~azure.mgmt.web.v2020_06_01.models.CloningInfo + :ivar resource_group: Name of the resource group the app belongs to. Read-only. + :vartype resource_group: str + :ivar is_default_container: :code:`true` if the app is a default container; + otherwise, :code:`false`. + :vartype is_default_container: bool + :ivar default_host_name: Default hostname of the app. Read-only. + :vartype default_host_name: str + :ivar slot_swap_status: Status of the last deployment slot swap operation. + :vartype slot_swap_status: ~azure.mgmt.web.v2020_06_01.models.SlotSwapStatus + :param https_only: HttpsOnly: configures a web site to accept only https requests. Issues + redirect for + http requests. + :type https_only: bool + :param redundancy_mode: Site redundancy mode. Possible values include: "None", "Manual", + "Failover", "ActiveActive", "GeoRedundant". + :type redundancy_mode: str or ~azure.mgmt.web.v2020_06_01.models.RedundancyMode + :ivar in_progress_operation_id: Specifies an operation id if this site has a pending operation. + :vartype in_progress_operation_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'host_names': {'readonly': True}, + 'repository_site_name': {'readonly': True}, + 'usage_state': {'readonly': True}, + 'enabled_host_names': {'readonly': True}, + 'availability_state': {'readonly': True}, + 'last_modified_time_utc': {'readonly': True}, + 'traffic_manager_host_names': {'readonly': True}, + 'target_swap_slot': {'readonly': True}, + 'outbound_ip_addresses': {'readonly': True}, + 'possible_outbound_ip_addresses': {'readonly': True}, + 'suspended_till': {'readonly': True}, + 'max_number_of_workers': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'is_default_container': {'readonly': True}, + 'default_host_name': {'readonly': True}, + 'slot_swap_status': {'readonly': True}, + 'in_progress_operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'repository_site_name': {'key': 'properties.repositorySiteName', 'type': 'str'}, + 'usage_state': {'key': 'properties.usageState', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'enabled_host_names': {'key': 'properties.enabledHostNames', 'type': '[str]'}, + 'availability_state': {'key': 'properties.availabilityState', 'type': 'str'}, + 'host_name_ssl_states': {'key': 'properties.hostNameSslStates', 'type': '[HostNameSslState]'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'last_modified_time_utc': {'key': 'properties.lastModifiedTimeUtc', 'type': 'iso-8601'}, + 'site_config': {'key': 'properties.siteConfig', 'type': 'SiteConfig'}, + 'traffic_manager_host_names': {'key': 'properties.trafficManagerHostNames', 'type': '[str]'}, + 'scm_site_also_stopped': {'key': 'properties.scmSiteAlsoStopped', 'type': 'bool'}, + 'target_swap_slot': {'key': 'properties.targetSwapSlot', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'client_affinity_enabled': {'key': 'properties.clientAffinityEnabled', 'type': 'bool'}, + 'client_cert_enabled': {'key': 'properties.clientCertEnabled', 'type': 'bool'}, + 'client_cert_mode': {'key': 'properties.clientCertMode', 'type': 'str'}, + 'client_cert_exclusion_paths': {'key': 'properties.clientCertExclusionPaths', 'type': 'str'}, + 'host_names_disabled': {'key': 'properties.hostNamesDisabled', 'type': 'bool'}, + 'custom_domain_verification_id': {'key': 'properties.customDomainVerificationId', 'type': 'str'}, + 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': 'str'}, + 'possible_outbound_ip_addresses': {'key': 'properties.possibleOutboundIpAddresses', 'type': 'str'}, + 'container_size': {'key': 'properties.containerSize', 'type': 'int'}, + 'daily_memory_time_quota': {'key': 'properties.dailyMemoryTimeQuota', 'type': 'int'}, + 'suspended_till': {'key': 'properties.suspendedTill', 'type': 'iso-8601'}, + 'max_number_of_workers': {'key': 'properties.maxNumberOfWorkers', 'type': 'int'}, + 'cloning_info': {'key': 'properties.cloningInfo', 'type': 'CloningInfo'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'is_default_container': {'key': 'properties.isDefaultContainer', 'type': 'bool'}, + 'default_host_name': {'key': 'properties.defaultHostName', 'type': 'str'}, + 'slot_swap_status': {'key': 'properties.slotSwapStatus', 'type': 'SlotSwapStatus'}, + 'https_only': {'key': 'properties.httpsOnly', 'type': 'bool'}, + 'redundancy_mode': {'key': 'properties.redundancyMode', 'type': 'str'}, + 'in_progress_operation_id': {'key': 'properties.inProgressOperationId', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + identity: Optional["ManagedServiceIdentity"] = None, + enabled: Optional[bool] = None, + host_name_ssl_states: Optional[List["HostNameSslState"]] = None, + server_farm_id: Optional[str] = None, + reserved: Optional[bool] = False, + is_xenon: Optional[bool] = False, + hyper_v: Optional[bool] = False, + site_config: Optional["SiteConfig"] = None, + scm_site_also_stopped: Optional[bool] = False, + hosting_environment_profile: Optional["HostingEnvironmentProfile"] = None, + client_affinity_enabled: Optional[bool] = None, + client_cert_enabled: Optional[bool] = None, + client_cert_mode: Optional[Union[str, "ClientCertMode"]] = None, + client_cert_exclusion_paths: Optional[str] = None, + host_names_disabled: Optional[bool] = None, + custom_domain_verification_id: Optional[str] = None, + container_size: Optional[int] = None, + daily_memory_time_quota: Optional[int] = None, + cloning_info: Optional["CloningInfo"] = None, + https_only: Optional[bool] = None, + redundancy_mode: Optional[Union[str, "RedundancyMode"]] = None, + **kwargs + ): + super(SitePatchResource, self).__init__(kind=kind, **kwargs) + self.identity = identity + self.state = None + self.host_names = None + self.repository_site_name = None + self.usage_state = None + self.enabled = enabled + self.enabled_host_names = None + self.availability_state = None + self.host_name_ssl_states = host_name_ssl_states + self.server_farm_id = server_farm_id + self.reserved = reserved + self.is_xenon = is_xenon + self.hyper_v = hyper_v + self.last_modified_time_utc = None + self.site_config = site_config + self.traffic_manager_host_names = None + self.scm_site_also_stopped = scm_site_also_stopped + self.target_swap_slot = None + self.hosting_environment_profile = hosting_environment_profile + self.client_affinity_enabled = client_affinity_enabled + self.client_cert_enabled = client_cert_enabled + self.client_cert_mode = client_cert_mode + self.client_cert_exclusion_paths = client_cert_exclusion_paths + self.host_names_disabled = host_names_disabled + self.custom_domain_verification_id = custom_domain_verification_id + self.outbound_ip_addresses = None + self.possible_outbound_ip_addresses = None + self.container_size = container_size + self.daily_memory_time_quota = daily_memory_time_quota + self.suspended_till = None + self.max_number_of_workers = None + self.cloning_info = cloning_info + self.resource_group = None + self.is_default_container = None + self.default_host_name = None + self.slot_swap_status = None + self.https_only = https_only + self.redundancy_mode = redundancy_mode + self.in_progress_operation_id = None + + +class SitePhpErrorLogFlag(ProxyOnlyResource): + """Used for getting PHP error logging flag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param local_log_errors: Local log_errors setting. + :type local_log_errors: str + :param master_log_errors: Master log_errors setting. + :type master_log_errors: str + :param local_log_errors_max_length: Local log_errors_max_len setting. + :type local_log_errors_max_length: str + :param master_log_errors_max_length: Master log_errors_max_len setting. + :type master_log_errors_max_length: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'local_log_errors': {'key': 'properties.localLogErrors', 'type': 'str'}, + 'master_log_errors': {'key': 'properties.masterLogErrors', 'type': 'str'}, + 'local_log_errors_max_length': {'key': 'properties.localLogErrorsMaxLength', 'type': 'str'}, + 'master_log_errors_max_length': {'key': 'properties.masterLogErrorsMaxLength', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + local_log_errors: Optional[str] = None, + master_log_errors: Optional[str] = None, + local_log_errors_max_length: Optional[str] = None, + master_log_errors_max_length: Optional[str] = None, + **kwargs + ): + super(SitePhpErrorLogFlag, self).__init__(kind=kind, **kwargs) + self.local_log_errors = local_log_errors + self.master_log_errors = master_log_errors + self.local_log_errors_max_length = local_log_errors_max_length + self.master_log_errors_max_length = master_log_errors_max_length + + +class SiteSeal(msrest.serialization.Model): + """Site seal. + + All required parameters must be populated in order to send to Azure. + + :param html: Required. HTML snippet. + :type html: str + """ + + _validation = { + 'html': {'required': True}, + } + + _attribute_map = { + 'html': {'key': 'html', 'type': 'str'}, + } + + def __init__( + self, + *, + html: str, + **kwargs + ): + super(SiteSeal, self).__init__(**kwargs) + self.html = html + + +class SiteSealRequest(msrest.serialization.Model): + """Site seal request. + + :param light_theme: If :code:`true` use the light color theme for site seal; + otherwise, use the default color theme. + :type light_theme: bool + :param locale: Locale of site seal. + :type locale: str + """ + + _attribute_map = { + 'light_theme': {'key': 'lightTheme', 'type': 'bool'}, + 'locale': {'key': 'locale', 'type': 'str'}, + } + + def __init__( + self, + *, + light_theme: Optional[bool] = None, + locale: Optional[str] = None, + **kwargs + ): + super(SiteSealRequest, self).__init__(**kwargs) + self.light_theme = light_theme + self.locale = locale + + +class SiteSourceControl(ProxyOnlyResource): + """Source control configuration for an app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param repo_url: Repository or source control URL. + :type repo_url: str + :param branch: Name of branch to use for deployment. + :type branch: str + :param is_manual_integration: :code:`true` to limit to manual integration; + :code:`false` to enable continuous integration (which configures webhooks into + online repos like GitHub). + :type is_manual_integration: bool + :param is_git_hub_action: :code:`true` if this is deployed via GitHub action. + :type is_git_hub_action: bool + :param deployment_rollback_enabled: :code:`true` to enable deployment rollback; + otherwise, :code:`false`. + :type deployment_rollback_enabled: bool + :param is_mercurial: :code:`true` for a Mercurial repository; + :code:`false` for a Git repository. + :type is_mercurial: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repo_url': {'key': 'properties.repoUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'is_manual_integration': {'key': 'properties.isManualIntegration', 'type': 'bool'}, + 'is_git_hub_action': {'key': 'properties.isGitHubAction', 'type': 'bool'}, + 'deployment_rollback_enabled': {'key': 'properties.deploymentRollbackEnabled', 'type': 'bool'}, + 'is_mercurial': {'key': 'properties.isMercurial', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + repo_url: Optional[str] = None, + branch: Optional[str] = None, + is_manual_integration: Optional[bool] = None, + is_git_hub_action: Optional[bool] = None, + deployment_rollback_enabled: Optional[bool] = None, + is_mercurial: Optional[bool] = None, + **kwargs + ): + super(SiteSourceControl, self).__init__(kind=kind, **kwargs) + self.repo_url = repo_url + self.branch = branch + self.is_manual_integration = is_manual_integration + self.is_git_hub_action = is_git_hub_action + self.deployment_rollback_enabled = deployment_rollback_enabled + self.is_mercurial = is_mercurial + + +class SkuCapacity(msrest.serialization.Model): + """Description of the App Service plan scale options. + + :param minimum: Minimum number of workers for this App Service plan SKU. + :type minimum: int + :param maximum: Maximum number of workers for this App Service plan SKU. + :type maximum: int + :param default: Default number of workers for this App Service plan SKU. + :type default: int + :param scale_type: Available scale configurations for an App Service plan. + :type scale_type: str + """ + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__( + self, + *, + minimum: Optional[int] = None, + maximum: Optional[int] = None, + default: Optional[int] = None, + scale_type: Optional[str] = None, + **kwargs + ): + super(SkuCapacity, self).__init__(**kwargs) + self.minimum = minimum + self.maximum = maximum + self.default = default + self.scale_type = scale_type + + +class SkuDescription(msrest.serialization.Model): + """Description of a SKU for a scalable resource. + + :param name: Name of the resource SKU. + :type name: str + :param tier: Service tier of the resource SKU. + :type tier: str + :param size: Size specifier of the resource SKU. + :type size: str + :param family: Family code of the resource SKU. + :type family: str + :param capacity: Current number of instances assigned to the resource. + :type capacity: int + :param sku_capacity: Min, max, and default scale values of the SKU. + :type sku_capacity: ~azure.mgmt.web.v2020_06_01.models.SkuCapacity + :param locations: Locations of the SKU. + :type locations: list[str] + :param capabilities: Capabilities of the SKU, e.g., is traffic manager enabled?. + :type capabilities: list[~azure.mgmt.web.v2020_06_01.models.Capability] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'sku_capacity': {'key': 'skuCapacity', 'type': 'SkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[Capability]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + tier: Optional[str] = None, + size: Optional[str] = None, + family: Optional[str] = None, + capacity: Optional[int] = None, + sku_capacity: Optional["SkuCapacity"] = None, + locations: Optional[List[str]] = None, + capabilities: Optional[List["Capability"]] = None, + **kwargs + ): + super(SkuDescription, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.size = size + self.family = family + self.capacity = capacity + self.sku_capacity = sku_capacity + self.locations = locations + self.capabilities = capabilities + + +class SkuInfo(msrest.serialization.Model): + """SKU discovery information. + + :param resource_type: Resource type that this SKU applies to. + :type resource_type: str + :param sku: Name and tier of the SKU. + :type sku: ~azure.mgmt.web.v2020_06_01.models.SkuDescription + :param capacity: Min, max, and default scale values of the SKU. + :type capacity: ~azure.mgmt.web.v2020_06_01.models.SkuCapacity + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, + } + + def __init__( + self, + *, + resource_type: Optional[str] = None, + sku: Optional["SkuDescription"] = None, + capacity: Optional["SkuCapacity"] = None, + **kwargs + ): + super(SkuInfo, self).__init__(**kwargs) + self.resource_type = resource_type + self.sku = sku + self.capacity = capacity + + +class SkuInfoCollection(msrest.serialization.Model): + """Collection of SKU information. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.SkuInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SkuInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SkuInfo"], + **kwargs + ): + super(SkuInfoCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SkuInfos(msrest.serialization.Model): + """Collection of SKU information. + + :param resource_type: Resource type that this SKU applies to. + :type resource_type: str + :param skus: List of SKUs the subscription is able to use. + :type skus: list[~azure.mgmt.web.v2020_06_01.models.GlobalCsmSkuDescription] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'skus': {'key': 'skus', 'type': '[GlobalCsmSkuDescription]'}, + } + + def __init__( + self, + *, + resource_type: Optional[str] = None, + skus: Optional[List["GlobalCsmSkuDescription"]] = None, + **kwargs + ): + super(SkuInfos, self).__init__(**kwargs) + self.resource_type = resource_type + self.skus = skus + + +class SlotConfigNamesResource(ProxyOnlyResource): + """Slot Config names azure resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param connection_string_names: List of connection string names. + :type connection_string_names: list[str] + :param app_setting_names: List of application settings names. + :type app_setting_names: list[str] + :param azure_storage_config_names: List of external Azure storage account identifiers. + :type azure_storage_config_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'connection_string_names': {'key': 'properties.connectionStringNames', 'type': '[str]'}, + 'app_setting_names': {'key': 'properties.appSettingNames', 'type': '[str]'}, + 'azure_storage_config_names': {'key': 'properties.azureStorageConfigNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + connection_string_names: Optional[List[str]] = None, + app_setting_names: Optional[List[str]] = None, + azure_storage_config_names: Optional[List[str]] = None, + **kwargs + ): + super(SlotConfigNamesResource, self).__init__(kind=kind, **kwargs) + self.connection_string_names = connection_string_names + self.app_setting_names = app_setting_names + self.azure_storage_config_names = azure_storage_config_names + + +class SlotDifference(ProxyOnlyResource): + """A setting difference between two deployment slots of an app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar level: Level of the difference: Information, Warning or Error. + :vartype level: str + :ivar setting_type: The type of the setting: General, AppSetting or ConnectionString. + :vartype setting_type: str + :ivar diff_rule: Rule that describes how to process the setting difference during a slot swap. + :vartype diff_rule: str + :ivar setting_name: Name of the setting. + :vartype setting_name: str + :ivar value_in_current_slot: Value of the setting in the current slot. + :vartype value_in_current_slot: str + :ivar value_in_target_slot: Value of the setting in the target slot. + :vartype value_in_target_slot: str + :ivar description: Description of the setting difference. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'level': {'readonly': True}, + 'setting_type': {'readonly': True}, + 'diff_rule': {'readonly': True}, + 'setting_name': {'readonly': True}, + 'value_in_current_slot': {'readonly': True}, + 'value_in_target_slot': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'level': {'key': 'properties.level', 'type': 'str'}, + 'setting_type': {'key': 'properties.settingType', 'type': 'str'}, + 'diff_rule': {'key': 'properties.diffRule', 'type': 'str'}, + 'setting_name': {'key': 'properties.settingName', 'type': 'str'}, + 'value_in_current_slot': {'key': 'properties.valueInCurrentSlot', 'type': 'str'}, + 'value_in_target_slot': {'key': 'properties.valueInTargetSlot', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(SlotDifference, self).__init__(kind=kind, **kwargs) + self.level = None + self.setting_type = None + self.diff_rule = None + self.setting_name = None + self.value_in_current_slot = None + self.value_in_target_slot = None + self.description = None + + +class SlotDifferenceCollection(msrest.serialization.Model): + """Collection of slot differences. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.SlotDifference] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SlotDifference]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SlotDifference"], + **kwargs + ): + super(SlotDifferenceCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SlotSwapStatus(msrest.serialization.Model): + """The status of the last successful slot swap operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar timestamp_utc: The time the last successful slot swap completed. + :vartype timestamp_utc: ~datetime.datetime + :ivar source_slot_name: The source slot of the last swap operation. + :vartype source_slot_name: str + :ivar destination_slot_name: The destination slot of the last swap operation. + :vartype destination_slot_name: str + """ + + _validation = { + 'timestamp_utc': {'readonly': True}, + 'source_slot_name': {'readonly': True}, + 'destination_slot_name': {'readonly': True}, + } + + _attribute_map = { + 'timestamp_utc': {'key': 'timestampUtc', 'type': 'iso-8601'}, + 'source_slot_name': {'key': 'sourceSlotName', 'type': 'str'}, + 'destination_slot_name': {'key': 'destinationSlotName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SlotSwapStatus, self).__init__(**kwargs) + self.timestamp_utc = None + self.source_slot_name = None + self.destination_slot_name = None + + +class SlowRequestsBasedTrigger(msrest.serialization.Model): + """Trigger based on request execution time. + + :param time_taken: Time taken. + :type time_taken: str + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + """ + + _attribute_map = { + 'time_taken': {'key': 'timeTaken', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + } + + def __init__( + self, + *, + time_taken: Optional[str] = None, + count: Optional[int] = None, + time_interval: Optional[str] = None, + **kwargs + ): + super(SlowRequestsBasedTrigger, self).__init__(**kwargs) + self.time_taken = time_taken + self.count = count + self.time_interval = time_interval + + +class Snapshot(ProxyOnlyResource): + """A snapshot of an app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar time: The time the snapshot was taken. + :vartype time: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(Snapshot, self).__init__(kind=kind, **kwargs) + self.time = None + + +class SnapshotCollection(msrest.serialization.Model): + """Collection of snapshots which can be used to revert an app to a previous time. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.Snapshot] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Snapshot]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Snapshot"], + **kwargs + ): + super(SnapshotCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SnapshotRecoverySource(msrest.serialization.Model): + """Specifies the web app that snapshot contents will be retrieved from. + + :param location: Geographical location of the source web app, e.g. SouthEastAsia, + SouthCentralUS. + :type location: str + :param id: ARM resource ID of the source app. + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + for production slots and + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + for other slots. + :type id: str + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + id: Optional[str] = None, + **kwargs + ): + super(SnapshotRecoverySource, self).__init__(**kwargs) + self.location = location + self.id = id + + +class SnapshotRestoreRequest(ProxyOnlyResource): + """Details about app recovery operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param snapshot_time: Point in time in which the app restore should be done, formatted as a + DateTime string. + :type snapshot_time: str + :param recovery_source: Optional. Specifies the web app that snapshot contents will be + retrieved from. + If empty, the targeted web app will be used as the source. + :type recovery_source: ~azure.mgmt.web.v2020_06_01.models.SnapshotRecoverySource + :param overwrite: If :code:`true` the restore operation can overwrite source app; + otherwise, :code:`false`. + :type overwrite: bool + :param recover_configuration: If true, site configuration, in addition to content, will be + reverted. + :type recover_configuration: bool + :param ignore_conflicting_host_names: If true, custom hostname conflicts will be ignored when + recovering to a target web app. + This setting is only necessary when RecoverConfiguration is enabled. + :type ignore_conflicting_host_names: bool + :param use_dr_secondary: If true, the snapshot is retrieved from DRSecondary endpoint. + :type use_dr_secondary: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'str'}, + 'recovery_source': {'key': 'properties.recoverySource', 'type': 'SnapshotRecoverySource'}, + 'overwrite': {'key': 'properties.overwrite', 'type': 'bool'}, + 'recover_configuration': {'key': 'properties.recoverConfiguration', 'type': 'bool'}, + 'ignore_conflicting_host_names': {'key': 'properties.ignoreConflictingHostNames', 'type': 'bool'}, + 'use_dr_secondary': {'key': 'properties.useDRSecondary', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + snapshot_time: Optional[str] = None, + recovery_source: Optional["SnapshotRecoverySource"] = None, + overwrite: Optional[bool] = None, + recover_configuration: Optional[bool] = None, + ignore_conflicting_host_names: Optional[bool] = None, + use_dr_secondary: Optional[bool] = None, + **kwargs + ): + super(SnapshotRestoreRequest, self).__init__(kind=kind, **kwargs) + self.snapshot_time = snapshot_time + self.recovery_source = recovery_source + self.overwrite = overwrite + self.recover_configuration = recover_configuration + self.ignore_conflicting_host_names = ignore_conflicting_host_names + self.use_dr_secondary = use_dr_secondary + + +class Solution(msrest.serialization.Model): + """Class Representing Solution for problems detected. + + :param id: Solution Id. + :type id: float + :param display_name: Display Name of the solution. + :type display_name: str + :param order: Order of the solution. + :type order: float + :param description: Description of the solution. + :type description: str + :param type: Type of Solution. Possible values include: "QuickSolution", "DeepInvestigation", + "BestPractices". + :type type: str or ~azure.mgmt.web.v2020_06_01.models.SolutionType + :param data: Solution Data. + :type data: list[list[~azure.mgmt.web.v2020_06_01.models.NameValuePair]] + :param metadata: Solution Metadata. + :type metadata: list[list[~azure.mgmt.web.v2020_06_01.models.NameValuePair]] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'float'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'float'}, + 'description': {'key': 'description', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data': {'key': 'data', 'type': '[[NameValuePair]]'}, + 'metadata': {'key': 'metadata', 'type': '[[NameValuePair]]'}, + } + + def __init__( + self, + *, + id: Optional[float] = None, + display_name: Optional[str] = None, + order: Optional[float] = None, + description: Optional[str] = None, + type: Optional[Union[str, "SolutionType"]] = None, + data: Optional[List[List["NameValuePair"]]] = None, + metadata: Optional[List[List["NameValuePair"]]] = None, + **kwargs + ): + super(Solution, self).__init__(**kwargs) + self.id = id + self.display_name = display_name + self.order = order + self.description = description + self.type = type + self.data = data + self.metadata = metadata + + +class SourceControl(ProxyOnlyResource): + """The source control OAuth token. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param token: OAuth access token. + :type token: str + :param token_secret: OAuth access token secret. + :type token_secret: str + :param refresh_token: OAuth refresh token. + :type refresh_token: str + :param expiration_time: OAuth token expiration. + :type expiration_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'token': {'key': 'properties.token', 'type': 'str'}, + 'token_secret': {'key': 'properties.tokenSecret', 'type': 'str'}, + 'refresh_token': {'key': 'properties.refreshToken', 'type': 'str'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + token: Optional[str] = None, + token_secret: Optional[str] = None, + refresh_token: Optional[str] = None, + expiration_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(SourceControl, self).__init__(kind=kind, **kwargs) + self.token = token + self.token_secret = token_secret + self.refresh_token = refresh_token + self.expiration_time = expiration_time + + +class SourceControlCollection(msrest.serialization.Model): + """Collection of source controls. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.SourceControl] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SourceControl]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SourceControl"], + **kwargs + ): + super(SourceControlCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StackMajorVersion(msrest.serialization.Model): + """Application stack major version. + + :param display_version: Application stack major version (display only). + :type display_version: str + :param runtime_version: Application stack major version (runtime only). + :type runtime_version: str + :param is_default: :code:`true` if this is the default major version; otherwise, + :code:`false`. + :type is_default: bool + :param minor_versions: Minor versions associated with the major version. + :type minor_versions: list[~azure.mgmt.web.v2020_06_01.models.StackMinorVersion] + :param application_insights: :code:`true` if this supports Application Insights; + otherwise, :code:`false`. + :type application_insights: bool + :param is_preview: :code:`true` if this stack is in Preview, otherwise + :code:`false`. + :type is_preview: bool + :param is_deprecated: :code:`true` if this stack has been deprecated, otherwise + :code:`false`. + :type is_deprecated: bool + :param is_hidden: :code:`true` if this stack should be hidden for new customers on + portal, otherwise :code:`false`. + :type is_hidden: bool + """ + + _attribute_map = { + 'display_version': {'key': 'displayVersion', 'type': 'str'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'minor_versions': {'key': 'minorVersions', 'type': '[StackMinorVersion]'}, + 'application_insights': {'key': 'applicationInsights', 'type': 'bool'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + 'is_deprecated': {'key': 'isDeprecated', 'type': 'bool'}, + 'is_hidden': {'key': 'isHidden', 'type': 'bool'}, + } + + def __init__( + self, + *, + display_version: Optional[str] = None, + runtime_version: Optional[str] = None, + is_default: Optional[bool] = None, + minor_versions: Optional[List["StackMinorVersion"]] = None, + application_insights: Optional[bool] = None, + is_preview: Optional[bool] = None, + is_deprecated: Optional[bool] = None, + is_hidden: Optional[bool] = None, + **kwargs + ): + super(StackMajorVersion, self).__init__(**kwargs) + self.display_version = display_version + self.runtime_version = runtime_version + self.is_default = is_default + self.minor_versions = minor_versions + self.application_insights = application_insights + self.is_preview = is_preview + self.is_deprecated = is_deprecated + self.is_hidden = is_hidden + + +class StackMinorVersion(msrest.serialization.Model): + """Application stack minor version. + + :param display_version: Application stack minor version (display only). + :type display_version: str + :param runtime_version: Application stack minor version (runtime only). + :type runtime_version: str + :param is_default: :code:`true` if this is the default minor version; otherwise, + :code:`false`. + :type is_default: bool + :param is_remote_debugging_enabled: :code:`true` if this supports Remote + Debugging, otherwise :code:`false`. + :type is_remote_debugging_enabled: bool + """ + + _attribute_map = { + 'display_version': {'key': 'displayVersion', 'type': 'str'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'is_remote_debugging_enabled': {'key': 'isRemoteDebuggingEnabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + display_version: Optional[str] = None, + runtime_version: Optional[str] = None, + is_default: Optional[bool] = None, + is_remote_debugging_enabled: Optional[bool] = None, + **kwargs + ): + super(StackMinorVersion, self).__init__(**kwargs) + self.display_version = display_version + self.runtime_version = runtime_version + self.is_default = is_default + self.is_remote_debugging_enabled = is_remote_debugging_enabled + + +class StampCapacity(msrest.serialization.Model): + """Stamp capacity information. + + :param name: Name of the stamp. + :type name: str + :param available_capacity: Available capacity (# of machines, bytes of storage etc...). + :type available_capacity: long + :param total_capacity: Total capacity (# of machines, bytes of storage etc...). + :type total_capacity: long + :param unit: Name of the unit. + :type unit: str + :param compute_mode: Shared/dedicated workers. Possible values include: "Shared", "Dedicated", + "Dynamic". + :type compute_mode: str or ~azure.mgmt.web.v2020_06_01.models.ComputeModeOptions + :param worker_size: Size of the machines. Possible values include: "Small", "Medium", "Large", + "D1", "D2", "D3", "NestedSmall", "Default". + :type worker_size: str or ~azure.mgmt.web.v2020_06_01.models.WorkerSizeOptions + :param worker_size_id: Size ID of machines: + 0 - Small + 1 - Medium + 2 - Large. + :type worker_size_id: int + :param exclude_from_capacity_allocation: If :code:`true`, it includes basic apps. + Basic apps are not used for capacity allocation. + :type exclude_from_capacity_allocation: bool + :param is_applicable_for_all_compute_modes: :code:`true` if capacity is applicable + for all apps; otherwise, :code:`false`. + :type is_applicable_for_all_compute_modes: bool + :param site_mode: Shared or Dedicated. + :type site_mode: str + :param is_linux: Is this a linux stamp capacity. + :type is_linux: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'available_capacity': {'key': 'availableCapacity', 'type': 'long'}, + 'total_capacity': {'key': 'totalCapacity', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'compute_mode': {'key': 'computeMode', 'type': 'str'}, + 'worker_size': {'key': 'workerSize', 'type': 'str'}, + 'worker_size_id': {'key': 'workerSizeId', 'type': 'int'}, + 'exclude_from_capacity_allocation': {'key': 'excludeFromCapacityAllocation', 'type': 'bool'}, + 'is_applicable_for_all_compute_modes': {'key': 'isApplicableForAllComputeModes', 'type': 'bool'}, + 'site_mode': {'key': 'siteMode', 'type': 'str'}, + 'is_linux': {'key': 'isLinux', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + available_capacity: Optional[int] = None, + total_capacity: Optional[int] = None, + unit: Optional[str] = None, + compute_mode: Optional[Union[str, "ComputeModeOptions"]] = None, + worker_size: Optional[Union[str, "WorkerSizeOptions"]] = None, + worker_size_id: Optional[int] = None, + exclude_from_capacity_allocation: Optional[bool] = None, + is_applicable_for_all_compute_modes: Optional[bool] = None, + site_mode: Optional[str] = None, + is_linux: Optional[bool] = None, + **kwargs + ): + super(StampCapacity, self).__init__(**kwargs) + self.name = name + self.available_capacity = available_capacity + self.total_capacity = total_capacity + self.unit = unit + self.compute_mode = compute_mode + self.worker_size = worker_size + self.worker_size_id = worker_size_id + self.exclude_from_capacity_allocation = exclude_from_capacity_allocation + self.is_applicable_for_all_compute_modes = is_applicable_for_all_compute_modes + self.site_mode = site_mode + self.is_linux = is_linux + + +class StampCapacityCollection(msrest.serialization.Model): + """Collection of stamp capacities. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.StampCapacity] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StampCapacity]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["StampCapacity"], + **kwargs + ): + super(StampCapacityCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StaticSiteARMResource(Resource): + """Static Site ARM 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: Description of a SKU for a scalable resource. + :type sku: ~azure.mgmt.web.v2020_06_01.models.SkuDescription + :ivar default_hostname: The default autogenerated hostname for the static site. + :vartype default_hostname: str + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :ivar custom_domains: The custom domains associated with this static site. + :vartype custom_domains: list[str] + :param repository_token: A user's github repository token. This is used to setup the Github + Actions workflow file and API secrets. + :type repository_token: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: ~azure.mgmt.web.v2020_06_01.models.StaticSiteBuildProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'default_hostname': {'readonly': True}, + 'custom_domains': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'default_hostname': {'key': 'properties.defaultHostname', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'custom_domains': {'key': 'properties.customDomains', 'type': '[str]'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["SkuDescription"] = None, + repository_url: Optional[str] = None, + branch: Optional[str] = None, + repository_token: Optional[str] = None, + build_properties: Optional["StaticSiteBuildProperties"] = None, + **kwargs + ): + super(StaticSiteARMResource, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.sku = sku + self.default_hostname = None + self.repository_url = repository_url + self.branch = branch + self.custom_domains = None + self.repository_token = repository_token + self.build_properties = build_properties + + +class StaticSiteBuildARMResource(ProxyOnlyResource): + """Static Site Build ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar build_id: An identifier for the static site build. + :vartype build_id: str + :ivar source_branch: The source branch. + :vartype source_branch: str + :ivar pull_request_title: The title of a pull request that a static site build is related to. + :vartype pull_request_title: str + :ivar hostname: The hostname for a static site build. + :vartype hostname: str + :ivar created_time_utc: When this build was created. + :vartype created_time_utc: ~datetime.datetime + :ivar last_updated_on: When this build was updated. + :vartype last_updated_on: ~datetime.datetime + :ivar status: The status of the static site build. Possible values include: + "WaitingForDeployment", "Uploading", "Deploying", "Ready", "Failed", "Deleting", "Detached". + :vartype status: str or ~azure.mgmt.web.v2020_06_01.models.BuildStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'build_id': {'readonly': True}, + 'source_branch': {'readonly': True}, + 'pull_request_title': {'readonly': True}, + 'hostname': {'readonly': True}, + 'created_time_utc': {'readonly': True}, + 'last_updated_on': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'build_id': {'key': 'properties.buildId', 'type': 'str'}, + 'source_branch': {'key': 'properties.sourceBranch', 'type': 'str'}, + 'pull_request_title': {'key': 'properties.pullRequestTitle', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'created_time_utc': {'key': 'properties.createdTimeUtc', 'type': 'iso-8601'}, + 'last_updated_on': {'key': 'properties.lastUpdatedOn', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(StaticSiteBuildARMResource, self).__init__(kind=kind, **kwargs) + self.build_id = None + self.source_branch = None + self.pull_request_title = None + self.hostname = None + self.created_time_utc = None + self.last_updated_on = None + self.status = None + + +class StaticSiteBuildCollection(msrest.serialization.Model): + """Collection of static site builds. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.StaticSiteBuildARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteBuildARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["StaticSiteBuildARMResource"], + **kwargs + ): + super(StaticSiteBuildCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StaticSiteBuildProperties(msrest.serialization.Model): + """Build properties for the static site. + + :param app_location: The path to the app code within the repository. + :type app_location: str + :param api_location: The path to the api code within the repository. + :type api_location: str + :param app_artifact_location: The path of the app artifacts after building. + :type app_artifact_location: str + """ + + _attribute_map = { + 'app_location': {'key': 'appLocation', 'type': 'str'}, + 'api_location': {'key': 'apiLocation', 'type': 'str'}, + 'app_artifact_location': {'key': 'appArtifactLocation', 'type': 'str'}, + } + + def __init__( + self, + *, + app_location: Optional[str] = None, + api_location: Optional[str] = None, + app_artifact_location: Optional[str] = None, + **kwargs + ): + super(StaticSiteBuildProperties, self).__init__(**kwargs) + self.app_location = app_location + self.api_location = api_location + self.app_artifact_location = app_artifact_location + + +class StaticSiteCollection(msrest.serialization.Model): + """Collection of static sites. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.StaticSiteARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["StaticSiteARMResource"], + **kwargs + ): + super(StaticSiteCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StaticSiteCustomDomainOverviewARMResource(ProxyOnlyResource): + """Static Site Custom Domain Overview ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar domain_name: The domain name for the static site custom domain. + :vartype domain_name: str + :ivar created_on: The date and time on which the custom domain was created for the static site. + :vartype created_on: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'domain_name': {'readonly': True}, + 'created_on': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'domain_name': {'key': 'properties.domainName', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(StaticSiteCustomDomainOverviewARMResource, self).__init__(kind=kind, **kwargs) + self.domain_name = None + self.created_on = None + + +class StaticSiteCustomDomainOverviewCollection(msrest.serialization.Model): + """Collection of static site custom domains. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.StaticSiteCustomDomainOverviewARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteCustomDomainOverviewARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["StaticSiteCustomDomainOverviewARMResource"], + **kwargs + ): + super(StaticSiteCustomDomainOverviewCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StaticSiteFunctionOverviewARMResource(ProxyOnlyResource): + """Static Site Function Overview ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar function_name: The name for the function. + :vartype function_name: str + :ivar trigger_type: The trigger type of the function. Possible values include: "HttpTrigger", + "Unknown". + :vartype trigger_type: str or ~azure.mgmt.web.v2020_06_01.models.TriggerTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'function_name': {'readonly': True}, + 'trigger_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'function_name': {'key': 'properties.functionName', 'type': 'str'}, + 'trigger_type': {'key': 'properties.triggerType', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(StaticSiteFunctionOverviewARMResource, self).__init__(kind=kind, **kwargs) + self.function_name = None + self.trigger_type = None + + +class StaticSiteFunctionOverviewCollection(msrest.serialization.Model): + """Collection of static site functions. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.StaticSiteFunctionOverviewARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteFunctionOverviewARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["StaticSiteFunctionOverviewARMResource"], + **kwargs + ): + super(StaticSiteFunctionOverviewCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StaticSitePatchResource(ProxyOnlyResource): + """ARM resource for a static site when patching. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar default_hostname: The default autogenerated hostname for the static site. + :vartype default_hostname: str + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :ivar custom_domains: The custom domains associated with this static site. + :vartype custom_domains: list[str] + :param repository_token: A user's github repository token. This is used to setup the Github + Actions workflow file and API secrets. + :type repository_token: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: ~azure.mgmt.web.v2020_06_01.models.StaticSiteBuildProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'default_hostname': {'readonly': True}, + 'custom_domains': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'default_hostname': {'key': 'properties.defaultHostname', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'custom_domains': {'key': 'properties.customDomains', 'type': '[str]'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + repository_url: Optional[str] = None, + branch: Optional[str] = None, + repository_token: Optional[str] = None, + build_properties: Optional["StaticSiteBuildProperties"] = None, + **kwargs + ): + super(StaticSitePatchResource, self).__init__(kind=kind, **kwargs) + self.default_hostname = None + self.repository_url = repository_url + self.branch = branch + self.custom_domains = None + self.repository_token = repository_token + self.build_properties = build_properties + + +class StaticSiteResetPropertiesARMResource(ProxyOnlyResource): + """Static Site Reset Properties ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param repository_token: The token which proves admin privileges to the repository. + :type repository_token: str + :param should_update_repository: Determines whether the repository should be updated with the + new properties. + :type should_update_repository: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'should_update_repository': {'key': 'properties.shouldUpdateRepository', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + repository_token: Optional[str] = None, + should_update_repository: Optional[bool] = None, + **kwargs + ): + super(StaticSiteResetPropertiesARMResource, self).__init__(kind=kind, **kwargs) + self.repository_token = repository_token + self.should_update_repository = should_update_repository + + +class StaticSitesWorkflowPreview(ProxyOnlyResource): + """Preview for the Static Site Workflow to be generated. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar path: The path for the workflow file to be generated. + :vartype path: str + :ivar contents: The contents for the workflow file to be generated. + :vartype contents: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'path': {'readonly': True}, + 'contents': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'contents': {'key': 'properties.contents', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(StaticSitesWorkflowPreview, self).__init__(kind=kind, **kwargs) + self.path = None + self.contents = None + + +class StaticSitesWorkflowPreviewRequest(ProxyOnlyResource): + """Request entity for previewing the Static Site workflow. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: ~azure.mgmt.web.v2020_06_01.models.StaticSiteBuildProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + repository_url: Optional[str] = None, + branch: Optional[str] = None, + build_properties: Optional["StaticSiteBuildProperties"] = None, + **kwargs + ): + super(StaticSitesWorkflowPreviewRequest, self).__init__(kind=kind, **kwargs) + self.repository_url = repository_url + self.branch = branch + self.build_properties = build_properties + + +class StaticSiteUserARMResource(ProxyOnlyResource): + """Static Site User ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar provider: The identity provider for the static site user. + :vartype provider: str + :ivar user_id: The user id for the static site user. + :vartype user_id: str + :ivar display_name: The display name for the static site user. + :vartype display_name: str + :param roles: The roles for the static site user, in free-form string format. + :type roles: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provider': {'readonly': True}, + 'user_id': {'readonly': True}, + 'display_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + roles: Optional[str] = None, + **kwargs + ): + super(StaticSiteUserARMResource, self).__init__(kind=kind, **kwargs) + self.provider = None + self.user_id = None + self.display_name = None + self.roles = roles + + +class StaticSiteUserCollection(msrest.serialization.Model): + """Collection of static site custom users. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.StaticSiteUserARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteUserARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["StaticSiteUserARMResource"], + **kwargs + ): + super(StaticSiteUserCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StaticSiteUserInvitationRequestResource(ProxyOnlyResource): + """Static sites user roles invitation resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param domain: The domain name for the static site custom domain. + :type domain: str + :param provider: The identity provider for the static site user. + :type provider: str + :param user_details: The user id for the static site user. + :type user_details: str + :param roles: The roles for the static site user, in free-form string format. + :type roles: str + :param num_hours_to_expiration: The number of hours the sas token stays valid. + :type num_hours_to_expiration: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'domain': {'key': 'properties.domain', 'type': 'str'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + 'user_details': {'key': 'properties.userDetails', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': 'str'}, + 'num_hours_to_expiration': {'key': 'properties.numHoursToExpiration', 'type': 'int'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + domain: Optional[str] = None, + provider: Optional[str] = None, + user_details: Optional[str] = None, + roles: Optional[str] = None, + num_hours_to_expiration: Optional[int] = None, + **kwargs + ): + super(StaticSiteUserInvitationRequestResource, self).__init__(kind=kind, **kwargs) + self.domain = domain + self.provider = provider + self.user_details = user_details + self.roles = roles + self.num_hours_to_expiration = num_hours_to_expiration + + +class StaticSiteUserInvitationResponseResource(ProxyOnlyResource): + """Static sites user roles invitation link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar expires_on: The expiration time of the invitation. + :vartype expires_on: ~datetime.datetime + :ivar invitation_url: The url for the invitation link. + :vartype invitation_url: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'expires_on': {'readonly': True}, + 'invitation_url': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'expires_on': {'key': 'properties.expiresOn', 'type': 'iso-8601'}, + 'invitation_url': {'key': 'properties.invitationUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(StaticSiteUserInvitationResponseResource, self).__init__(kind=kind, **kwargs) + self.expires_on = None + self.invitation_url = None + + +class StatusCodesBasedTrigger(msrest.serialization.Model): + """Trigger based on status code. + + :param status: HTTP status code. + :type status: int + :param sub_status: Request Sub Status. + :type sub_status: int + :param win32_status: Win32 error code. + :type win32_status: int + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'int'}, + 'sub_status': {'key': 'subStatus', 'type': 'int'}, + 'win32_status': {'key': 'win32Status', 'type': 'int'}, + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[int] = None, + sub_status: Optional[int] = None, + win32_status: Optional[int] = None, + count: Optional[int] = None, + time_interval: Optional[str] = None, + **kwargs + ): + super(StatusCodesBasedTrigger, self).__init__(**kwargs) + self.status = status + self.sub_status = sub_status + self.win32_status = win32_status + self.count = count + self.time_interval = time_interval + + +class StorageMigrationOptions(ProxyOnlyResource): + """Options for app content migration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param azurefiles_connection_string: AzureFiles connection string. + :type azurefiles_connection_string: str + :param azurefiles_share: AzureFiles share. + :type azurefiles_share: str + :param switch_site_after_migration: :code:`true`if the app should be switched + over; otherwise, :code:`false`. + :type switch_site_after_migration: bool + :param block_write_access_to_site: :code:`true` if the app should be read only + during copy operation; otherwise, :code:`false`. + :type block_write_access_to_site: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'azurefiles_connection_string': {'key': 'properties.azurefilesConnectionString', 'type': 'str'}, + 'azurefiles_share': {'key': 'properties.azurefilesShare', 'type': 'str'}, + 'switch_site_after_migration': {'key': 'properties.switchSiteAfterMigration', 'type': 'bool'}, + 'block_write_access_to_site': {'key': 'properties.blockWriteAccessToSite', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + azurefiles_connection_string: Optional[str] = None, + azurefiles_share: Optional[str] = None, + switch_site_after_migration: Optional[bool] = False, + block_write_access_to_site: Optional[bool] = False, + **kwargs + ): + super(StorageMigrationOptions, self).__init__(kind=kind, **kwargs) + self.azurefiles_connection_string = azurefiles_connection_string + self.azurefiles_share = azurefiles_share + self.switch_site_after_migration = switch_site_after_migration + self.block_write_access_to_site = block_write_access_to_site + + +class StorageMigrationResponse(ProxyOnlyResource): + """Response for a migration of app content request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar operation_id: When server starts the migration process, it will return an operation ID + identifying that particular migration operation. + :vartype operation_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'operation_id': {'key': 'properties.operationId', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(StorageMigrationResponse, self).__init__(kind=kind, **kwargs) + self.operation_id = None + + +class StringDictionary(ProxyOnlyResource): + """String dictionary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param properties: Settings. + :type properties: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + properties: Optional[Dict[str, str]] = None, + **kwargs + ): + super(StringDictionary, self).__init__(kind=kind, **kwargs) + self.properties = properties + + +class SwiftVirtualNetwork(ProxyOnlyResource): + """Swift Virtual Network Contract. This is used to enable the new Swift way of doing virtual network integration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param subnet_resource_id: The Virtual Network subnet's resource ID. This is the subnet that + this Web App will join. This subnet must have a delegation to Microsoft.Web/serverFarms defined + first. + :type subnet_resource_id: str + :param swift_supported: A flag that specifies if the scale unit this Web App is on supports + Swift integration. + :type swift_supported: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'subnet_resource_id': {'key': 'properties.subnetResourceId', 'type': 'str'}, + 'swift_supported': {'key': 'properties.swiftSupported', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + subnet_resource_id: Optional[str] = None, + swift_supported: Optional[bool] = None, + **kwargs + ): + super(SwiftVirtualNetwork, self).__init__(kind=kind, **kwargs) + self.subnet_resource_id = subnet_resource_id + self.swift_supported = swift_supported + + +class TldLegalAgreement(msrest.serialization.Model): + """Legal agreement for a top level domain. + + All required parameters must be populated in order to send to Azure. + + :param agreement_key: Required. Unique identifier for the agreement. + :type agreement_key: str + :param title: Required. Agreement title. + :type title: str + :param content: Required. Agreement details. + :type content: str + :param url: URL where a copy of the agreement details is hosted. + :type url: str + """ + + _validation = { + 'agreement_key': {'required': True}, + 'title': {'required': True}, + 'content': {'required': True}, + } + + _attribute_map = { + 'agreement_key': {'key': 'agreementKey', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'}, + 'content': {'key': 'content', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__( + self, + *, + agreement_key: str, + title: str, + content: str, + url: Optional[str] = None, + **kwargs + ): + super(TldLegalAgreement, self).__init__(**kwargs) + self.agreement_key = agreement_key + self.title = title + self.content = content + self.url = url + + +class TldLegalAgreementCollection(msrest.serialization.Model): + """Collection of top-level domain legal agreements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.TldLegalAgreement] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TldLegalAgreement]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["TldLegalAgreement"], + **kwargs + ): + super(TldLegalAgreementCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class TokenStore(ProxyOnlyResource): + """TokenStore. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: + :type enabled: bool + :param token_refresh_extension_hours: + :type token_refresh_extension_hours: float + :param file_system: + :type file_system: ~azure.mgmt.web.v2020_06_01.models.FileSystemTokenStore + :param azure_blob_storage: + :type azure_blob_storage: ~azure.mgmt.web.v2020_06_01.models.BlobStorageTokenStore + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'token_refresh_extension_hours': {'key': 'properties.tokenRefreshExtensionHours', 'type': 'float'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'FileSystemTokenStore'}, + 'azure_blob_storage': {'key': 'properties.azureBlobStorage', 'type': 'BlobStorageTokenStore'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + token_refresh_extension_hours: Optional[float] = None, + file_system: Optional["FileSystemTokenStore"] = None, + azure_blob_storage: Optional["BlobStorageTokenStore"] = None, + **kwargs + ): + super(TokenStore, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.token_refresh_extension_hours = token_refresh_extension_hours + self.file_system = file_system + self.azure_blob_storage = azure_blob_storage + + +class TopLevelDomain(ProxyOnlyResource): + """A top level domain object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param privacy: If :code:`true`, then the top level domain supports domain + privacy; otherwise, :code:`false`. + :type privacy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + privacy: Optional[bool] = None, + **kwargs + ): + super(TopLevelDomain, self).__init__(kind=kind, **kwargs) + self.privacy = privacy + + +class TopLevelDomainAgreementOption(msrest.serialization.Model): + """Options for retrieving the list of top level domain legal agreements. + + :param include_privacy: If :code:`true`, then the list of agreements will include + agreements for domain privacy as well; otherwise, :code:`false`. + :type include_privacy: bool + :param for_transfer: If :code:`true`, then the list of agreements will include + agreements for domain transfer as well; otherwise, :code:`false`. + :type for_transfer: bool + """ + + _attribute_map = { + 'include_privacy': {'key': 'includePrivacy', 'type': 'bool'}, + 'for_transfer': {'key': 'forTransfer', 'type': 'bool'}, + } + + def __init__( + self, + *, + include_privacy: Optional[bool] = None, + for_transfer: Optional[bool] = None, + **kwargs + ): + super(TopLevelDomainAgreementOption, self).__init__(**kwargs) + self.include_privacy = include_privacy + self.for_transfer = for_transfer + + +class TopLevelDomainCollection(msrest.serialization.Model): + """Collection of Top-level domains. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.TopLevelDomain] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TopLevelDomain]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["TopLevelDomain"], + **kwargs + ): + super(TopLevelDomainCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class TriggeredJobHistory(ProxyOnlyResource): + """Triggered Web Job History. List of Triggered Web Job Run Information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param runs: List of triggered web job runs. + :type runs: list[~azure.mgmt.web.v2020_06_01.models.TriggeredJobRun] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'runs': {'key': 'properties.runs', 'type': '[TriggeredJobRun]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + runs: Optional[List["TriggeredJobRun"]] = None, + **kwargs + ): + super(TriggeredJobHistory, self).__init__(kind=kind, **kwargs) + self.runs = runs + + +class TriggeredJobHistoryCollection(msrest.serialization.Model): + """Collection of Kudu continuous web job information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.TriggeredJobHistory] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TriggeredJobHistory]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["TriggeredJobHistory"], + **kwargs + ): + super(TriggeredJobHistoryCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class TriggeredJobRun(ProxyOnlyResource): + """Triggered Web Job Run Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param web_job_id: Job ID. + :type web_job_id: str + :param web_job_name: Job name. + :type web_job_name: str + :param status: Job status. Possible values include: "Success", "Failed", "Error". + :type status: str or ~azure.mgmt.web.v2020_06_01.models.TriggeredWebJobStatus + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param end_time: End time. + :type end_time: ~datetime.datetime + :param duration: Job duration. + :type duration: str + :param output_url: Output URL. + :type output_url: str + :param error_url: Error URL. + :type error_url: str + :param url: Job URL. + :type url: str + :param job_name: Job name. + :type job_name: str + :param trigger: Job trigger. + :type trigger: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'web_job_id': {'key': 'properties.web_job_id', 'type': 'str'}, + 'web_job_name': {'key': 'properties.web_job_name', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.end_time', 'type': 'iso-8601'}, + 'duration': {'key': 'properties.duration', 'type': 'str'}, + 'output_url': {'key': 'properties.output_url', 'type': 'str'}, + 'error_url': {'key': 'properties.error_url', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'job_name': {'key': 'properties.job_name', 'type': 'str'}, + 'trigger': {'key': 'properties.trigger', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + web_job_id: Optional[str] = None, + web_job_name: Optional[str] = None, + status: Optional[Union[str, "TriggeredWebJobStatus"]] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + duration: Optional[str] = None, + output_url: Optional[str] = None, + error_url: Optional[str] = None, + url: Optional[str] = None, + job_name: Optional[str] = None, + trigger: Optional[str] = None, + **kwargs + ): + super(TriggeredJobRun, self).__init__(kind=kind, **kwargs) + self.web_job_id = web_job_id + self.web_job_name = web_job_name + self.status = status + self.start_time = start_time + self.end_time = end_time + self.duration = duration + self.output_url = output_url + self.error_url = error_url + self.url = url + self.job_name = job_name + self.trigger = trigger + + +class TriggeredWebJob(ProxyOnlyResource): + """Triggered Web Job Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param latest_run: Latest job run information. + :type latest_run: ~azure.mgmt.web.v2020_06_01.models.TriggeredJobRun + :param history_url: History URL. + :type history_url: str + :param scheduler_logs_url: Scheduler Logs URL. + :type scheduler_logs_url: str + :param run_command: Run command. + :type run_command: str + :param url: Job URL. + :type url: str + :param extra_info_url: Extra Info URL. + :type extra_info_url: str + :param web_job_type: Job type. Possible values include: "Continuous", "Triggered". + :type web_job_type: str or ~azure.mgmt.web.v2020_06_01.models.WebJobType + :param error: Error information. + :type error: str + :param using_sdk: Using SDK?. + :type using_sdk: bool + :param settings: Job settings. + :type settings: dict[str, object] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'latest_run': {'key': 'properties.latest_run', 'type': 'TriggeredJobRun'}, + 'history_url': {'key': 'properties.history_url', 'type': 'str'}, + 'scheduler_logs_url': {'key': 'properties.scheduler_logs_url', 'type': 'str'}, + 'run_command': {'key': 'properties.run_command', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'extra_info_url': {'key': 'properties.extra_info_url', 'type': 'str'}, + 'web_job_type': {'key': 'properties.web_job_type', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'str'}, + 'using_sdk': {'key': 'properties.using_sdk', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': '{object}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + latest_run: Optional["TriggeredJobRun"] = None, + history_url: Optional[str] = None, + scheduler_logs_url: Optional[str] = None, + run_command: Optional[str] = None, + url: Optional[str] = None, + extra_info_url: Optional[str] = None, + web_job_type: Optional[Union[str, "WebJobType"]] = None, + error: Optional[str] = None, + using_sdk: Optional[bool] = None, + settings: Optional[Dict[str, object]] = None, + **kwargs + ): + super(TriggeredWebJob, self).__init__(kind=kind, **kwargs) + self.latest_run = latest_run + self.history_url = history_url + self.scheduler_logs_url = scheduler_logs_url + self.run_command = run_command + self.url = url + self.extra_info_url = extra_info_url + self.web_job_type = web_job_type + self.error = error + self.using_sdk = using_sdk + self.settings = settings + + +class TriggeredWebJobCollection(msrest.serialization.Model): + """Collection of Kudu continuous web job information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.TriggeredWebJob] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TriggeredWebJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["TriggeredWebJob"], + **kwargs + ): + super(TriggeredWebJobCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class Twitter(ProxyOnlyResource): + """Twitter. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_06_01.models.TwitterRegistration + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'TwitterRegistration'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + registration: Optional["TwitterRegistration"] = None, + **kwargs + ): + super(Twitter, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.registration = registration + + +class TwitterRegistration(ProxyOnlyResource): + """TwitterRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param consumer_key: + :type consumer_key: str + :param consumer_secret_setting_name: + :type consumer_secret_setting_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'consumer_key': {'key': 'properties.consumerKey', 'type': 'str'}, + 'consumer_secret_setting_name': {'key': 'properties.consumerSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + consumer_key: Optional[str] = None, + consumer_secret_setting_name: Optional[str] = None, + **kwargs + ): + super(TwitterRegistration, self).__init__(kind=kind, **kwargs) + self.consumer_key = consumer_key + self.consumer_secret_setting_name = consumer_secret_setting_name + + +class Usage(ProxyOnlyResource): + """Usage of the quota resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: Friendly name shown in the UI. + :vartype display_name: str + :ivar resource_name: Name of the quota resource. + :vartype resource_name: str + :ivar unit: Units of measurement for the quota resource. + :vartype unit: str + :ivar current_value: The current value of the resource counter. + :vartype current_value: long + :ivar limit: The resource limit. + :vartype limit: long + :ivar next_reset_time: Next reset time for the resource counter. + :vartype next_reset_time: ~datetime.datetime + :ivar compute_mode: Compute mode used for this usage. Possible values include: "Shared", + "Dedicated", "Dynamic". + :vartype compute_mode: str or ~azure.mgmt.web.v2020_06_01.models.ComputeModeOptions + :ivar site_mode: Site mode used for this usage. + :vartype site_mode: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'resource_name': {'readonly': True}, + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'next_reset_time': {'readonly': True}, + 'compute_mode': {'readonly': True}, + 'site_mode': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'resource_name': {'key': 'properties.resourceName', 'type': 'str'}, + 'unit': {'key': 'properties.unit', 'type': 'str'}, + 'current_value': {'key': 'properties.currentValue', 'type': 'long'}, + 'limit': {'key': 'properties.limit', 'type': 'long'}, + 'next_reset_time': {'key': 'properties.nextResetTime', 'type': 'iso-8601'}, + 'compute_mode': {'key': 'properties.computeMode', 'type': 'str'}, + 'site_mode': {'key': 'properties.siteMode', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(Usage, self).__init__(kind=kind, **kwargs) + self.display_name = None + self.resource_name = None + self.unit = None + self.current_value = None + self.limit = None + self.next_reset_time = None + self.compute_mode = None + self.site_mode = None + + +class UsageCollection(msrest.serialization.Model): + """Collection of usages. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.Usage] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Usage"], + **kwargs + ): + super(UsageCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class User(ProxyOnlyResource): + """User credentials used for publishing activity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param publishing_user_name: Username used for publishing. + :type publishing_user_name: str + :param publishing_password: Password used for publishing. + :type publishing_password: str + :param publishing_password_hash: Password hash used for publishing. + :type publishing_password_hash: str + :param publishing_password_hash_salt: Password hash salt used for publishing. + :type publishing_password_hash_salt: str + :param scm_uri: Url of SCM site. + :type scm_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'publishing_user_name': {'key': 'properties.publishingUserName', 'type': 'str'}, + 'publishing_password': {'key': 'properties.publishingPassword', 'type': 'str'}, + 'publishing_password_hash': {'key': 'properties.publishingPasswordHash', 'type': 'str'}, + 'publishing_password_hash_salt': {'key': 'properties.publishingPasswordHashSalt', 'type': 'str'}, + 'scm_uri': {'key': 'properties.scmUri', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + publishing_user_name: Optional[str] = None, + publishing_password: Optional[str] = None, + publishing_password_hash: Optional[str] = None, + publishing_password_hash_salt: Optional[str] = None, + scm_uri: Optional[str] = None, + **kwargs + ): + super(User, self).__init__(kind=kind, **kwargs) + self.publishing_user_name = publishing_user_name + self.publishing_password = publishing_password + self.publishing_password_hash = publishing_password_hash + self.publishing_password_hash_salt = publishing_password_hash_salt + self.scm_uri = scm_uri + + +class ValidateRequest(msrest.serialization.Model): + """Resource validation request content. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name to verify. + :type name: str + :param type: Required. Resource type used for verification. Possible values include: + "ServerFarm", "Site". + :type type: str or ~azure.mgmt.web.v2020_06_01.models.ValidateResourceTypes + :param location: Required. Expected location of the resource. + :type location: str + :param server_farm_id: ARM resource ID of an App Service plan that would host the app. + :type server_farm_id: str + :param sku_name: Name of the target SKU for the App Service plan. + :type sku_name: str + :param need_linux_workers: :code:`true` if App Service plan is for Linux workers; + otherwise, :code:`false`. + :type need_linux_workers: bool + :param is_spot: :code:`true` if App Service plan is for Spot instances; otherwise, + :code:`false`. + :type is_spot: bool + :param capacity: Target capacity of the App Service plan (number of VMs). + :type capacity: int + :param hosting_environment: Name of App Service Environment where app or App Service plan + should be created. + :type hosting_environment: str + :param is_xenon: :code:`true` if App Service plan is running as a windows + container. + :type is_xenon: bool + :param container_registry_base_url: Base URL of the container registry. + :type container_registry_base_url: str + :param container_registry_username: Username for to access the container registry. + :type container_registry_username: str + :param container_registry_password: Password for to access the container registry. + :type container_registry_password: str + :param container_image_repository: Repository name (image name). + :type container_image_repository: str + :param container_image_tag: Image tag. + :type container_image_tag: str + :param container_image_platform: Platform (windows or linux). + :type container_image_platform: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + 'location': {'required': True}, + 'capacity': {'minimum': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'sku_name': {'key': 'properties.skuName', 'type': 'str'}, + 'need_linux_workers': {'key': 'properties.needLinuxWorkers', 'type': 'bool'}, + 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, + 'capacity': {'key': 'properties.capacity', 'type': 'int'}, + 'hosting_environment': {'key': 'properties.hostingEnvironment', 'type': 'str'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'container_registry_base_url': {'key': 'properties.containerRegistryBaseUrl', 'type': 'str'}, + 'container_registry_username': {'key': 'properties.containerRegistryUsername', 'type': 'str'}, + 'container_registry_password': {'key': 'properties.containerRegistryPassword', 'type': 'str'}, + 'container_image_repository': {'key': 'properties.containerImageRepository', 'type': 'str'}, + 'container_image_tag': {'key': 'properties.containerImageTag', 'type': 'str'}, + 'container_image_platform': {'key': 'properties.containerImagePlatform', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + type: Union[str, "ValidateResourceTypes"], + location: str, + server_farm_id: Optional[str] = None, + sku_name: Optional[str] = None, + need_linux_workers: Optional[bool] = None, + is_spot: Optional[bool] = None, + capacity: Optional[int] = None, + hosting_environment: Optional[str] = None, + is_xenon: Optional[bool] = None, + container_registry_base_url: Optional[str] = None, + container_registry_username: Optional[str] = None, + container_registry_password: Optional[str] = None, + container_image_repository: Optional[str] = None, + container_image_tag: Optional[str] = None, + container_image_platform: Optional[str] = None, + **kwargs + ): + super(ValidateRequest, self).__init__(**kwargs) + self.name = name + self.type = type + self.location = location + self.server_farm_id = server_farm_id + self.sku_name = sku_name + self.need_linux_workers = need_linux_workers + self.is_spot = is_spot + self.capacity = capacity + self.hosting_environment = hosting_environment + self.is_xenon = is_xenon + self.container_registry_base_url = container_registry_base_url + self.container_registry_username = container_registry_username + self.container_registry_password = container_registry_password + self.container_image_repository = container_image_repository + self.container_image_tag = container_image_tag + self.container_image_platform = container_image_platform + + +class ValidateResponse(msrest.serialization.Model): + """Describes the result of resource validation. + + :param status: Result of validation. + :type status: str + :param error: Error details for the case when validation fails. + :type error: ~azure.mgmt.web.v2020_06_01.models.ValidateResponseError + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ValidateResponseError'}, + } + + def __init__( + self, + *, + status: Optional[str] = None, + error: Optional["ValidateResponseError"] = None, + **kwargs + ): + super(ValidateResponse, self).__init__(**kwargs) + self.status = status + self.error = error + + +class ValidateResponseError(msrest.serialization.Model): + """Error details for when validation fails. + + :param code: Validation error code. + :type code: str + :param message: Validation error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ValidateResponseError, self).__init__(**kwargs) + self.code = code + self.message = message + + +class VirtualApplication(msrest.serialization.Model): + """Virtual application in an app. + + :param virtual_path: Virtual path. + :type virtual_path: str + :param physical_path: Physical path. + :type physical_path: str + :param preload_enabled: :code:`true` if preloading is enabled; otherwise, + :code:`false`. + :type preload_enabled: bool + :param virtual_directories: Virtual directories for virtual application. + :type virtual_directories: list[~azure.mgmt.web.v2020_06_01.models.VirtualDirectory] + """ + + _attribute_map = { + 'virtual_path': {'key': 'virtualPath', 'type': 'str'}, + 'physical_path': {'key': 'physicalPath', 'type': 'str'}, + 'preload_enabled': {'key': 'preloadEnabled', 'type': 'bool'}, + 'virtual_directories': {'key': 'virtualDirectories', 'type': '[VirtualDirectory]'}, + } + + def __init__( + self, + *, + virtual_path: Optional[str] = None, + physical_path: Optional[str] = None, + preload_enabled: Optional[bool] = None, + virtual_directories: Optional[List["VirtualDirectory"]] = None, + **kwargs + ): + super(VirtualApplication, self).__init__(**kwargs) + self.virtual_path = virtual_path + self.physical_path = physical_path + self.preload_enabled = preload_enabled + self.virtual_directories = virtual_directories + + +class VirtualDirectory(msrest.serialization.Model): + """Directory for virtual application. + + :param virtual_path: Path to virtual application. + :type virtual_path: str + :param physical_path: Physical path. + :type physical_path: str + """ + + _attribute_map = { + 'virtual_path': {'key': 'virtualPath', 'type': 'str'}, + 'physical_path': {'key': 'physicalPath', 'type': 'str'}, + } + + def __init__( + self, + *, + virtual_path: Optional[str] = None, + physical_path: Optional[str] = None, + **kwargs + ): + super(VirtualDirectory, self).__init__(**kwargs) + self.virtual_path = virtual_path + self.physical_path = physical_path + + +class VirtualIPMapping(msrest.serialization.Model): + """Virtual IP mapping. + + :param virtual_ip: Virtual IP address. + :type virtual_ip: str + :param internal_http_port: Internal HTTP port. + :type internal_http_port: int + :param internal_https_port: Internal HTTPS port. + :type internal_https_port: int + :param in_use: Is virtual IP mapping in use. + :type in_use: bool + :param service_name: name of the service that virtual IP is assigned to. + :type service_name: str + """ + + _attribute_map = { + 'virtual_ip': {'key': 'virtualIP', 'type': 'str'}, + 'internal_http_port': {'key': 'internalHttpPort', 'type': 'int'}, + 'internal_https_port': {'key': 'internalHttpsPort', 'type': 'int'}, + 'in_use': {'key': 'inUse', 'type': 'bool'}, + 'service_name': {'key': 'serviceName', 'type': 'str'}, + } + + def __init__( + self, + *, + virtual_ip: Optional[str] = None, + internal_http_port: Optional[int] = None, + internal_https_port: Optional[int] = None, + in_use: Optional[bool] = None, + service_name: Optional[str] = None, + **kwargs + ): + super(VirtualIPMapping, self).__init__(**kwargs) + self.virtual_ip = virtual_ip + self.internal_http_port = internal_http_port + self.internal_https_port = internal_https_port + self.in_use = in_use + self.service_name = service_name + + +class VirtualNetworkProfile(msrest.serialization.Model): + """Specification for using a Virtual Network. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource id of the Virtual Network. + :type id: str + :ivar name: Name of the Virtual Network (read-only). + :vartype name: str + :ivar type: Resource type of the Virtual Network (read-only). + :vartype type: str + :param subnet: Subnet within the Virtual Network. + :type subnet: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + subnet: Optional[str] = None, + **kwargs + ): + super(VirtualNetworkProfile, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + self.subnet = subnet + + +class VnetGateway(ProxyOnlyResource): + """The Virtual Network gateway contract. This is used to give the Virtual Network gateway access to the VPN package. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param vnet_name: The Virtual Network name. + :type vnet_name: str + :param vpn_package_uri: The URI where the VPN package can be downloaded. + :type vpn_package_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vpn_package_uri': {'key': 'properties.vpnPackageUri', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + vnet_name: Optional[str] = None, + vpn_package_uri: Optional[str] = None, + **kwargs + ): + super(VnetGateway, self).__init__(kind=kind, **kwargs) + self.vnet_name = vnet_name + self.vpn_package_uri = vpn_package_uri + + +class VnetInfo(ProxyOnlyResource): + """Virtual Network information contract. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param vnet_resource_id: The Virtual Network's resource ID. + :type vnet_resource_id: str + :ivar cert_thumbprint: The client certificate thumbprint. + :vartype cert_thumbprint: str + :param cert_blob: A certificate file (.cer) blob containing the public key of the private key + used to authenticate a + Point-To-Site VPN connection. + :type cert_blob: str + :ivar routes: The routes that this Virtual Network connection uses. + :vartype routes: list[~azure.mgmt.web.v2020_06_01.models.VnetRoute] + :ivar resync_required: :code:`true` if a resync is required; otherwise, + :code:`false`. + :vartype resync_required: bool + :param dns_servers: DNS servers to be used by this Virtual Network. This should be a comma- + separated list of IP addresses. + :type dns_servers: str + :param is_swift: Flag that is used to denote if this is VNET injection. + :type is_swift: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'cert_thumbprint': {'readonly': True}, + 'routes': {'readonly': True}, + 'resync_required': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vnet_resource_id': {'key': 'properties.vnetResourceId', 'type': 'str'}, + 'cert_thumbprint': {'key': 'properties.certThumbprint', 'type': 'str'}, + 'cert_blob': {'key': 'properties.certBlob', 'type': 'str'}, + 'routes': {'key': 'properties.routes', 'type': '[VnetRoute]'}, + 'resync_required': {'key': 'properties.resyncRequired', 'type': 'bool'}, + 'dns_servers': {'key': 'properties.dnsServers', 'type': 'str'}, + 'is_swift': {'key': 'properties.isSwift', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + vnet_resource_id: Optional[str] = None, + cert_blob: Optional[str] = None, + dns_servers: Optional[str] = None, + is_swift: Optional[bool] = None, + **kwargs + ): + super(VnetInfo, self).__init__(kind=kind, **kwargs) + self.vnet_resource_id = vnet_resource_id + self.cert_thumbprint = None + self.cert_blob = cert_blob + self.routes = None + self.resync_required = None + self.dns_servers = dns_servers + self.is_swift = is_swift + + +class VnetParameters(ProxyOnlyResource): + """The required set of inputs to validate a VNET. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param vnet_resource_group: The Resource Group of the VNET to be validated. + :type vnet_resource_group: str + :param vnet_name: The name of the VNET to be validated. + :type vnet_name: str + :param vnet_subnet_name: The subnet name to be validated. + :type vnet_subnet_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vnet_resource_group': {'key': 'properties.vnetResourceGroup', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'properties.vnetSubnetName', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + vnet_resource_group: Optional[str] = None, + vnet_name: Optional[str] = None, + vnet_subnet_name: Optional[str] = None, + **kwargs + ): + super(VnetParameters, self).__init__(kind=kind, **kwargs) + self.vnet_resource_group = vnet_resource_group + self.vnet_name = vnet_name + self.vnet_subnet_name = vnet_subnet_name + + +class VnetRoute(ProxyOnlyResource): + """Virtual Network route contract used to pass routing information for a Virtual Network. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param start_address: The starting address for this route. This may also include a CIDR + notation, in which case the end address must not be specified. + :type start_address: str + :param end_address: The ending address for this route. If the start address is specified in + CIDR notation, this must be omitted. + :type end_address: str + :param route_type: The type of route this is: + DEFAULT - By default, every app has routes to the local address ranges specified by RFC1918 + INHERITED - Routes inherited from the real Virtual Network routes + STATIC - Static route set on the app only + + These values will be used for syncing an app's routes with those from a Virtual Network. + Possible values include: "DEFAULT", "INHERITED", "STATIC". + :type route_type: str or ~azure.mgmt.web.v2020_06_01.models.RouteType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_address': {'key': 'properties.startAddress', 'type': 'str'}, + 'end_address': {'key': 'properties.endAddress', 'type': 'str'}, + 'route_type': {'key': 'properties.routeType', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + start_address: Optional[str] = None, + end_address: Optional[str] = None, + route_type: Optional[Union[str, "RouteType"]] = None, + **kwargs + ): + super(VnetRoute, self).__init__(kind=kind, **kwargs) + self.start_address = start_address + self.end_address = end_address + self.route_type = route_type + + +class VnetValidationFailureDetails(ProxyOnlyResource): + """A class that describes the reason for a validation failure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param failed: A flag describing whether or not validation failed. + :type failed: bool + :param failed_tests: A list of tests that failed in the validation. + :type failed_tests: list[~azure.mgmt.web.v2020_06_01.models.VnetValidationTestFailure] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'failed': {'key': 'properties.failed', 'type': 'bool'}, + 'failed_tests': {'key': 'properties.failedTests', 'type': '[VnetValidationTestFailure]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + failed: Optional[bool] = None, + failed_tests: Optional[List["VnetValidationTestFailure"]] = None, + **kwargs + ): + super(VnetValidationFailureDetails, self).__init__(kind=kind, **kwargs) + self.failed = failed + self.failed_tests = failed_tests + + +class VnetValidationTestFailure(ProxyOnlyResource): + """A class that describes a test that failed during NSG and UDR validation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param test_name: The name of the test that failed. + :type test_name: str + :param details: The details of what caused the failure, e.g. the blocking rule name, etc. + :type details: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'test_name': {'key': 'properties.testName', 'type': 'str'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + test_name: Optional[str] = None, + details: Optional[str] = None, + **kwargs + ): + super(VnetValidationTestFailure, self).__init__(kind=kind, **kwargs) + self.test_name = test_name + self.details = details + + +class WebAppCollection(msrest.serialization.Model): + """Collection of App Service apps. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.Site] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Site]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Site"], + **kwargs + ): + super(WebAppCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class WebAppInstanceStatusCollection(msrest.serialization.Model): + """Collection of app instances. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.WebSiteInstanceStatus] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WebSiteInstanceStatus]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["WebSiteInstanceStatus"], + **kwargs + ): + super(WebAppInstanceStatusCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class WebJob(ProxyOnlyResource): + """Web Job Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param run_command: Run command. + :type run_command: str + :param url: Job URL. + :type url: str + :param extra_info_url: Extra Info URL. + :type extra_info_url: str + :param web_job_type: Job type. Possible values include: "Continuous", "Triggered". + :type web_job_type: str or ~azure.mgmt.web.v2020_06_01.models.WebJobType + :param error: Error information. + :type error: str + :param using_sdk: Using SDK?. + :type using_sdk: bool + :param settings: Job settings. + :type settings: dict[str, object] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'run_command': {'key': 'properties.run_command', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'extra_info_url': {'key': 'properties.extra_info_url', 'type': 'str'}, + 'web_job_type': {'key': 'properties.web_job_type', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'str'}, + 'using_sdk': {'key': 'properties.using_sdk', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': '{object}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + run_command: Optional[str] = None, + url: Optional[str] = None, + extra_info_url: Optional[str] = None, + web_job_type: Optional[Union[str, "WebJobType"]] = None, + error: Optional[str] = None, + using_sdk: Optional[bool] = None, + settings: Optional[Dict[str, object]] = None, + **kwargs + ): + super(WebJob, self).__init__(kind=kind, **kwargs) + self.run_command = run_command + self.url = url + self.extra_info_url = extra_info_url + self.web_job_type = web_job_type + self.error = error + self.using_sdk = using_sdk + self.settings = settings + + +class WebJobCollection(msrest.serialization.Model): + """Collection of Kudu web job information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.WebJob] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WebJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["WebJob"], + **kwargs + ): + super(WebJobCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class WebSiteInstanceStatus(ProxyOnlyResource): + """WebSiteInstanceStatus. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param state: Possible values include: "READY", "STOPPED", "UNKNOWN". + :type state: str or ~azure.mgmt.web.v2020_06_01.models.SiteRuntimeState + :param status_url: Link to the GetStatusApi in Kudu. + :type status_url: str + :param detector_url: Link to the Diagnose and Solve Portal. + :type detector_url: str + :param console_url: Link to the console to web app instance. + :type console_url: str + :param health_check_url: Link to the console to web app instance. + :type health_check_url: str + :param containers: Dictionary of :code:``. + :type containers: dict[str, ~azure.mgmt.web.v2020_06_01.models.ContainerInfo] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'status_url': {'key': 'properties.statusUrl', 'type': 'str'}, + 'detector_url': {'key': 'properties.detectorUrl', 'type': 'str'}, + 'console_url': {'key': 'properties.consoleUrl', 'type': 'str'}, + 'health_check_url': {'key': 'properties.healthCheckUrl', 'type': 'str'}, + 'containers': {'key': 'properties.containers', 'type': '{ContainerInfo}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + state: Optional[Union[str, "SiteRuntimeState"]] = None, + status_url: Optional[str] = None, + detector_url: Optional[str] = None, + console_url: Optional[str] = None, + health_check_url: Optional[str] = None, + containers: Optional[Dict[str, "ContainerInfo"]] = None, + **kwargs + ): + super(WebSiteInstanceStatus, self).__init__(kind=kind, **kwargs) + self.state = state + self.status_url = status_url + self.detector_url = detector_url + self.console_url = console_url + self.health_check_url = health_check_url + self.containers = containers + + +class WorkerPool(msrest.serialization.Model): + """Worker pool of an App Service Environment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param worker_size_id: Worker size ID for referencing this worker pool. + :type worker_size_id: int + :param compute_mode: Shared or dedicated app hosting. Possible values include: "Shared", + "Dedicated", "Dynamic". + :type compute_mode: str or ~azure.mgmt.web.v2020_06_01.models.ComputeModeOptions + :param worker_size: VM size of the worker pool instances. + :type worker_size: str + :param worker_count: Number of instances in the worker pool. + :type worker_count: int + :ivar instance_names: Names of all instances in the worker pool (read only). + :vartype instance_names: list[str] + """ + + _validation = { + 'instance_names': {'readonly': True}, + } + + _attribute_map = { + 'worker_size_id': {'key': 'workerSizeId', 'type': 'int'}, + 'compute_mode': {'key': 'computeMode', 'type': 'str'}, + 'worker_size': {'key': 'workerSize', 'type': 'str'}, + 'worker_count': {'key': 'workerCount', 'type': 'int'}, + 'instance_names': {'key': 'instanceNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + worker_size_id: Optional[int] = None, + compute_mode: Optional[Union[str, "ComputeModeOptions"]] = None, + worker_size: Optional[str] = None, + worker_count: Optional[int] = None, + **kwargs + ): + super(WorkerPool, self).__init__(**kwargs) + self.worker_size_id = worker_size_id + self.compute_mode = compute_mode + self.worker_size = worker_size + self.worker_count = worker_count + self.instance_names = None + + +class WorkerPoolCollection(msrest.serialization.Model): + """Collection of worker pools. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkerPoolResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["WorkerPoolResource"], + **kwargs + ): + super(WorkerPoolCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class WorkerPoolResource(ProxyOnlyResource): + """Worker pool of an App Service Environment ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param sku: Description of a SKU for a scalable resource. + :type sku: ~azure.mgmt.web.v2020_06_01.models.SkuDescription + :param worker_size_id: Worker size ID for referencing this worker pool. + :type worker_size_id: int + :param compute_mode: Shared or dedicated app hosting. Possible values include: "Shared", + "Dedicated", "Dynamic". + :type compute_mode: str or ~azure.mgmt.web.v2020_06_01.models.ComputeModeOptions + :param worker_size: VM size of the worker pool instances. + :type worker_size: str + :param worker_count: Number of instances in the worker pool. + :type worker_count: int + :ivar instance_names: Names of all instances in the worker pool (read only). + :vartype instance_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'instance_names': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'worker_size_id': {'key': 'properties.workerSizeId', 'type': 'int'}, + 'compute_mode': {'key': 'properties.computeMode', 'type': 'str'}, + 'worker_size': {'key': 'properties.workerSize', 'type': 'str'}, + 'worker_count': {'key': 'properties.workerCount', 'type': 'int'}, + 'instance_names': {'key': 'properties.instanceNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + sku: Optional["SkuDescription"] = None, + worker_size_id: Optional[int] = None, + compute_mode: Optional[Union[str, "ComputeModeOptions"]] = None, + worker_size: Optional[str] = None, + worker_count: Optional[int] = None, + **kwargs + ): + super(WorkerPoolResource, self).__init__(kind=kind, **kwargs) + self.sku = sku + self.worker_size_id = worker_size_id + self.compute_mode = compute_mode + self.worker_size = worker_size + self.worker_count = worker_count + self.instance_names = None diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/models/_web_site_management_client_enums.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/models/_web_site_management_client_enums.py new file mode 100644 index 000000000000..68859ecad0b0 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/models/_web_site_management_client_enums.py @@ -0,0 +1,751 @@ +# 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, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AccessControlEntryAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Action object. + """ + + PERMIT = "Permit" + DENY = "Deny" + +class AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REGISTRATION_STATUS_NOT_SUPPORTED_FOR_RENEWAL = "RegistrationStatusNotSupportedForRenewal" + EXPIRATION_NOT_IN_RENEWAL_TIME_RANGE = "ExpirationNotInRenewalTimeRange" + SUBSCRIPTION_NOT_ACTIVE = "SubscriptionNotActive" + +class AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REGISTRATION_STATUS_NOT_SUPPORTED_FOR_RENEWAL = "RegistrationStatusNotSupportedForRenewal" + EXPIRATION_NOT_IN_RENEWAL_TIME_RANGE = "ExpirationNotInRenewalTimeRange" + SUBSCRIPTION_NOT_ACTIVE = "SubscriptionNotActive" + +class AppServicePlanRestrictions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """App Service plans this offer is restricted to. + """ + + NONE = "None" + FREE = "Free" + SHARED = "Shared" + BASIC = "Basic" + STANDARD = "Standard" + PREMIUM = "Premium" + +class AutoHealActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Predefined action to be taken. + """ + + RECYCLE = "Recycle" + LOG_EVENT = "LogEvent" + CUSTOM_ACTION = "CustomAction" + +class AzureResourceType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the Azure resource the hostname is assigned to. + """ + + WEBSITE = "Website" + TRAFFIC_MANAGER = "TrafficManager" + +class AzureStorageState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """State of the storage account. + """ + + OK = "Ok" + INVALID_CREDENTIALS = "InvalidCredentials" + INVALID_SHARE = "InvalidShare" + +class AzureStorageType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of storage. + """ + + AZURE_FILES = "AzureFiles" + AZURE_BLOB = "AzureBlob" + +class BackupItemStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Backup status. + """ + + IN_PROGRESS = "InProgress" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + TIMED_OUT = "TimedOut" + CREATED = "Created" + SKIPPED = "Skipped" + PARTIALLY_SUCCEEDED = "PartiallySucceeded" + DELETE_IN_PROGRESS = "DeleteInProgress" + DELETE_FAILED = "DeleteFailed" + DELETED = "Deleted" + +class BackupRestoreOperationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Operation type. + """ + + DEFAULT = "Default" + CLONE = "Clone" + RELOCATION = "Relocation" + SNAPSHOT = "Snapshot" + CLOUD_FS = "CloudFS" + +class BuildStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of the static site build. + """ + + WAITING_FOR_DEPLOYMENT = "WaitingForDeployment" + UPLOADING = "Uploading" + DEPLOYING = "Deploying" + READY = "Ready" + FAILED = "Failed" + DELETING = "Deleting" + DETACHED = "Detached" + +class BuiltInAuthenticationProvider(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The default authentication provider to use when multiple providers are configured. + This setting is only needed if multiple providers are configured and the unauthenticated client + action is set to "RedirectToLoginPage". + """ + + AZURE_ACTIVE_DIRECTORY = "AzureActiveDirectory" + FACEBOOK = "Facebook" + GOOGLE = "Google" + MICROSOFT_ACCOUNT = "MicrosoftAccount" + TWITTER = "Twitter" + GITHUB = "Github" + +class CertificateOrderActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Action type. + """ + + CERTIFICATE_ISSUED = "CertificateIssued" + CERTIFICATE_ORDER_CANCELED = "CertificateOrderCanceled" + CERTIFICATE_ORDER_CREATED = "CertificateOrderCreated" + CERTIFICATE_REVOKED = "CertificateRevoked" + DOMAIN_VALIDATION_COMPLETE = "DomainValidationComplete" + FRAUD_DETECTED = "FraudDetected" + ORG_NAME_CHANGE = "OrgNameChange" + ORG_VALIDATION_COMPLETE = "OrgValidationComplete" + SAN_DROP = "SanDrop" + FRAUD_CLEARED = "FraudCleared" + CERTIFICATE_EXPIRED = "CertificateExpired" + CERTIFICATE_EXPIRATION_WARNING = "CertificateExpirationWarning" + FRAUD_DOCUMENTATION_REQUIRED = "FraudDocumentationRequired" + UNKNOWN = "Unknown" + +class CertificateOrderStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current order status. + """ + + PENDINGISSUANCE = "Pendingissuance" + ISSUED = "Issued" + REVOKED = "Revoked" + CANCELED = "Canceled" + DENIED = "Denied" + PENDINGREVOCATION = "Pendingrevocation" + PENDING_REKEY = "PendingRekey" + UNUSED = "Unused" + EXPIRED = "Expired" + NOT_SUBMITTED = "NotSubmitted" + +class CertificateProductType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Certificate product type. + """ + + STANDARD_DOMAIN_VALIDATED_SSL = "StandardDomainValidatedSsl" + STANDARD_DOMAIN_VALIDATED_WILD_CARD_SSL = "StandardDomainValidatedWildCardSsl" + +class Channels(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """List of channels that this recommendation can apply. + """ + + NOTIFICATION = "Notification" + API = "Api" + EMAIL = "Email" + WEBHOOK = "Webhook" + ALL = "All" + +class CheckNameResourceTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Resource type used for verification. + """ + + SITE = "Site" + SLOT = "Slot" + HOSTING_ENVIRONMENT = "HostingEnvironment" + PUBLISHING_USER = "PublishingUser" + MICROSOFT_WEB_SITES = "Microsoft.Web/sites" + MICROSOFT_WEB_SITES_SLOTS = "Microsoft.Web/sites/slots" + MICROSOFT_WEB_HOSTING_ENVIRONMENTS = "Microsoft.Web/hostingEnvironments" + MICROSOFT_WEB_PUBLISHING_USERS = "Microsoft.Web/publishingUsers" + +class ClientCertMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This composes with ClientCertEnabled setting. + + + * ClientCertEnabled: false means ClientCert is ignored. + * ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + * ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or + accepted. + """ + + REQUIRED = "Required" + OPTIONAL = "Optional" + +class CloneAbilityResult(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of app. + """ + + CLONEABLE = "Cloneable" + PARTIALLY_CLONEABLE = "PartiallyCloneable" + NOT_CLONEABLE = "NotCloneable" + +class ComputeModeOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Shared/dedicated workers. + """ + + SHARED = "Shared" + DEDICATED = "Dedicated" + DYNAMIC = "Dynamic" + +class ConnectionStringType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of database. + """ + + MY_SQL = "MySql" + SQL_SERVER = "SQLServer" + SQL_AZURE = "SQLAzure" + CUSTOM = "Custom" + NOTIFICATION_HUB = "NotificationHub" + SERVICE_BUS = "ServiceBus" + EVENT_HUB = "EventHub" + API_HUB = "ApiHub" + DOC_DB = "DocDb" + REDIS_CACHE = "RedisCache" + POSTGRE_SQL = "PostgreSQL" + +class ContinuousWebJobStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Job status. + """ + + INITIALIZING = "Initializing" + STARTING = "Starting" + RUNNING = "Running" + PENDING_RESTART = "PendingRestart" + STOPPED = "Stopped" + +class CookieExpirationConvention(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + FIXED_TIME = "FixedTime" + IDENTITY_PROVIDER_DERIVED = "IdentityProviderDerived" + +class CustomHostNameDnsRecordType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the DNS record. + """ + + C_NAME = "CName" + A = "A" + +class DatabaseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Database type (e.g. SqlAzure / MySql). + """ + + SQL_AZURE = "SqlAzure" + MY_SQL = "MySql" + LOCAL_MY_SQL = "LocalMySql" + POSTGRE_SQL = "PostgreSql" + +class DnsType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current DNS type + """ + + AZURE_DNS = "AzureDns" + DEFAULT_DOMAIN_REGISTRAR_DNS = "DefaultDomainRegistrarDns" + +class DnsVerificationTestResult(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """DNS verification test result. + """ + + PASSED = "Passed" + FAILED = "Failed" + SKIPPED = "Skipped" + +class DomainPatchResourcePropertiesDomainNotRenewableReasonsItem(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REGISTRATION_STATUS_NOT_SUPPORTED_FOR_RENEWAL = "RegistrationStatusNotSupportedForRenewal" + EXPIRATION_NOT_IN_RENEWAL_TIME_RANGE = "ExpirationNotInRenewalTimeRange" + SUBSCRIPTION_NOT_ACTIVE = "SubscriptionNotActive" + +class DomainPropertiesDomainNotRenewableReasonsItem(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REGISTRATION_STATUS_NOT_SUPPORTED_FOR_RENEWAL = "RegistrationStatusNotSupportedForRenewal" + EXPIRATION_NOT_IN_RENEWAL_TIME_RANGE = "ExpirationNotInRenewalTimeRange" + SUBSCRIPTION_NOT_ACTIVE = "SubscriptionNotActive" + +class DomainStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Domain registration status. + """ + + ACTIVE = "Active" + AWAITING = "Awaiting" + CANCELLED = "Cancelled" + CONFISCATED = "Confiscated" + DISABLED = "Disabled" + EXCLUDED = "Excluded" + EXPIRED = "Expired" + FAILED = "Failed" + HELD = "Held" + LOCKED = "Locked" + PARKED = "Parked" + PENDING = "Pending" + RESERVED = "Reserved" + REVERTED = "Reverted" + SUSPENDED = "Suspended" + TRANSFERRED = "Transferred" + UNKNOWN = "Unknown" + UNLOCKED = "Unlocked" + UNPARKED = "Unparked" + UPDATED = "Updated" + JSON_CONVERTER_FAILED = "JsonConverterFailed" + +class DomainType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Valid values are Regular domain: Azure will charge the full price of domain registration, + SoftDeleted: Purchasing this domain will simply restore it and this operation will not cost + anything. + """ + + REGULAR = "Regular" + SOFT_DELETED = "SoftDeleted" + +class Enum4(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + WINDOWS = "Windows" + LINUX = "Linux" + WINDOWS_FUNCTIONS = "WindowsFunctions" + LINUX_FUNCTIONS = "LinuxFunctions" + +class Enum5(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + WINDOWS = "Windows" + LINUX = "Linux" + WINDOWS_FUNCTIONS = "WindowsFunctions" + LINUX_FUNCTIONS = "LinuxFunctions" + +class ForwardProxyConvention(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + NO_PROXY = "NoProxy" + STANDARD = "Standard" + CUSTOM = "Custom" + +class FrequencyUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The unit of time for how often the backup should be executed (e.g. for weekly backup, this + should be set to Day and FrequencyInterval should be set to 7) + """ + + DAY = "Day" + HOUR = "Hour" + +class FtpsState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """State of FTP / FTPS service + """ + + ALL_ALLOWED = "AllAllowed" + FTPS_ONLY = "FtpsOnly" + DISABLED = "Disabled" + +class HostingEnvironmentStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current status of the App Service Environment. + """ + + PREPARING = "Preparing" + READY = "Ready" + SCALING = "Scaling" + DELETING = "Deleting" + +class HostNameType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the hostname. + """ + + VERIFIED = "Verified" + MANAGED = "Managed" + +class HostType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Indicates whether the hostname is a standard or repository hostname. + """ + + STANDARD = "Standard" + REPOSITORY = "Repository" + +class InAvailabilityReasonType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """:code:`Invalid` indicates the name provided does not match Azure App Service + naming requirements. :code:`AlreadyExists` indicates that the name is already in + use and is therefore unavailable. + """ + + INVALID = "Invalid" + ALREADY_EXISTS = "AlreadyExists" + +class IpFilterTag(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Defines what this IP filter will be used for. This is to support IP filtering on proxies. + """ + + DEFAULT = "Default" + XFF_PROXY = "XffProxy" + SERVICE_TAG = "ServiceTag" + +class IssueType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Represents the type of the Detector + """ + + SERVICE_INCIDENT = "ServiceIncident" + APP_DEPLOYMENT = "AppDeployment" + APP_CRASH = "AppCrash" + RUNTIME_ISSUE_DETECTED = "RuntimeIssueDetected" + ASE_DEPLOYMENT = "AseDeployment" + USER_ISSUE = "UserIssue" + PLATFORM_ISSUE = "PlatformIssue" + OTHER = "Other" + +class KeyVaultSecretStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the Key Vault secret. + """ + + INITIALIZED = "Initialized" + WAITING_ON_CERTIFICATE_ORDER = "WaitingOnCertificateOrder" + SUCCEEDED = "Succeeded" + CERTIFICATE_ORDER_FAILED = "CertificateOrderFailed" + OPERATION_NOT_PERMITTED_ON_KEY_VAULT = "OperationNotPermittedOnKeyVault" + AZURE_SERVICE_UNAUTHORIZED_TO_ACCESS_KEY_VAULT = "AzureServiceUnauthorizedToAccessKeyVault" + KEY_VAULT_DOES_NOT_EXIST = "KeyVaultDoesNotExist" + KEY_VAULT_SECRET_DOES_NOT_EXIST = "KeyVaultSecretDoesNotExist" + UNKNOWN_ERROR = "UnknownError" + EXTERNAL_PRIVATE_KEY = "ExternalPrivateKey" + UNKNOWN = "Unknown" + +class LoadBalancingMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies which endpoints to serve internally in the Virtual Network for the App Service + Environment. + """ + + NONE = "None" + WEB = "Web" + PUBLISHING = "Publishing" + WEB_PUBLISHING = "Web,Publishing" + +class LogLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Log level. + """ + + OFF = "Off" + VERBOSE = "Verbose" + INFORMATION = "Information" + WARNING = "Warning" + ERROR = "Error" + +class ManagedPipelineMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Managed pipeline mode. + """ + + INTEGRATED = "Integrated" + CLASSIC = "Classic" + +class ManagedServiceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of managed service identity. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" + NONE = "None" + +class MSDeployLogEntryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Log entry type + """ + + MESSAGE = "Message" + WARNING = "Warning" + ERROR = "Error" + +class MSDeployProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Provisioning state + """ + + ACCEPTED = "accepted" + RUNNING = "running" + SUCCEEDED = "succeeded" + FAILED = "failed" + CANCELED = "canceled" + +class MySqlMigrationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of migration operation to be done + """ + + LOCAL_TO_REMOTE = "LocalToRemote" + REMOTE_TO_LOCAL = "RemoteToLocal" + +class NotificationLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Level indicating how critical this recommendation can impact. + """ + + CRITICAL = "Critical" + WARNING = "Warning" + INFORMATION = "Information" + NON_URGENT_SUGGESTION = "NonUrgentSuggestion" + +class OperationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current status of the operation. + """ + + IN_PROGRESS = "InProgress" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + TIMED_OUT = "TimedOut" + CREATED = "Created" + +class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of certificate order. + """ + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + IN_PROGRESS = "InProgress" + DELETING = "Deleting" + +class PublicCertificateLocation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Public Certificate Location + """ + + CURRENT_USER_MY = "CurrentUserMy" + LOCAL_MACHINE_MY = "LocalMachineMy" + UNKNOWN = "Unknown" + +class PublishingProfileFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of the format. Valid values are: + FileZilla3 + WebDeploy -- default + Ftp + """ + + FILE_ZILLA3 = "FileZilla3" + WEB_DEPLOY = "WebDeploy" + FTP = "Ftp" + +class RedundancyMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Site redundancy mode + """ + + NONE = "None" + MANUAL = "Manual" + FAILOVER = "Failover" + ACTIVE_ACTIVE = "ActiveActive" + GEO_REDUNDANT = "GeoRedundant" + +class RenderingType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Rendering Type + """ + + NO_GRAPH = "NoGraph" + TABLE = "Table" + TIME_SERIES = "TimeSeries" + TIME_SERIES_PER_INSTANCE = "TimeSeriesPerInstance" + +class ResourceScopeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of a resource type this recommendation applies, e.g. Subscription, ServerFarm, Site. + """ + + SERVER_FARM = "ServerFarm" + SUBSCRIPTION = "Subscription" + WEB_SITE = "WebSite" + +class RouteType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of route this is: + DEFAULT - By default, every app has routes to the local address ranges specified by RFC1918 + INHERITED - Routes inherited from the real Virtual Network routes + STATIC - Static route set on the app only + + These values will be used for syncing an app's routes with those from a Virtual Network. + """ + + DEFAULT = "DEFAULT" + INHERITED = "INHERITED" + STATIC = "STATIC" + +class ScmType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """SCM type. + """ + + NONE = "None" + DROPBOX = "Dropbox" + TFS = "Tfs" + LOCAL_GIT = "LocalGit" + GIT_HUB = "GitHub" + CODE_PLEX_GIT = "CodePlexGit" + CODE_PLEX_HG = "CodePlexHg" + BITBUCKET_GIT = "BitbucketGit" + BITBUCKET_HG = "BitbucketHg" + EXTERNAL_GIT = "ExternalGit" + EXTERNAL_HG = "ExternalHg" + ONE_DRIVE = "OneDrive" + VSO = "VSO" + VSTSRM = "VSTSRM" + +class SiteAvailabilityState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Management information availability state for the app. + """ + + NORMAL = "Normal" + LIMITED = "Limited" + DISASTER_RECOVERY_MODE = "DisasterRecoveryMode" + +class SiteExtensionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Site extension type. + """ + + GALLERY = "Gallery" + WEB_ROOT = "WebRoot" + +class SiteLoadBalancing(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Site load balancing. + """ + + WEIGHTED_ROUND_ROBIN = "WeightedRoundRobin" + LEAST_REQUESTS = "LeastRequests" + LEAST_RESPONSE_TIME = "LeastResponseTime" + WEIGHTED_TOTAL_TRAFFIC = "WeightedTotalTraffic" + REQUEST_HASH = "RequestHash" + +class SiteRuntimeState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + READY = "READY" + STOPPED = "STOPPED" + UNKNOWN = "UNKNOWN" + +class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + FREE = "Free" + SHARED = "Shared" + BASIC = "Basic" + STANDARD = "Standard" + PREMIUM = "Premium" + DYNAMIC = "Dynamic" + ISOLATED = "Isolated" + PREMIUM_V2 = "PremiumV2" + ELASTIC_PREMIUM = "ElasticPremium" + ELASTIC_ISOLATED = "ElasticIsolated" + +class SolutionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of Solution + """ + + QUICK_SOLUTION = "QuickSolution" + DEEP_INVESTIGATION = "DeepInvestigation" + BEST_PRACTICES = "BestPractices" + +class SslState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """SSL type. + """ + + DISABLED = "Disabled" + SNI_ENABLED = "SniEnabled" + IP_BASED_ENABLED = "IpBasedEnabled" + +class StatusOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """App Service plan status. + """ + + READY = "Ready" + PENDING = "Pending" + CREATING = "Creating" + +class SupportedTlsVersions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """MinTlsVersion: configures the minimum version of TLS required for SSL requests + """ + + ONE0 = "1.0" + ONE1 = "1.1" + ONE2 = "1.2" + +class TriggeredWebJobStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Job status. + """ + + SUCCESS = "Success" + FAILED = "Failed" + ERROR = "Error" + +class TriggerTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The trigger type of the function + """ + + HTTP_TRIGGER = "HttpTrigger" + UNKNOWN = "Unknown" + +class UnauthenticatedClientAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The action to take when an unauthenticated client attempts to access the app. + """ + + REDIRECT_TO_LOGIN_PAGE = "RedirectToLoginPage" + ALLOW_ANONYMOUS = "AllowAnonymous" + +class UnauthenticatedClientActionV2(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REDIRECT_TO_LOGIN_PAGE = "RedirectToLoginPage" + ALLOW_ANONYMOUS = "AllowAnonymous" + RETURN401 = "Return401" + RETURN403 = "Return403" + +class UsageState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """State indicating whether the app has exceeded its quota usage. Read-only. + """ + + NORMAL = "Normal" + EXCEEDED = "Exceeded" + +class ValidateResourceTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Resource type used for verification. + """ + + SERVER_FARM = "ServerFarm" + SITE = "Site" + +class WebJobType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Job type. + """ + + CONTINUOUS = "Continuous" + TRIGGERED = "Triggered" + +class WorkerSizeOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of the machines. + """ + + SMALL = "Small" + MEDIUM = "Medium" + LARGE = "Large" + D1 = "D1" + D2 = "D2" + D3 = "D3" + NESTED_SMALL = "NestedSmall" + DEFAULT = "Default" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/__init__.py new file mode 100644 index 000000000000..8f414125deed --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/__init__.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._app_service_certificate_orders_operations import AppServiceCertificateOrdersOperations +from ._certificate_registration_provider_operations import CertificateRegistrationProviderOperations +from ._domains_operations import DomainsOperations +from ._top_level_domains_operations import TopLevelDomainsOperations +from ._domain_registration_provider_operations import DomainRegistrationProviderOperations +from ._certificates_operations import CertificatesOperations +from ._deleted_web_apps_operations import DeletedWebAppsOperations +from ._diagnostics_operations import DiagnosticsOperations +from ._provider_operations import ProviderOperations +from ._recommendations_operations import RecommendationsOperations +from ._web_site_management_client_operations import WebSiteManagementClientOperationsMixin +from ._web_apps_operations import WebAppsOperations +from ._static_sites_operations import StaticSitesOperations +from ._app_service_environments_operations import AppServiceEnvironmentsOperations +from ._app_service_plans_operations import AppServicePlansOperations +from ._resource_health_metadata_operations import ResourceHealthMetadataOperations + +__all__ = [ + 'AppServiceCertificateOrdersOperations', + 'CertificateRegistrationProviderOperations', + 'DomainsOperations', + 'TopLevelDomainsOperations', + 'DomainRegistrationProviderOperations', + 'CertificatesOperations', + 'DeletedWebAppsOperations', + 'DiagnosticsOperations', + 'ProviderOperations', + 'RecommendationsOperations', + 'WebSiteManagementClientOperationsMixin', + 'WebAppsOperations', + 'StaticSitesOperations', + 'AppServiceEnvironmentsOperations', + 'AppServicePlansOperations', + 'ResourceHealthMetadataOperations', +] diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_app_service_certificate_orders_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_app_service_certificate_orders_operations.py new file mode 100644 index 000000000000..78f6d06ad982 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_app_service_certificate_orders_operations.py @@ -0,0 +1,1517 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AppServiceCertificateOrdersOperations(object): + """AppServiceCertificateOrdersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServiceCertificateOrderCollection"] + """List all certificate orders in a subscription. + + Description for List all certificate orders in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceCertificateOrderCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrderCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrderCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateOrderCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/certificateOrders'} # type: ignore + + def validate_purchase_information( + self, + app_service_certificate_order, # type: "_models.AppServiceCertificateOrder" + **kwargs # type: Any + ): + # type: (...) -> None + """Validate information for a certificate order. + + Description for Validate information for a certificate order. + + :param app_service_certificate_order: Information for a certificate order. + :type app_service_certificate_order: ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrder + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_purchase_information.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_service_certificate_order, 'AppServiceCertificateOrder') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + validate_purchase_information.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/validateCertificateRegistrationInformation'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServiceCertificateOrderCollection"] + """Get certificate orders in a resource group. + + Description for Get certificate orders in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 AppServiceCertificateOrderCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrderCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrderCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateOrderCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.CertificateRegistration/certificateOrders'} # type: ignore + + def get( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceCertificateOrder" + """Get a certificate order. + + Description for Get a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order.. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateOrder, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrder + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + certificate_distinguished_name, # type: "_models.AppServiceCertificateOrder" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceCertificateOrder" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_distinguished_name, 'AppServiceCertificateOrder') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + certificate_distinguished_name, # type: "_models.AppServiceCertificateOrder" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AppServiceCertificateOrder"] + """Create or update a certificate purchase order. + + Description for Create or update a certificate purchase order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param certificate_distinguished_name: Distinguished name to use for the certificate order. + :type certificate_distinguished_name: ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrder + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 AppServiceCertificateOrder or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrder] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + certificate_order_name=certificate_order_name, + certificate_distinguished_name=certificate_distinguished_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete an existing certificate order. + + Description for Delete an existing certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + certificate_distinguished_name, # type: "_models.AppServiceCertificateOrderPatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceCertificateOrder" + """Create or update a certificate purchase order. + + Description for Create or update a certificate purchase order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param certificate_distinguished_name: Distinguished name to use for the certificate order. + :type certificate_distinguished_name: ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrderPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateOrder, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateOrder + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_distinguished_name, 'AppServiceCertificateOrderPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + def list_certificates( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServiceCertificateCollection"] + """List all certificates associated with a certificate order. + + Description for List all certificates associated with a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceCertificateCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_certificates.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates'} # type: ignore + + def get_certificate( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceCertificateResource" + """Get the certificate associated with a certificate order. + + Description for Get the certificate associated with a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + def _create_or_update_certificate_initial( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + name, # type: str + key_vault_certificate, # type: "_models.AppServiceCertificateResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceCertificateResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_certificate_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key_vault_certificate, 'AppServiceCertificateResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_certificate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + def begin_create_or_update_certificate( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + name, # type: str + key_vault_certificate, # type: "_models.AppServiceCertificateResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AppServiceCertificateResource"] + """Creates or updates a certificate and associates with key vault secret. + + Description for Creates or updates a certificate and associates with key vault secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :param key_vault_certificate: Key vault certificate resource Id. + :type key_vault_certificate: ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 AppServiceCertificateResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_certificate_initial( + resource_group_name=resource_group_name, + certificate_order_name=certificate_order_name, + name=name, + key_vault_certificate=key_vault_certificate, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + def delete_certificate( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete the certificate associated with a certificate order. + + Description for Delete the certificate associated with a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + def update_certificate( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + name, # type: str + key_vault_certificate, # type: "_models.AppServiceCertificatePatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceCertificateResource" + """Creates or updates a certificate and associates with key vault secret. + + Description for Creates or updates a certificate and associates with key vault secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :param key_vault_certificate: Key vault certificate resource Id. + :type key_vault_certificate: ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificatePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AppServiceCertificateResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key_vault_certificate, 'AppServiceCertificatePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + def reissue( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + reissue_certificate_order_request, # type: "_models.ReissueCertificateOrderRequest" + **kwargs # type: Any + ): + # type: (...) -> None + """Reissue an existing certificate order. + + Description for Reissue an existing certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param reissue_certificate_order_request: Parameters for the reissue. + :type reissue_certificate_order_request: ~azure.mgmt.web.v2020_06_01.models.ReissueCertificateOrderRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.reissue.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(reissue_certificate_order_request, 'ReissueCertificateOrderRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reissue.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/reissue'} # type: ignore + + def renew( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + renew_certificate_order_request, # type: "_models.RenewCertificateOrderRequest" + **kwargs # type: Any + ): + # type: (...) -> None + """Renew an existing certificate order. + + Description for Renew an existing certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param renew_certificate_order_request: Renew parameters. + :type renew_certificate_order_request: ~azure.mgmt.web.v2020_06_01.models.RenewCertificateOrderRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.renew.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(renew_certificate_order_request, 'RenewCertificateOrderRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + renew.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/renew'} # type: ignore + + def resend_email( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Resend certificate email. + + Description for Resend certificate email. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.resend_email.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + resend_email.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendEmail'} # type: ignore + + def resend_request_emails( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + name_identifier, # type: "_models.NameIdentifier" + **kwargs # type: Any + ): + # type: (...) -> None + """Verify domain ownership for this certificate order. + + Description for Verify domain ownership for this certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name_identifier: Email address. + :type name_identifier: ~azure.mgmt.web.v2020_06_01.models.NameIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.resend_request_emails.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(name_identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + resend_request_emails.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendRequestEmails'} # type: ignore + + def retrieve_site_seal( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + site_seal_request, # type: "_models.SiteSealRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteSeal" + """Verify domain ownership for this certificate order. + + Description for Verify domain ownership for this certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param site_seal_request: Site seal request. + :type site_seal_request: ~azure.mgmt.web.v2020_06_01.models.SiteSealRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSeal, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteSeal + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSeal"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.retrieve_site_seal.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_seal_request, 'SiteSealRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteSeal', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_site_seal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/retrieveSiteSeal'} # type: ignore + + def verify_domain_ownership( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Verify domain ownership for this certificate order. + + Description for Verify domain ownership for this certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.verify_domain_ownership.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + verify_domain_ownership.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/verifyDomainOwnership'} # type: ignore + + def retrieve_certificate_actions( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.CertificateOrderAction"] + """Retrieve the list of certificate actions. + + Description for Retrieve the list of certificate actions. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate order. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of CertificateOrderAction, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.CertificateOrderAction] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.CertificateOrderAction"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.retrieve_certificate_actions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[CertificateOrderAction]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_certificate_actions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveCertificateActions'} # type: ignore + + def retrieve_certificate_email_history( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.CertificateEmail"] + """Retrieve email history. + + Description for Retrieve email history. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate order. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of CertificateEmail, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.CertificateEmail] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.CertificateEmail"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.retrieve_certificate_email_history.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[CertificateEmail]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_certificate_email_history.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveEmailHistory'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_app_service_environments_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_app_service_environments_operations.py new file mode 100644 index 000000000000..b0774386d12a --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_app_service_environments_operations.py @@ -0,0 +1,3293 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AppServiceEnvironmentsOperations(object): + """AppServiceEnvironmentsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServiceEnvironmentCollection"] + """Get all App Service Environments for a subscription. + + Description for Get all App Service Environments for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceEnvironmentCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.AppServiceEnvironmentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceEnvironmentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/hostingEnvironments'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServiceEnvironmentCollection"] + """Get all App Service Environments in a resource group. + + Description for Get all App Service Environments in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 AppServiceEnvironmentCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.AppServiceEnvironmentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceEnvironmentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.Web/hostingEnvironments'} # type: ignore + + def get( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceEnvironmentResource" + """Get the properties of an App Service Environment. + + Description for Get the properties of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceEnvironmentResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AppServiceEnvironmentResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + name, # type: str + hosting_environment_envelope, # type: "_models.AppServiceEnvironmentResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceEnvironmentResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(hosting_environment_envelope, 'AppServiceEnvironmentResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + name, # type: str + hosting_environment_envelope, # type: "_models.AppServiceEnvironmentResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AppServiceEnvironmentResource"] + """Create or update an App Service Environment. + + Description for Create or update an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param hosting_environment_envelope: Configuration details of the App Service Environment. + :type hosting_environment_envelope: ~azure.mgmt.web.v2020_06_01.models.AppServiceEnvironmentResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 AppServiceEnvironmentResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.AppServiceEnvironmentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + hosting_environment_envelope=hosting_environment_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + name, # type: str + force_delete=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if force_delete is not None: + query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **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(_models.DefaultErrorResponse, 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.Web/hostingEnvironments/{name}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + name, # type: str + force_delete=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Delete an App Service Environment. + + Description for Delete an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param force_delete: Specify :code:`true` to force the deletion even if the App + Service Environment contains resources. The default is :code:`false`. + :type force_delete: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + name=name, + force_delete=force_delete, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + name, # type: str + hosting_environment_envelope, # type: "_models.AppServiceEnvironmentPatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceEnvironmentResource" + """Create or update an App Service Environment. + + Description for Create or update an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param hosting_environment_envelope: Configuration details of the App Service Environment. + :type hosting_environment_envelope: ~azure.mgmt.web.v2020_06_01.models.AppServiceEnvironmentPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceEnvironmentResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AppServiceEnvironmentResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(hosting_environment_envelope, 'AppServiceEnvironmentPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + def list_capacities( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StampCapacityCollection"] + """Get the used, available, and total worker capacity an App Service Environment. + + Description for Get the used, available, and total worker capacity an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StampCapacityCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.StampCapacityCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StampCapacityCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_capacities.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StampCapacityCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_capacities.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/compute'} # type: ignore + + def get_vip_info( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AddressResponse" + """Get IP addresses assigned to an App Service Environment. + + Description for Get IP addresses assigned to an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AddressResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AddressResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_vip_info.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AddressResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vip_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/virtualip'} # type: ignore + + def _change_vnet_initial( + self, + resource_group_name, # type: str + name, # type: str + vnet_info, # type: "_models.VirtualNetworkProfile" + **kwargs # type: Any + ): + # type: (...) -> "_models.WebAppCollection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._change_vnet_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vnet_info, 'VirtualNetworkProfile') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _change_vnet_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork'} # type: ignore + + def begin_change_vnet( + self, + resource_group_name, # type: str + name, # type: str + vnet_info, # type: "_models.VirtualNetworkProfile" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[ItemPaged["_models.WebAppCollection"]] + """Move an App Service Environment to a different VNET. + + Description for Move an App Service Environment to a different VNET. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param vnet_info: Details for the new virtual network. + :type vnet_info: ~azure.mgmt.web.v2020_06_01.models.VirtualNetworkProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 an iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.WebAppCollection]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.change_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vnet_info, 'VirtualNetworkProfile') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vnet_info, 'VirtualNetworkProfile') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._change_vnet_initial( + resource_group_name=resource_group_name, + name=name, + vnet_info=vnet_info, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return get_next(next_link) + + return ItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_change_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork'} # type: ignore + + def list_diagnostics( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.HostingEnvironmentDiagnostics"] + """Get diagnostic information for an App Service Environment. + + Description for Get diagnostic information for an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of HostingEnvironmentDiagnostics, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentDiagnostics] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.HostingEnvironmentDiagnostics"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_diagnostics.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[HostingEnvironmentDiagnostics]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_diagnostics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics'} # type: ignore + + def get_diagnostics_item( + self, + resource_group_name, # type: str + name, # type: str + diagnostics_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HostingEnvironmentDiagnostics" + """Get a diagnostics item for an App Service Environment. + + Description for Get a diagnostics item for an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param diagnostics_name: Name of the diagnostics item. + :type diagnostics_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostingEnvironmentDiagnostics, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HostingEnvironmentDiagnostics + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostingEnvironmentDiagnostics"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostics_item.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'diagnosticsName': self._serialize.url("diagnostics_name", diagnostics_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostingEnvironmentDiagnostics', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostics_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics/{diagnosticsName}'} # type: ignore + + def get_inbound_network_dependencies_endpoints( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.InboundEnvironmentEndpointCollection"] + """Get the network endpoints of all inbound dependencies of an App Service Environment. + + Description for Get the network endpoints of all inbound dependencies of an App Service + Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either InboundEnvironmentEndpointCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.InboundEnvironmentEndpointCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundEnvironmentEndpointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_inbound_network_dependencies_endpoints.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('InboundEnvironmentEndpointCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_inbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/inboundNetworkDependenciesEndpoints'} # type: ignore + + def list_multi_role_pools( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WorkerPoolCollection"] + """Get all multi-role pools. + + Description for Get all multi-role pools. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkerPoolCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.WorkerPoolCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_pools.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkerPoolCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_multi_role_pools.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools'} # type: ignore + + def get_multi_role_pool( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WorkerPoolResource" + """Get properties of a multi-role pool. + + Description for Get properties of a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_multi_role_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_multi_role_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + def _create_or_update_multi_role_pool_initial( + self, + resource_group_name, # type: str + name, # type: str + multi_role_pool_envelope, # type: "_models.WorkerPoolResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.WorkerPoolResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_multi_role_pool_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(multi_role_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_multi_role_pool_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + def begin_create_or_update_multi_role_pool( + self, + resource_group_name, # type: str + name, # type: str + multi_role_pool_envelope, # type: "_models.WorkerPoolResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.WorkerPoolResource"] + """Create or update a multi-role pool. + + Description for Create or update a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param multi_role_pool_envelope: Properties of the multi-role pool. + :type multi_role_pool_envelope: ~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 WorkerPoolResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_multi_role_pool_initial( + resource_group_name=resource_group_name, + name=name, + multi_role_pool_envelope=multi_role_pool_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_multi_role_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + def update_multi_role_pool( + self, + resource_group_name, # type: str + name, # type: str + multi_role_pool_envelope, # type: "_models.WorkerPoolResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.WorkerPoolResource" + """Create or update a multi-role pool. + + Description for Create or update a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param multi_role_pool_envelope: Properties of the multi-role pool. + :type multi_role_pool_envelope: ~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_multi_role_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(multi_role_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_multi_role_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + def list_multi_role_pool_instance_metric_definitions( + self, + resource_group_name, # type: str + name, # type: str + instance, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceMetricDefinitionCollection"] + """Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. + + Description for Get metric definitions for a specific instance of a multi-role pool of an App + Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param instance: Name of the instance in the multi-role pool. + :type instance: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_pool_instance_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instance': self._serialize.url("instance", instance, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_multi_role_pool_instance_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions'} # type: ignore + + def list_multi_role_metric_definitions( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceMetricDefinitionCollection"] + """Get metric definitions for a multi-role pool of an App Service Environment. + + Description for Get metric definitions for a multi-role pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_multi_role_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions'} # type: ignore + + def list_multi_role_pool_skus( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SkuInfoCollection"] + """Get available SKUs for scaling a multi-role pool. + + Description for Get available SKUs for scaling a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.SkuInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_pool_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SkuInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_multi_role_pool_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/skus'} # type: ignore + + def list_multi_role_usages( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.UsageCollection"] + """Get usage metrics for a multi-role pool of an App Service Environment. + + Description for Get usage metrics for a multi-role pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsageCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.UsageCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('UsageCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_multi_role_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/usages'} # type: ignore + + def list_operations( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.Operation"] + """List all currently running operations on the App Service Environment. + + Description for List all currently running operations on the App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Operation, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.Operation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Operation"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[Operation]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_operations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations'} # type: ignore + + def get_outbound_network_dependencies_endpoints( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.OutboundEnvironmentEndpointCollection"] + """Get the network endpoints of all outbound dependencies of an App Service Environment. + + Description for Get the network endpoints of all outbound dependencies of an App Service + Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.OutboundEnvironmentEndpointCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_outbound_network_dependencies_endpoints.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OutboundEnvironmentEndpointCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/outboundNetworkDependenciesEndpoints'} # type: ignore + + def reboot( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Reboot all machines in an App Service Environment. + + Description for Reboot all machines in an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.reboot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reboot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/reboot'} # type: ignore + + def _resume_initial( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WebAppCollection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._resume_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _resume_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume'} # type: ignore + + def begin_resume( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[ItemPaged["_models.WebAppCollection"]] + """Resume an App Service Environment. + + Description for Resume an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type 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: True for ARMPolling, False for no polling, or a + polling object for 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 an iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.WebAppCollection]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.resume.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._resume_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return get_next(next_link) + + return ItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume'} # type: ignore + + def list_app_service_plans( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServicePlanCollection"] + """Get all App Service plans in an App Service Environment. + + Description for Get all App Service plans in an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServicePlanCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.AppServicePlanCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlanCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_app_service_plans.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServicePlanCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_app_service_plans.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/serverfarms'} # type: ignore + + def list_web_apps( + self, + resource_group_name, # type: str + name, # type: str + properties_to_include=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppCollection"] + """Get all apps in an App Service Environment. + + Description for Get all apps in an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param properties_to_include: Comma separated list of app properties to include. + :type properties_to_include: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_apps.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if properties_to_include is not None: + query_parameters['propertiesToInclude'] = self._serialize.query("properties_to_include", properties_to_include, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_web_apps.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/sites'} # type: ignore + + def _suspend_initial( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WebAppCollection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._suspend_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _suspend_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend'} # type: ignore + + def begin_suspend( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[ItemPaged["_models.WebAppCollection"]] + """Suspend an App Service Environment. + + Description for Suspend an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type 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: True for ARMPolling, False for no polling, or a + polling object for 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 an iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.WebAppCollection]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.suspend.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._suspend_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return get_next(next_link) + + return ItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_suspend.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend'} # type: ignore + + def list_usages( + self, + resource_group_name, # type: str + name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CsmUsageQuotaCollection"] + """Get global usage metrics of an App Service Environment. + + Description for Get global usage metrics of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq + 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages'} # type: ignore + + def list_worker_pools( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WorkerPoolCollection"] + """Get all worker pools of an App Service Environment. + + Description for Get all worker pools of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkerPoolCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.WorkerPoolCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_worker_pools.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkerPoolCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_worker_pools.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools'} # type: ignore + + def get_worker_pool( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WorkerPoolResource" + """Get properties of a worker pool. + + Description for Get properties of a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_worker_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_worker_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + def _create_or_update_worker_pool_initial( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + worker_pool_envelope, # type: "_models.WorkerPoolResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.WorkerPoolResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_worker_pool_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(worker_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_worker_pool_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + def begin_create_or_update_worker_pool( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + worker_pool_envelope, # type: "_models.WorkerPoolResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.WorkerPoolResource"] + """Create or update a worker pool. + + Description for Create or update a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :param worker_pool_envelope: Properties of the worker pool. + :type worker_pool_envelope: ~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 WorkerPoolResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_worker_pool_initial( + resource_group_name=resource_group_name, + name=name, + worker_pool_name=worker_pool_name, + worker_pool_envelope=worker_pool_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_worker_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + def update_worker_pool( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + worker_pool_envelope, # type: "_models.WorkerPoolResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.WorkerPoolResource" + """Create or update a worker pool. + + Description for Create or update a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :param worker_pool_envelope: Properties of the worker pool. + :type worker_pool_envelope: ~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_worker_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(worker_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_worker_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + def list_worker_pool_instance_metric_definitions( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + instance, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceMetricDefinitionCollection"] + """Get metric definitions for a specific instance of a worker pool of an App Service Environment. + + Description for Get metric definitions for a specific instance of a worker pool of an App + Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :param instance: Name of the instance in the worker pool. + :type instance: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_worker_pool_instance_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'instance': self._serialize.url("instance", instance, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_worker_pool_instance_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metricdefinitions'} # type: ignore + + def list_web_worker_metric_definitions( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceMetricDefinitionCollection"] + """Get metric definitions for a worker pool of an App Service Environment. + + Description for Get metric definitions for a worker pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_worker_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_web_worker_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metricdefinitions'} # type: ignore + + def list_worker_pool_skus( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SkuInfoCollection"] + """Get available SKUs for scaling a worker pool. + + Description for Get available SKUs for scaling a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.SkuInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_worker_pool_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SkuInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_worker_pool_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/skus'} # type: ignore + + def list_web_worker_usages( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.UsageCollection"] + """Get usage metrics for a worker pool of an App Service Environment. + + Description for Get usage metrics for a worker pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsageCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.UsageCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_worker_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('UsageCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_web_worker_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/usages'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_app_service_plans_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_app_service_plans_operations.py new file mode 100644 index 000000000000..58ecb5153169 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_app_service_plans_operations.py @@ -0,0 +1,2039 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AppServicePlansOperations(object): + """AppServicePlansOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + detailed=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServicePlanCollection"] + """Get all App Service plans for a subscription. + + Description for Get all App Service plans for a subscription. + + :param detailed: Specify :code:`true` to return all App Service plan properties. + The default is :code:`false`, which returns a subset of the properties. + Retrieval of all properties may increase the API latency. + :type detailed: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServicePlanCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.AppServicePlanCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlanCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if detailed is not None: + query_parameters['detailed'] = self._serialize.query("detailed", detailed, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServicePlanCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/serverfarms'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServicePlanCollection"] + """Get all App Service plans in a resource group. + + Description for Get all App Service plans in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 AppServicePlanCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.AppServicePlanCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlanCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServicePlanCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.Web/serverfarms'} # type: ignore + + def get( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.AppServicePlan"] + """Get an App Service plan. + + Description for Get an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServicePlan, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AppServicePlan or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AppServicePlan"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + name, # type: str + app_service_plan, # type: "_models.AppServicePlan" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServicePlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlan"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_service_plan, 'AppServicePlan') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + name, # type: str + app_service_plan, # type: "_models.AppServicePlan" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AppServicePlan"] + """Creates or updates an App Service Plan. + + Description for Creates or updates an App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param app_service_plan: Details of the App Service plan. + :type app_service_plan: ~azure.mgmt.web.v2020_06_01.models.AppServicePlan + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 AppServicePlan or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.AppServicePlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlan"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + app_service_plan=app_service_plan, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete an App Service plan. + + Description for Delete an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + name, # type: str + app_service_plan, # type: "_models.AppServicePlanPatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServicePlan" + """Creates or updates an App Service Plan. + + Description for Creates or updates an App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param app_service_plan: Details of the App Service plan. + :type app_service_plan: ~azure.mgmt.web.v2020_06_01.models.AppServicePlanPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServicePlan, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AppServicePlan + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlan"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_service_plan, 'AppServicePlanPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + def list_capabilities( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.Capability"] + """List all capabilities of an App Service plan. + + Description for List all capabilities of an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Capability, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.Capability] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Capability"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_capabilities.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[Capability]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_capabilities.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/capabilities'} # type: ignore + + def get_hybrid_connection( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Retrieve a Hybrid Connection in use in an App Service plan. + + Description for Retrieve a Hybrid Connection in use in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: Name of the Service Bus namespace. + :type namespace_name: str + :param relay_name: Name of the Service Bus relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def delete_hybrid_connection( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a Hybrid Connection in use in an App Service plan. + + Description for Delete a Hybrid Connection in use in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: Name of the Service Bus namespace. + :type namespace_name: str + :param relay_name: Name of the Service Bus relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def list_hybrid_connection_keys( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnectionKey" + """Get the send key name and value of a Hybrid Connection. + + Description for Get the send key name and value of a Hybrid Connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: The name of the Service Bus namespace. + :type namespace_name: str + :param relay_name: The name of the Service Bus relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnectionKey, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnectionKey + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnectionKey"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_hybrid_connection_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnectionKey', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_hybrid_connection_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'} # type: ignore + + def list_web_apps_by_hybrid_connection( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceCollection"] + """Get all apps that use a Hybrid Connection in an App Service Plan. + + Description for Get all apps that use a Hybrid Connection in an App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: Name of the Hybrid Connection namespace. + :type namespace_name: str + :param relay_name: Name of the Hybrid Connection relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_apps_by_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_web_apps_by_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/sites'} # type: ignore + + def get_hybrid_connection_plan_limit( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnectionLimits" + """Get the maximum number of Hybrid Connections allowed in an App Service plan. + + Description for Get the maximum number of Hybrid Connections allowed in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnectionLimits, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnectionLimits + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnectionLimits"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection_plan_limit.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnectionLimits', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection_plan_limit.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionPlanLimits/limit'} # type: ignore + + def list_hybrid_connections( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.HybridConnectionCollection"] + """Retrieve all Hybrid Connections in use in an App Service plan. + + Description for Retrieve all Hybrid Connections in use in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HybridConnectionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.HybridConnectionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnectionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_hybrid_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('HybridConnectionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_hybrid_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionRelays'} # type: ignore + + def restart_web_apps( + self, + resource_group_name, # type: str + name, # type: str + soft_restart=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + """Restart all apps in an App Service plan. + + Description for Restart all apps in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param soft_restart: Specify :code:`true` to perform a soft restart, applies the + configuration settings and restarts the apps if necessary. The default is + :code:`false`, which always restarts and reprovisions the apps. + :type soft_restart: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.restart_web_apps.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if soft_restart is not None: + query_parameters['softRestart'] = self._serialize.query("soft_restart", soft_restart, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restart_web_apps.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/restartSites'} # type: ignore + + def list_web_apps( + self, + resource_group_name, # type: str + name, # type: str + skip_token=None, # type: Optional[str] + filter=None, # type: Optional[str] + top=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppCollection"] + """Get all apps associated with an App Service plan. + + Description for Get all apps associated with an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param skip_token: Skip to a web app in the list of webapps associated with app service plan. + If specified, the resulting list will contain web apps starting from (including) the skipToken. + Otherwise, the resulting list contains web apps from the start of the list. + :type skip_token: str + :param filter: Supported filter: $filter=state eq running. Returns only web apps that are + currently running. + :type filter: str + :param top: List page size. If specified, results are paged. + :type top: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_apps.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_web_apps.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites'} # type: ignore + + def get_server_farm_skus( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> object + """Gets all selectable SKUs for a given App Service Plan. + + Description for Gets all selectable SKUs for a given App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of App Service Plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: object, or the result of cls(response) + :rtype: object + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[object] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_server_farm_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_server_farm_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/skus'} # type: ignore + + def list_usages( + self, + resource_group_name, # type: str + name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CsmUsageQuotaCollection"] + """Gets server farm usage information. + + Description for Gets server farm usage information. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of App Service Plan. + :type name: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/usages'} # type: ignore + + def list_vnets( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.VnetInfo"] + """Get all Virtual Networks associated with an App Service plan. + + Description for Get all Virtual Networks associated with an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetInfo, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.VnetInfo] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_vnets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetInfo]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_vnets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections'} # type: ignore + + def get_vnet_from_server_farm( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VnetInfo"] + """Get a Virtual Network associated with an App Service plan. + + Description for Get a Virtual Network associated with an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VnetInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_from_server_farm.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_from_server_farm.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def get_vnet_gateway( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetGateway" + """Get a Virtual Network gateway. + + Description for Get a Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Only the 'primary' gateway is supported. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def update_vnet_gateway( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + connection_envelope, # type: "_models.VnetGateway" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetGateway" + """Update a Virtual Network gateway. + + Description for Update a Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Only the 'primary' gateway is supported. + :type gateway_name: str + :param connection_envelope: Definition of the gateway. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def list_routes_for_vnet( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.VnetRoute"] + """Get all routes that are associated with a Virtual Network in an App Service plan. + + Description for Get all routes that are associated with a Virtual Network in an App Service + plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetRoute, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.VnetRoute] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetRoute"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_routes_for_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetRoute]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_routes_for_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes'} # type: ignore + + def get_route_for_vnet( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + route_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[List["_models.VnetRoute"]] + """Get a Virtual Network route in an App Service plan. + + Description for Get a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetRoute, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.VnetRoute] or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[List["_models.VnetRoute"]]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_route_for_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[VnetRoute]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_route_for_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + def create_or_update_vnet_route( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + route_name, # type: str + route, # type: "_models.VnetRoute" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VnetRoute"] + """Create or update a Virtual Network route in an App Service plan. + + Description for Create or update a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :param route: Definition of the Virtual Network route. + :type route: ~azure.mgmt.web.v2020_06_01.models.VnetRoute + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetRoute, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetRoute or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VnetRoute"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_route.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route, 'VnetRoute') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 400, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VnetRoute', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + def delete_vnet_route( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + route_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a Virtual Network route in an App Service plan. + + Description for Delete a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_vnet_route.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_vnet_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + def update_vnet_route( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + route_name, # type: str + route, # type: "_models.VnetRoute" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VnetRoute"] + """Create or update a Virtual Network route in an App Service plan. + + Description for Create or update a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :param route: Definition of the Virtual Network route. + :type route: ~azure.mgmt.web.v2020_06_01.models.VnetRoute + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetRoute, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetRoute or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VnetRoute"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_route.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route, 'VnetRoute') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 400, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VnetRoute', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + def reboot_worker( + self, + resource_group_name, # type: str + name, # type: str + worker_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Reboot a worker machine in an App Service plan. + + Description for Reboot a worker machine in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param worker_name: Name of worker machine, which typically starts with RD. + :type worker_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.reboot_worker.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerName': self._serialize.url("worker_name", worker_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reboot_worker.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/workers/{workerName}/reboot'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_certificate_registration_provider_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_certificate_registration_provider_operations.py new file mode 100644 index 000000000000..fd50f5bb7a39 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_certificate_registration_provider_operations.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class CertificateRegistrationProviderOperations(object): + """CertificateRegistrationProviderOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_operations( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CsmOperationCollection"] + """Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. + + Description for Implements Csm operations Api to exposes the list of available Csm Apis under + the resource provider. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmOperationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.CsmOperationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmOperationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CsmOperationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_operations.metadata = {'url': '/providers/Microsoft.CertificateRegistration/operations'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_certificates_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_certificates_operations.py new file mode 100644 index 000000000000..366917731345 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_certificates_operations.py @@ -0,0 +1,451 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class CertificatesOperations(object): + """CertificatesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CertificateCollection"] + """Get all certificates for a subscription. + + Description for Get all certificates for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CertificateCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.CertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/certificates'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CertificateCollection"] + """Get all certificates in a resource group. + + Description for Get all certificates in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 CertificateCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.CertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.Web/certificates'} # type: ignore + + def get( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Certificate" + """Get a certificate. + + Description for Get a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + name, # type: str + certificate_envelope, # type: "_models.Certificate" + **kwargs # type: Any + ): + # type: (...) -> "_models.Certificate" + """Create or update a certificate. + + Description for Create or update a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :param certificate_envelope: Details of certificate, if it exists already. + :type certificate_envelope: ~azure.mgmt.web.v2020_06_01.models.Certificate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_envelope, 'Certificate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a certificate. + + Description for Delete a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + name, # type: str + certificate_envelope, # type: "_models.CertificatePatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.Certificate" + """Create or update a certificate. + + Description for Create or update a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :param certificate_envelope: Details of certificate, if it exists already. + :type certificate_envelope: ~azure.mgmt.web.v2020_06_01.models.CertificatePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_envelope, 'CertificatePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_deleted_web_apps_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_deleted_web_apps_operations.py new file mode 100644 index 000000000000..d5b6fb4b5625 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_deleted_web_apps_operations.py @@ -0,0 +1,252 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DeletedWebAppsOperations(object): + """DeletedWebAppsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DeletedWebAppCollection"] + """Get all deleted apps for a subscription. + + Description for Get all deleted apps for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeletedWebAppCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.DeletedWebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedWebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DeletedWebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites'} # type: ignore + + def list_by_location( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DeletedWebAppCollection"] + """Get all deleted apps for a subscription at location. + + Description for Get all deleted apps for a subscription at location. + + :param location: + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeletedWebAppCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.DeletedWebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedWebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_location.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DeletedWebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/deletedSites'} # type: ignore + + def get_deleted_web_app_by_location( + self, + location, # type: str + deleted_site_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DeletedSite" + """Get deleted app for a subscription at location. + + Description for Get deleted app for a subscription at location. + + :param location: + :type location: str + :param deleted_site_id: The numeric ID of the deleted app, e.g. 12345. + :type deleted_site_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeletedSite, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DeletedSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedSite"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_deleted_web_app_by_location.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'deletedSiteId': self._serialize.url("deleted_site_id", deleted_site_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeletedSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deleted_web_app_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/deletedSites/{deletedSiteId}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_diagnostics_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_diagnostics_operations.py new file mode 100644 index 000000000000..2f99e8b6520d --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_diagnostics_operations.py @@ -0,0 +1,1800 @@ +# 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. +# -------------------------------------------------------------------------- +import datetime +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DiagnosticsOperations(object): + """DiagnosticsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_hosting_environment_detector_responses( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DetectorResponseCollection"] + """List Hosting Environment Detector Responses. + + Description for List Hosting Environment Detector Responses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site Name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DetectorResponseCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.DetectorResponseCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponseCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_hosting_environment_detector_responses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DetectorResponseCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_hosting_environment_detector_responses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors'} # type: ignore + + def get_hosting_environment_detector_response( + self, + resource_group_name, # type: str + name, # type: str + detector_name, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DetectorResponse" + """Get Hosting Environment Detector Response. + + Description for Get Hosting Environment Detector Response. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: App Service Environment Name. + :type name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_hosting_environment_detector_response.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hosting_environment_detector_response.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors/{detectorName}'} # type: ignore + + def list_site_detector_responses( + self, + resource_group_name, # type: str + site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DetectorResponseCollection"] + """List Site Detector Responses. + + Description for List Site Detector Responses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DetectorResponseCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.DetectorResponseCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponseCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detector_responses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DetectorResponseCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_detector_responses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors'} # type: ignore + + def get_site_detector_response( + self, + resource_group_name, # type: str + site_name, # type: str + detector_name, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DetectorResponse" + """Get site detector response. + + Description for Get site detector response. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector_response.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector_response.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors/{detectorName}'} # type: ignore + + def list_site_diagnostic_categories( + self, + resource_group_name, # type: str + site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiagnosticCategoryCollection"] + """Get Diagnostics Categories. + + Description for Get Diagnostics Categories. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticCategoryCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.DiagnosticCategoryCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_diagnostic_categories.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticCategoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_diagnostic_categories.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics'} # type: ignore + + def get_site_diagnostic_category( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DiagnosticCategory" + """Get Diagnostics Category. + + Description for Get Diagnostics Category. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticCategory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DiagnosticCategory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategory"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_diagnostic_category.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticCategory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_diagnostic_category.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}'} # type: ignore + + def list_site_analyses( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiagnosticAnalysisCollection"] + """Get Site Analyses. + + Description for Get Site Analyses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticAnalysisCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.DiagnosticAnalysisCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysisCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_analyses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticAnalysisCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_analyses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses'} # type: ignore + + def get_site_analysis( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + analysis_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AnalysisDefinition" + """Get Site Analysis. + + Description for Get Site Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param analysis_name: Analysis Name. + :type analysis_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalysisDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AnalysisDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalysisDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_analysis.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AnalysisDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_analysis.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}'} # type: ignore + + def execute_site_analysis( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + analysis_name, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DiagnosticAnalysis" + """Execute Analysis. + + Description for Execute Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param analysis_name: Analysis Resource Name. + :type analysis_name: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticAnalysis, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DiagnosticAnalysis + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysis"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_analysis.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticAnalysis', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_analysis.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute'} # type: ignore + + def list_site_detectors( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiagnosticDetectorCollection"] + """Get Detectors. + + Description for Get Detectors. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticDetectorCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.DiagnosticDetectorCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detectors.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticDetectorCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_detectors.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors'} # type: ignore + + def get_site_detector( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + detector_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DetectorDefinition" + """Get Detector. + + Description for Get Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param detector_name: Detector Name. + :type detector_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DetectorDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}'} # type: ignore + + def execute_site_detector( + self, + resource_group_name, # type: str + site_name, # type: str + detector_name, # type: str + diagnostic_category, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DiagnosticDetectorResponse" + """Execute Detector. + + Description for Execute Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticDetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DiagnosticDetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_detector.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticDetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_detector.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute'} # type: ignore + + def list_site_detector_responses_slot( + self, + resource_group_name, # type: str + site_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DetectorResponseCollection"] + """List Site Detector Responses. + + Description for List Site Detector Responses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DetectorResponseCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.DetectorResponseCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponseCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detector_responses_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DetectorResponseCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_detector_responses_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors'} # type: ignore + + def get_site_detector_response_slot( + self, + resource_group_name, # type: str + site_name, # type: str + detector_name, # type: str + slot, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DetectorResponse" + """Get site detector response. + + Description for Get site detector response. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param slot: Slot Name. + :type slot: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector_response_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector_response_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors/{detectorName}'} # type: ignore + + def list_site_diagnostic_categories_slot( + self, + resource_group_name, # type: str + site_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiagnosticCategoryCollection"] + """Get Diagnostics Categories. + + Description for Get Diagnostics Categories. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticCategoryCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.DiagnosticCategoryCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_diagnostic_categories_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticCategoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_diagnostic_categories_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics'} # type: ignore + + def get_site_diagnostic_category_slot( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DiagnosticCategory" + """Get Diagnostics Category. + + Description for Get Diagnostics Category. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticCategory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DiagnosticCategory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategory"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_diagnostic_category_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticCategory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_diagnostic_category_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}'} # type: ignore + + def list_site_analyses_slot( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiagnosticAnalysisCollection"] + """Get Site Analyses. + + Description for Get Site Analyses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticAnalysisCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.DiagnosticAnalysisCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysisCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_analyses_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticAnalysisCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_analyses_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses'} # type: ignore + + def get_site_analysis_slot( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + analysis_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AnalysisDefinition" + """Get Site Analysis. + + Description for Get Site Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param analysis_name: Analysis Name. + :type analysis_name: str + :param slot: Slot - optional. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalysisDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AnalysisDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalysisDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_analysis_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AnalysisDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_analysis_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses/{analysisName}'} # type: ignore + + def execute_site_analysis_slot( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + analysis_name, # type: str + slot, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DiagnosticAnalysis" + """Execute Analysis. + + Description for Execute Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param analysis_name: Analysis Resource Name. + :type analysis_name: str + :param slot: Slot Name. + :type slot: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticAnalysis, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DiagnosticAnalysis + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysis"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_analysis_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticAnalysis', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_analysis_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute'} # type: ignore + + def list_site_detectors_slot( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiagnosticDetectorCollection"] + """Get Detectors. + + Description for Get Detectors. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticDetectorCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.DiagnosticDetectorCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detectors_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticDetectorCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_detectors_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors'} # type: ignore + + def get_site_detector_slot( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + detector_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DetectorDefinition" + """Get Detector. + + Description for Get Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param detector_name: Detector Name. + :type detector_name: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DetectorDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors/{detectorName}'} # type: ignore + + def execute_site_detector_slot( + self, + resource_group_name, # type: str + site_name, # type: str + detector_name, # type: str + diagnostic_category, # type: str + slot, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DiagnosticDetectorResponse" + """Execute Detector. + + Description for Execute Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticDetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DiagnosticDetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_detector_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticDetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_detector_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_domain_registration_provider_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_domain_registration_provider_operations.py new file mode 100644 index 000000000000..ac90a866057e --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_domain_registration_provider_operations.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DomainRegistrationProviderOperations(object): + """DomainRegistrationProviderOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_operations( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CsmOperationCollection"] + """Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. + + Description for Implements Csm operations Api to exposes the list of available Csm Apis under + the resource provider. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmOperationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.CsmOperationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmOperationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CsmOperationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_operations.metadata = {'url': '/providers/Microsoft.DomainRegistration/operations'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_domains_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_domains_operations.py new file mode 100644 index 000000000000..0f7cb4687633 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_domains_operations.py @@ -0,0 +1,1139 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DomainsOperations(object): + """DomainsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def check_availability( + self, + identifier, # type: "_models.NameIdentifier" + **kwargs # type: Any + ): + # type: (...) -> "_models.DomainAvailabilityCheckResult" + """Check if a domain is available for registration. + + Description for Check if a domain is available for registration. + + :param identifier: Name of the domain. + :type identifier: ~azure.mgmt.web.v2020_06_01.models.NameIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainAvailabilityCheckResult, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DomainAvailabilityCheckResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainAvailabilityCheckResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainAvailabilityCheckResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/checkDomainAvailability'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DomainCollection"] + """Get all domains in a subscription. + + Description for Get all domains in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DomainCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.DomainCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DomainCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/domains'} # type: ignore + + def get_control_center_sso_request( + self, + **kwargs # type: Any + ): + # type: (...) -> "_models.DomainControlCenterSsoRequest" + """Generate a single sign-on request for the domain management portal. + + Description for Generate a single sign-on request for the domain management portal. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainControlCenterSsoRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DomainControlCenterSsoRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainControlCenterSsoRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_control_center_sso_request.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainControlCenterSsoRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_control_center_sso_request.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/generateSsoRequest'} # type: ignore + + def list_recommendations( + self, + parameters, # type: "_models.DomainRecommendationSearchParameters" + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NameIdentifierCollection"] + """Get domain name recommendations based on keywords. + + Description for Get domain name recommendations based on keywords. + + :param parameters: Search parameters for domain name recommendations. + :type parameters: ~azure.mgmt.web.v2020_06_01.models.DomainRecommendationSearchParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NameIdentifierCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.NameIdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NameIdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_recommendations.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DomainRecommendationSearchParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DomainRecommendationSearchParameters') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NameIdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_recommendations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/listDomainRecommendations'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DomainCollection"] + """Get all domains in a resource group. + + Description for Get all domains in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 DomainCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.DomainCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DomainCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.DomainRegistration/domains'} # type: ignore + + def get( + self, + resource_group_name, # type: str + domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Domain" + """Get a domain. + + Description for Get a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Domain, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Domain + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + domain_name, # type: str + domain, # type: "_models.Domain" + **kwargs # type: Any + ): + # type: (...) -> "_models.Domain" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str', pattern=r'[a-zA-Z0-9][a-zA-Z0-9\.-]+'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain, 'Domain') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Domain', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + domain_name, # type: str + domain, # type: "_models.Domain" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Domain"] + """Creates or updates a domain. + + Description for Creates or updates a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param domain: Domain registration information. + :type domain: ~azure.mgmt.web.v2020_06_01.models.Domain + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 Domain or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.Domain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + domain_name=domain_name, + domain=domain, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str', pattern=r'[a-zA-Z0-9][a-zA-Z0-9\.-]+'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + domain_name, # type: str + force_hard_delete_domain=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a domain. + + Description for Delete a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param force_hard_delete_domain: Specify :code:`true` to delete the domain + immediately. The default is :code:`false` which deletes the domain after 24 hours. + :type force_hard_delete_domain: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if force_hard_delete_domain is not None: + query_parameters['forceHardDeleteDomain'] = self._serialize.query("force_hard_delete_domain", force_hard_delete_domain, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + domain_name, # type: str + domain, # type: "_models.DomainPatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.Domain" + """Creates or updates a domain. + + Description for Creates or updates a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param domain: Domain registration information. + :type domain: ~azure.mgmt.web.v2020_06_01.models.DomainPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Domain, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Domain + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str', pattern=r'[a-zA-Z0-9][a-zA-Z0-9\.-]+'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain, 'DomainPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Domain', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + def list_ownership_identifiers( + self, + resource_group_name, # type: str + domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DomainOwnershipIdentifierCollection"] + """Lists domain ownership identifiers. + + Description for Lists domain ownership identifiers. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type 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 DomainOwnershipIdentifierCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.DomainOwnershipIdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_ownership_identifiers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DomainOwnershipIdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_ownership_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers'} # type: ignore + + def get_ownership_identifier( + self, + resource_group_name, # type: str + domain_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DomainOwnershipIdentifier" + """Get ownership identifier for domain. + + Description for Get ownership identifier for domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainOwnershipIdentifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DomainOwnershipIdentifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainOwnershipIdentifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + def create_or_update_ownership_identifier( + self, + resource_group_name, # type: str + domain_name, # type: str + name, # type: str + domain_ownership_identifier, # type: "_models.DomainOwnershipIdentifier" + **kwargs # type: Any + ): + # type: (...) -> "_models.DomainOwnershipIdentifier" + """Creates an ownership identifier for a domain or updates identifier details for an existing identifer. + + Description for Creates an ownership identifier for a domain or updates identifier details for + an existing identifer. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_06_01.models.DomainOwnershipIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainOwnershipIdentifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DomainOwnershipIdentifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'DomainOwnershipIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainOwnershipIdentifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + def delete_ownership_identifier( + self, + resource_group_name, # type: str + domain_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete ownership identifier for domain. + + Description for Delete ownership identifier for domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + def update_ownership_identifier( + self, + resource_group_name, # type: str + domain_name, # type: str + name, # type: str + domain_ownership_identifier, # type: "_models.DomainOwnershipIdentifier" + **kwargs # type: Any + ): + # type: (...) -> "_models.DomainOwnershipIdentifier" + """Creates an ownership identifier for a domain or updates identifier details for an existing identifer. + + Description for Creates an ownership identifier for a domain or updates identifier details for + an existing identifer. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_06_01.models.DomainOwnershipIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainOwnershipIdentifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DomainOwnershipIdentifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'DomainOwnershipIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainOwnershipIdentifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + def renew( + self, + resource_group_name, # type: str + domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Renew a domain. + + Description for Renew a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.renew.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + renew.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/renew'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_provider_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_provider_operations.py new file mode 100644 index 000000000000..4a22cac9c13f --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_provider_operations.py @@ -0,0 +1,259 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ProviderOperations(object): + """ProviderOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get_available_stacks( + self, + os_type_selected=None, # type: Optional[Union[str, "_models.Enum4"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ApplicationStackCollection"] + """Get available application frameworks and their versions. + + Description for Get available application frameworks and their versions. + + :param os_type_selected: + :type os_type_selected: str or ~azure.mgmt.web.v2020_06_01.models.Enum4 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationStackCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ApplicationStackCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationStackCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_available_stacks.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if os_type_selected is not None: + query_parameters['osTypeSelected'] = self._serialize.query("os_type_selected", os_type_selected, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationStackCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_available_stacks.metadata = {'url': '/providers/Microsoft.Web/availableStacks'} # type: ignore + + def list_operations( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CsmOperationCollection"] + """Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. + + Description for Gets all available operations for the Microsoft.Web resource provider. Also + exposes resource metric definitions. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmOperationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.CsmOperationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmOperationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CsmOperationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_operations.metadata = {'url': '/providers/Microsoft.Web/operations'} # type: ignore + + def get_available_stacks_on_prem( + self, + os_type_selected=None, # type: Optional[Union[str, "_models.Enum5"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ApplicationStackCollection"] + """Get available application frameworks and their versions. + + Description for Get available application frameworks and their versions. + + :param os_type_selected: + :type os_type_selected: str or ~azure.mgmt.web.v2020_06_01.models.Enum5 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationStackCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ApplicationStackCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationStackCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_available_stacks_on_prem.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if os_type_selected is not None: + query_parameters['osTypeSelected'] = self._serialize.query("os_type_selected", os_type_selected, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationStackCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_available_stacks_on_prem.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_recommendations_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_recommendations_operations.py new file mode 100644 index 000000000000..c664f0153794 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_recommendations_operations.py @@ -0,0 +1,1128 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RecommendationsOperations(object): + """RecommendationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + featured=None, # type: Optional[bool] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RecommendationCollection"] + """List all recommendations for a subscription. + + Description for List all recommendations for a subscription. + + :param featured: Specify :code:`true` to return only the most critical + recommendations. The default is :code:`false`, which returns all recommendations. + :type featured: bool + :param filter: Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or + channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq + 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if featured is not None: + query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations'} # type: ignore + + def reset_all_filters( + self, + **kwargs # type: Any + ): + # type: (...) -> None + """Reset all recommendation opt-out settings for a subscription. + + Description for Reset all recommendation opt-out settings for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.reset_all_filters.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_all_filters.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/reset'} # type: ignore + + def disable_recommendation_for_subscription( + self, + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Disables the specified rule so it will not apply to a subscription in the future. + + Description for Disables the specified rule so it will not apply to a subscription in the + future. + + :param name: Rule name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.disable_recommendation_for_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_recommendation_for_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/{name}/disable'} # type: ignore + + def list_history_for_hosting_environment( + self, + resource_group_name, # type: str + hosting_environment_name, # type: str + expired_only=None, # type: Optional[bool] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RecommendationCollection"] + """Get past recommendations for an app, optionally specified by the time range. + + Description for Get past recommendations for an app, optionally specified by the time range. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param hosting_environment_name: Name of the hosting environment. + :type hosting_environment_name: str + :param expired_only: Specify :code:`false` to return all recommendations. The + default is :code:`true`, which returns only expired recommendations. + :type expired_only: bool + :param filter: Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or + channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq + 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_history_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expired_only is not None: + query_parameters['expiredOnly'] = self._serialize.query("expired_only", expired_only, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_history_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendationHistory'} # type: ignore + + def list_recommended_rules_for_hosting_environment( + self, + resource_group_name, # type: str + hosting_environment_name, # type: str + featured=None, # type: Optional[bool] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RecommendationCollection"] + """Get all recommendations for a hosting environment. + + Description for Get all recommendations for a hosting environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param hosting_environment_name: Name of the app. + :type hosting_environment_name: str + :param featured: Specify :code:`true` to return only the most critical + recommendations. The default is :code:`false`, which returns all recommendations. + :type featured: bool + :param filter: Return only channels specified in the filter. Filter is specified by using OData + syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_recommended_rules_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if featured is not None: + query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_recommended_rules_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations'} # type: ignore + + def disable_all_for_hosting_environment( + self, + resource_group_name, # type: str + environment_name, # type: str + hosting_environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Disable all recommendations for an app. + + Description for Disable all recommendations for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param environment_name: Name of the app. + :type environment_name: str + :param hosting_environment_name: + :type hosting_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.disable_all_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['environmentName'] = self._serialize.query("environment_name", environment_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_all_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/disable'} # type: ignore + + def reset_all_filters_for_hosting_environment( + self, + resource_group_name, # type: str + environment_name, # type: str + hosting_environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Reset all recommendation opt-out settings for an app. + + Description for Reset all recommendation opt-out settings for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param environment_name: Name of the app. + :type environment_name: str + :param hosting_environment_name: + :type hosting_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.reset_all_filters_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['environmentName'] = self._serialize.query("environment_name", environment_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_all_filters_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/reset'} # type: ignore + + def get_rule_details_by_hosting_environment( + self, + resource_group_name, # type: str + hosting_environment_name, # type: str + name, # type: str + update_seen=None, # type: Optional[bool] + recommendation_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.RecommendationRule" + """Get a recommendation rule for an app. + + Description for Get a recommendation rule for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param hosting_environment_name: Name of the hosting environment. + :type hosting_environment_name: str + :param name: Name of the recommendation. + :type name: str + :param update_seen: Specify :code:`true` to update the last-seen timestamp of the + recommendation object. + :type update_seen: bool + :param recommendation_id: The GUID of the recommendation object if you query an expired one. + You don't need to specify it to query an active entry. + :type recommendation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RecommendationRule, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RecommendationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_rule_details_by_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if update_seen is not None: + query_parameters['updateSeen'] = self._serialize.query("update_seen", update_seen, 'bool') + if recommendation_id is not None: + query_parameters['recommendationId'] = self._serialize.query("recommendation_id", recommendation_id, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RecommendationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_rule_details_by_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}'} # type: ignore + + def disable_recommendation_for_hosting_environment( + self, + resource_group_name, # type: str + environment_name, # type: str + name, # type: str + hosting_environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Disables the specific rule for a web site permanently. + + Description for Disables the specific rule for a web site permanently. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param environment_name: Site name. + :type environment_name: str + :param name: Rule name. + :type name: str + :param hosting_environment_name: + :type hosting_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.disable_recommendation_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['environmentName'] = self._serialize.query("environment_name", environment_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_recommendation_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}/disable'} # type: ignore + + def list_history_for_web_app( + self, + resource_group_name, # type: str + site_name, # type: str + expired_only=None, # type: Optional[bool] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RecommendationCollection"] + """Get past recommendations for an app, optionally specified by the time range. + + Description for Get past recommendations for an app, optionally specified by the time range. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :param expired_only: Specify :code:`false` to return all recommendations. The + default is :code:`true`, which returns only expired recommendations. + :type expired_only: bool + :param filter: Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or + channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq + 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_history_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expired_only is not None: + query_parameters['expiredOnly'] = self._serialize.query("expired_only", expired_only, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_history_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendationHistory'} # type: ignore + + def list_recommended_rules_for_web_app( + self, + resource_group_name, # type: str + site_name, # type: str + featured=None, # type: Optional[bool] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RecommendationCollection"] + """Get all recommendations for an app. + + Description for Get all recommendations for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :param featured: Specify :code:`true` to return only the most critical + recommendations. The default is :code:`false`, which returns all recommendations. + :type featured: bool + :param filter: Return only channels specified in the filter. Filter is specified by using OData + syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_recommended_rules_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if featured is not None: + query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_recommended_rules_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations'} # type: ignore + + def disable_all_for_web_app( + self, + resource_group_name, # type: str + site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Disable all recommendations for an app. + + Description for Disable all recommendations for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.disable_all_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_all_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/disable'} # type: ignore + + def reset_all_filters_for_web_app( + self, + resource_group_name, # type: str + site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Reset all recommendation opt-out settings for an app. + + Description for Reset all recommendation opt-out settings for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.reset_all_filters_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_all_filters_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/reset'} # type: ignore + + def get_rule_details_by_web_app( + self, + resource_group_name, # type: str + site_name, # type: str + name, # type: str + update_seen=None, # type: Optional[bool] + recommendation_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.RecommendationRule" + """Get a recommendation rule for an app. + + Description for Get a recommendation rule for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :param name: Name of the recommendation. + :type name: str + :param update_seen: Specify :code:`true` to update the last-seen timestamp of the + recommendation object. + :type update_seen: bool + :param recommendation_id: The GUID of the recommendation object if you query an expired one. + You don't need to specify it to query an active entry. + :type recommendation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RecommendationRule, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RecommendationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_rule_details_by_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if update_seen is not None: + query_parameters['updateSeen'] = self._serialize.query("update_seen", update_seen, 'bool') + if recommendation_id is not None: + query_parameters['recommendationId'] = self._serialize.query("recommendation_id", recommendation_id, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RecommendationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_rule_details_by_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}'} # type: ignore + + def disable_recommendation_for_site( + self, + resource_group_name, # type: str + site_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Disables the specific rule for a web site permanently. + + Description for Disables the specific rule for a web site permanently. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site name. + :type site_name: str + :param name: Rule name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.disable_recommendation_for_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_recommendation_for_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}/disable'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_resource_health_metadata_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_resource_health_metadata_operations.py new file mode 100644 index 000000000000..0b4e8d6febfd --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_resource_health_metadata_operations.py @@ -0,0 +1,481 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ResourceHealthMetadataOperations(object): + """ResourceHealthMetadataOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceHealthMetadataCollection"] + """List all ResourceHealthMetadata for all sites in the subscription. + + Description for List all ResourceHealthMetadata for all sites in the subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/resourceHealthMetadata'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceHealthMetadataCollection"] + """List all ResourceHealthMetadata for all sites in the resource group in the subscription. + + Description for List all ResourceHealthMetadata for all sites in the resource group in the + subscription. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.Web/resourceHealthMetadata'} # type: ignore + + def list_by_site( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceHealthMetadataCollection"] + """Gets the category of ResourceHealthMetadata to use for the given site as a collection. + + Description for Gets the category of ResourceHealthMetadata to use for the given site as a + collection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata'} # type: ignore + + def get_by_site( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ResourceHealthMetadata" + """Gets the category of ResourceHealthMetadata to use for the given site. + + Description for Gets the category of ResourceHealthMetadata to use for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceHealthMetadata, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ResourceHealthMetadata + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadata"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_by_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceHealthMetadata', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata/default'} # type: ignore + + def list_by_site_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceHealthMetadataCollection"] + """Gets the category of ResourceHealthMetadata to use for the given site as a collection. + + Description for Gets the category of ResourceHealthMetadata to use for the given site as a + collection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_site_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_site_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata'} # type: ignore + + def get_by_site_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ResourceHealthMetadata" + """Gets the category of ResourceHealthMetadata to use for the given site. + + Description for Gets the category of ResourceHealthMetadata to use for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceHealthMetadata, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ResourceHealthMetadata + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadata"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_by_site_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceHealthMetadata', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_site_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata/default'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_static_sites_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_static_sites_operations.py new file mode 100644 index 000000000000..1929ae73b9fa --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_static_sites_operations.py @@ -0,0 +1,1944 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class StaticSitesOperations(object): + """StaticSitesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def preview_workflow( + self, + location, # type: str + static_sites_workflow_preview_request, # type: "_models.StaticSitesWorkflowPreviewRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSitesWorkflowPreview" + """Generates a preview workflow file for the static site. + + Description for Generates a preview workflow file for the static site. + + :param location: Location where you plan to create the static site. + :type location: str + :param static_sites_workflow_preview_request: A JSON representation of the + StaticSitesWorkflowPreviewRequest properties. See example. + :type static_sites_workflow_preview_request: ~azure.mgmt.web.v2020_06_01.models.StaticSitesWorkflowPreviewRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSitesWorkflowPreview, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StaticSitesWorkflowPreview + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSitesWorkflowPreview"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.preview_workflow.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_sites_workflow_preview_request, 'StaticSitesWorkflowPreviewRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSitesWorkflowPreview', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + preview_workflow.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/previewStaticSiteWorkflowFile'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteCollection"] + """Get all Static Sites for a subscription. + + Description for Get all Static Sites for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.StaticSiteCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/staticSites'} # type: ignore + + def get_static_sites_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteCollection"] + """Gets all static sites in the specified resource group. + + Description for Gets all static sites in the specified resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 StaticSiteCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.StaticSiteCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_static_sites_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_static_sites_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites'} # type: ignore + + def get_static_site( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteARMResource" + """Gets the details of a static site. + + Description for Gets the details of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StaticSiteARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + def create_or_update_static_site( + self, + resource_group_name, # type: str + name, # type: str + static_site_envelope, # type: "_models.StaticSiteARMResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteARMResource" + """Creates a new static site in an existing resource group, or updates an existing static site. + + Description for Creates a new static site in an existing resource group, or updates an existing + static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to create or update. + :type name: str + :param static_site_envelope: A JSON representation of the staticsite properties. See example. + :type static_site_envelope: ~azure.mgmt.web.v2020_06_01.models.StaticSiteARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StaticSiteARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_envelope, 'StaticSiteARMResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + def delete_static_site( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a static site. + + Description for Deletes a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to delete. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + def update_static_site( + self, + resource_group_name, # type: str + name, # type: str + static_site_envelope, # type: "_models.StaticSitePatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteARMResource" + """Creates a new static site in an existing resource group, or updates an existing static site. + + Description for Creates a new static site in an existing resource group, or updates an existing + static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to create or update. + :type name: str + :param static_site_envelope: A JSON representation of the staticsite properties. See example. + :type static_site_envelope: ~azure.mgmt.web.v2020_06_01.models.StaticSitePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StaticSiteARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_envelope, 'StaticSitePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + def list_static_site_users( + self, + resource_group_name, # type: str + name, # type: str + authprovider, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteUserCollection"] + """Gets the list of users of a static site. + + Description for Gets the list of users of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param authprovider: The auth provider for the users. + :type authprovider: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteUserCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.StaticSiteUserCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_users.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'authprovider': self._serialize.url("authprovider", authprovider, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteUserCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_static_site_users.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/listUsers'} # type: ignore + + def delete_static_site_user( + self, + resource_group_name, # type: str + name, # type: str + authprovider, # type: str + userid, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the user entry from the static site. + + Description for Deletes the user entry from the static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the staticsite. + :type name: str + :param authprovider: The auth provider for this user. + :type authprovider: str + :param userid: The user id of the user. + :type userid: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_static_site_user.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'authprovider': self._serialize.url("authprovider", authprovider, 'str'), + 'userid': self._serialize.url("userid", userid, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_static_site_user.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}'} # type: ignore + + def update_static_site_user( + self, + resource_group_name, # type: str + name, # type: str + authprovider, # type: str + userid, # type: str + static_site_user_envelope, # type: "_models.StaticSiteUserARMResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteUserARMResource" + """Updates a user entry with the listed roles. + + Description for Updates a user entry with the listed roles. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param authprovider: The auth provider for this user. + :type authprovider: str + :param userid: The user id of the user. + :type userid: str + :param static_site_user_envelope: A JSON representation of the StaticSiteUser properties. See + example. + :type static_site_user_envelope: ~azure.mgmt.web.v2020_06_01.models.StaticSiteUserARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteUserARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StaticSiteUserARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_static_site_user.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'authprovider': self._serialize.url("authprovider", authprovider, 'str'), + 'userid': self._serialize.url("userid", userid, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_user_envelope, 'StaticSiteUserARMResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteUserARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_static_site_user.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}'} # type: ignore + + def get_static_site_builds( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteBuildCollection"] + """Gets all static site builds for a particular static site. + + Description for Gets all static site builds for a particular static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteBuildCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.StaticSiteBuildCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteBuildCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_static_site_builds.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteBuildCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_static_site_builds.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds'} # type: ignore + + def get_static_site_build( + self, + resource_group_name, # type: str + name, # type: str + pr_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteBuildARMResource" + """Gets the details of a static site build. + + Description for Gets the details of a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteBuildARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StaticSiteBuildARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteBuildARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_static_site_build.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteBuildARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}'} # type: ignore + + def delete_static_site_build( + self, + resource_group_name, # type: str + name, # type: str + pr_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a static site build. + + Description for Deletes a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_static_site_build.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}'} # type: ignore + + def create_or_update_static_site_build_function_app_settings( + self, + resource_group_name, # type: str + name, # type: str + pr_id, # type: str + app_settings, # type: "_models.StringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Creates or updates the function app settings of a static site build. + + Description for Creates or updates the function app settings of a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_id: str + :param app_settings: + :type app_settings: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site_build_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site_build_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/config/functionappsettings'} # type: ignore + + def list_static_site_build_functions( + self, + resource_group_name, # type: str + name, # type: str + pr_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteFunctionOverviewCollection"] + """Gets the functions of a particular static site build. + + Description for Gets the functions of a particular static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteFunctionOverviewCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.StaticSiteFunctionOverviewCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteFunctionOverviewCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_build_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteFunctionOverviewCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_static_site_build_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/functions'} # type: ignore + + def list_static_site_build_function_app_settings( + self, + resource_group_name, # type: str + name, # type: str + pr_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Gets the application settings of a static site. + + Description for Gets the application settings of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_build_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_build_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/listFunctionAppSettings'} # type: ignore + + def create_or_update_static_site_function_app_settings( + self, + resource_group_name, # type: str + name, # type: str + app_settings, # type: "_models.StringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Creates or updates the function app settings of a static site. + + Description for Creates or updates the function app settings of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param app_settings: + :type app_settings: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/functionappsettings'} # type: ignore + + def create_user_roles_invitation_link( + self, + resource_group_name, # type: str + name, # type: str + static_site_user_roles_invitation_envelope, # type: "_models.StaticSiteUserInvitationRequestResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteUserInvitationResponseResource" + """Creates an invitation link for a user with the role. + + Description for Creates an invitation link for a user with the role. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param static_site_user_roles_invitation_envelope: + :type static_site_user_roles_invitation_envelope: ~azure.mgmt.web.v2020_06_01.models.StaticSiteUserInvitationRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteUserInvitationResponseResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StaticSiteUserInvitationResponseResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserInvitationResponseResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_user_roles_invitation_link.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_user_roles_invitation_envelope, 'StaticSiteUserInvitationRequestResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteUserInvitationResponseResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_user_roles_invitation_link.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/createUserInvitation'} # type: ignore + + def list_static_site_custom_domains( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteCustomDomainOverviewCollection"] + """Gets all static site custom domains for a particular static site. + + Description for Gets all static site custom domains for a particular static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site resource to search in. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteCustomDomainOverviewCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.StaticSiteCustomDomainOverviewCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCustomDomainOverviewCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_custom_domains.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteCustomDomainOverviewCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_static_site_custom_domains.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains'} # type: ignore + + def create_or_update_static_site_custom_domain( + self, + resource_group_name, # type: str + name, # type: str + domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteCustomDomainOverviewARMResource" + """Creates a new static site custom domain in an existing resource group and static site. + + Description for Creates a new static site custom domain in an existing resource group and + static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param domain_name: The custom domain to create. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteCustomDomainOverviewARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StaticSiteCustomDomainOverviewARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCustomDomainOverviewARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site_custom_domain.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteCustomDomainOverviewARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteCustomDomainOverviewARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site_custom_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}'} # type: ignore + + def delete_static_site_custom_domain( + self, + resource_group_name, # type: str + name, # type: str + domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a custom domain. + + Description for Deletes a custom domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param domain_name: The custom domain to delete. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_static_site_custom_domain.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_static_site_custom_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}'} # type: ignore + + def validate_custom_domain_can_be_added_to_static_site( + self, + resource_group_name, # type: str + name, # type: str + domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Validates a particular custom domain can be added to a static site. + + Description for Validates a particular custom domain can be added to a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param domain_name: The custom domain to validate. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.validate_custom_domain_can_be_added_to_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + validate_custom_domain_can_be_added_to_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}/validate'} # type: ignore + + def detach_static_site( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Detaches a static site. + + Description for Detaches a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to detach. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.detach_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + detach_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/detach'} # type: ignore + + def list_static_site_functions( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteFunctionOverviewCollection"] + """Gets the functions of a static site. + + Description for Gets the functions of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteFunctionOverviewCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.StaticSiteFunctionOverviewCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteFunctionOverviewCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteFunctionOverviewCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_static_site_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/functions'} # type: ignore + + def list_static_site_function_app_settings( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Gets the application settings of a static site. + + Description for Gets the application settings of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listFunctionAppSettings'} # type: ignore + + def list_static_site_secrets( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Lists the secrets for an existing static site. + + Description for Lists the secrets for an existing static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listSecrets'} # type: ignore + + def reset_static_site_api_key( + self, + resource_group_name, # type: str + name, # type: str + reset_properties_envelope, # type: "_models.StaticSiteResetPropertiesARMResource" + **kwargs # type: Any + ): + # type: (...) -> None + """Resets the api key for an existing static site. + + Description for Resets the api key for an existing static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param reset_properties_envelope: + :type reset_properties_envelope: ~azure.mgmt.web.v2020_06_01.models.StaticSiteResetPropertiesARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.reset_static_site_api_key.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(reset_properties_envelope, 'StaticSiteResetPropertiesARMResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_static_site_api_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/resetapikey'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_top_level_domains_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_top_level_domains_operations.py new file mode 100644 index 000000000000..b99cc1c4a7bd --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_top_level_domains_operations.py @@ -0,0 +1,259 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class TopLevelDomainsOperations(object): + """TopLevelDomainsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.TopLevelDomainCollection"] + """Get all top-level domains supported for registration. + + Description for Get all top-level domains supported for registration. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TopLevelDomainCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.TopLevelDomainCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TopLevelDomainCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TopLevelDomainCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains'} # type: ignore + + def get( + self, + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.TopLevelDomain" + """Get details of a top-level domain. + + Description for Get details of a top-level domain. + + :param name: Name of the top-level domain. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TopLevelDomain, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.TopLevelDomain + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TopLevelDomain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TopLevelDomain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}'} # type: ignore + + def list_agreements( + self, + name, # type: str + agreement_option, # type: "_models.TopLevelDomainAgreementOption" + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.TldLegalAgreementCollection"] + """Gets all legal agreements that user needs to accept before purchasing a domain. + + Description for Gets all legal agreements that user needs to accept before purchasing a domain. + + :param name: Name of the top-level domain. + :type name: str + :param agreement_option: Domain agreement options. + :type agreement_option: ~azure.mgmt.web.v2020_06_01.models.TopLevelDomainAgreementOption + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TldLegalAgreementCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.TldLegalAgreementCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TldLegalAgreementCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_agreements.metadata['url'] # type: ignore + path_format_arguments = { + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(agreement_option, 'TopLevelDomainAgreementOption') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(agreement_option, 'TopLevelDomainAgreementOption') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TldLegalAgreementCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_agreements.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}/listAgreements'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_web_apps_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_web_apps_operations.py new file mode 100644 index 000000000000..53947f7d55cf --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_web_apps_operations.py @@ -0,0 +1,28958 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, IO, Iterable, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WebAppsOperations(object): + """WebAppsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppCollection"] + """Get all apps for a subscription. + + Description for Get all apps for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/sites'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + include_slots=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppCollection"] + """Gets all web, mobile, and API apps in the specified resource group. + + Description for Gets all web, mobile, and API apps in the specified resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param include_slots: Specify :code:`true` to include deployment slots in + results. The default is false, which only gives you the production slot of all apps. + :type include_slots: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if include_slots is not None: + query_parameters['includeSlots'] = self._serialize.query("include_slots", include_slots, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.Web/sites'} # type: ignore + + def get( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Site"] + """Gets the details of a web, mobile, or API app. + + Description for Gets the details of a web, mobile, or API app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Site or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Site"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + name, # type: str + site_envelope, # type: "_models.Site" + **kwargs # type: Any + ): + # type: (...) -> "_models.Site" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'Site') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + name, # type: str + site_envelope, # type: "_models.Site" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Site"] + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2020_06_01.models.Site + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 Site or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + site_envelope=site_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + name, # type: str + delete_metrics=None, # type: Optional[bool] + delete_empty_server_farm=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a web, mobile, or API app, or one of the deployment slots. + + Description for Deletes a web, mobile, or API app, or one of the deployment slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app to delete. + :type name: str + :param delete_metrics: If true, web app metrics are also deleted. + :type delete_metrics: bool + :param delete_empty_server_farm: Specify false if you want to keep empty App Service plan. By + default, empty App Service plan is deleted. + :type delete_empty_server_farm: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if delete_metrics is not None: + query_parameters['deleteMetrics'] = self._serialize.query("delete_metrics", delete_metrics, 'bool') + if delete_empty_server_farm is not None: + query_parameters['deleteEmptyServerFarm'] = self._serialize.query("delete_empty_server_farm", delete_empty_server_farm, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + name, # type: str + site_envelope, # type: "_models.SitePatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.Site" + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2020_06_01.models.SitePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Site + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'SitePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + def analyze_custom_hostname( + self, + resource_group_name, # type: str + name, # type: str + host_name=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.CustomHostnameAnalysisResult" + """Analyze a custom hostname. + + Description for Analyze a custom hostname. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param host_name: Custom hostname. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CustomHostnameAnalysisResult, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.CustomHostnameAnalysisResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomHostnameAnalysisResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.analyze_custom_hostname.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if host_name is not None: + query_parameters['hostName'] = self._serialize.query("host_name", host_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CustomHostnameAnalysisResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + analyze_custom_hostname.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/analyzeCustomHostname'} # type: ignore + + def apply_slot_config_to_production( + self, + resource_group_name, # type: str + name, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> None + """Applies the configuration settings from the target slot onto the current slot. + + Description for Applies the configuration settings from the target slot onto the current slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_06_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.apply_slot_config_to_production.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + apply_slot_config_to_production.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/applySlotConfig'} # type: ignore + + def backup( + self, + resource_group_name, # type: str + name, # type: str + request, # type: "_models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupItem" + """Creates a backup of an app. + + Description for Creates a backup of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: Backup configuration. You can use the JSON response from the POST action as + input here. + :type request: ~azure.mgmt.web.v2020_06_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.backup.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backup'} # type: ignore + + def list_backups( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BackupItemCollection"] + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_backups.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_backups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups'} # type: ignore + + def get_backup_status( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupItem" + """Gets a backup of an app by its ID. + + Description for Gets a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}'} # type: ignore + + def delete_backup( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a backup of an app by its ID. + + Description for Deletes a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}'} # type: ignore + + def list_backup_status_secrets( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + request, # type: "_models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupItem" + """Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + + Description for Gets status of a web app backup that may be in progress, including secrets + associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the + SAS URL for the backup if a new URL is passed in the request body. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param backup_id: ID of backup. + :type backup_id: str + :param request: Information on backup request. + :type request: ~azure.mgmt.web.v2020_06_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_backup_status_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_backup_status_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/list'} # type: ignore + + def _restore_initial( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore'} # type: ignore + + def begin_restore( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores a specific backup to another app (or deployment slot, if specified). + + Description for Restores a specific backup to another app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2020_06_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_initial( + resource_group_name=resource_group_name, + name=name, + backup_id=backup_id, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore'} # type: ignore + + def get_basic_publishing_credentials_policies( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.CsmPublishingCredentialsPoliciesCollection" + """Returns whether Scm basic auth is allowed and whether Ftp is allowed for a given site. + + Description for Returns whether Scm basic auth is allowed and whether Ftp is allowed for a + given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesCollection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingCredentialsPoliciesCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_basic_publishing_credentials_policies.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_basic_publishing_credentials_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies'} # type: ignore + + def get_ftp_allowed( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.CsmPublishingCredentialsPoliciesEntity" + """Returns whether FTP is allowed on the site or not. + + Description for Returns whether FTP is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_ftp_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ftp_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/ftp'} # type: ignore + + def update_ftp_allowed( + self, + resource_group_name, # type: str + name, # type: str + csm_publishing_access_policies_entity, # type: "_models.CsmPublishingCredentialsPoliciesEntity" + **kwargs # type: Any + ): + # type: (...) -> "_models.CsmPublishingCredentialsPoliciesEntity" + """Updates whether FTP is allowed on the site or not. + + Description for Updates whether FTP is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param csm_publishing_access_policies_entity: + :type csm_publishing_access_policies_entity: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingCredentialsPoliciesEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_ftp_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(csm_publishing_access_policies_entity, 'CsmPublishingCredentialsPoliciesEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_ftp_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/ftp'} # type: ignore + + def get_scm_allowed( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.CsmPublishingCredentialsPoliciesEntity" + """Returns whether Scm basic auth is allowed on the site or not. + + Description for Returns whether Scm basic auth is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_scm_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_scm_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/scm'} # type: ignore + + def update_scm_allowed( + self, + resource_group_name, # type: str + name, # type: str + csm_publishing_access_policies_entity, # type: "_models.CsmPublishingCredentialsPoliciesEntity" + **kwargs # type: Any + ): + # type: (...) -> "_models.CsmPublishingCredentialsPoliciesEntity" + """Updates whether user publishing credentials are allowed on the site or not. + + Description for Updates whether user publishing credentials are allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param csm_publishing_access_policies_entity: + :type csm_publishing_access_policies_entity: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingCredentialsPoliciesEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_scm_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(csm_publishing_access_policies_entity, 'CsmPublishingCredentialsPoliciesEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_scm_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/scm'} # type: ignore + + def list_configurations( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteConfigResourceCollection"] + """List the configurations of an app. + + Description for List the configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigResourceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.SiteConfigResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configurations.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_configurations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config'} # type: ignore + + def update_application_settings( + self, + resource_group_name, # type: str + name, # type: str + app_settings, # type: "_models.StringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Replaces the application settings of an app. + + Description for Replaces the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param app_settings: Application settings of the app. + :type app_settings: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_application_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_application_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings'} # type: ignore + + def list_application_settings( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Gets the application settings of an app. + + Description for Gets the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_application_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_application_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings/list'} # type: ignore + + def update_auth_settings( + self, + resource_group_name, # type: str + name, # type: str + site_auth_settings, # type: "_models.SiteAuthSettings" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettings" + """Updates the Authentication / Authorization settings associated with web app. + + Description for Updates the Authentication / Authorization settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param site_auth_settings: Auth settings associated with web app. + :type site_auth_settings: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings, 'SiteAuthSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings'} # type: ignore + + def get_auth_settings( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettings" + """Gets the Authentication/Authorization settings of an app. + + Description for Gets the Authentication/Authorization settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings/list'} # type: ignore + + def update_auth_settings_v2( + self, + resource_group_name, # type: str + name, # type: str + site_auth_settings_v2, # type: "_models.SiteAuthSettingsV2" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettingsV2" + """Updates site's Authentication / Authorization settings for apps via the V2 format. + + Description for Updates site's Authentication / Authorization settings for apps via the V2 + format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param site_auth_settings_v2: Auth settings associated with web app. + :type site_auth_settings_v2: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettingsV2 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings_v2, 'SiteAuthSettingsV2') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2'} # type: ignore + + def get_auth_settings_v2( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettingsV2" + """Gets site's Authentication / Authorization settings for apps via the V2 format. + + Description for Gets site's Authentication / Authorization settings for apps via the V2 format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2/list'} # type: ignore + + def update_azure_storage_accounts( + self, + resource_group_name, # type: str + name, # type: str + azure_storage_accounts, # type: "_models.AzureStoragePropertyDictionaryResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AzureStoragePropertyDictionaryResource" + """Updates the Azure storage account configurations of an app. + + Description for Updates the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param azure_storage_accounts: Azure storage accounts of the app. + :type azure_storage_accounts: ~azure.mgmt.web.v2020_06_01.models.AzureStoragePropertyDictionaryResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_azure_storage_accounts.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(azure_storage_accounts, 'AzureStoragePropertyDictionaryResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_azure_storage_accounts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts'} # type: ignore + + def list_azure_storage_accounts( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AzureStoragePropertyDictionaryResource" + """Gets the Azure storage account configurations of an app. + + Description for Gets the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_azure_storage_accounts.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_azure_storage_accounts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts/list'} # type: ignore + + def update_backup_configuration( + self, + resource_group_name, # type: str + name, # type: str + request, # type: "_models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupRequest" + """Updates the backup configuration of an app. + + Description for Updates the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: Edited backup configuration. + :type request: ~azure.mgmt.web.v2020_06_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_backup_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_backup_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup'} # type: ignore + + def delete_backup_configuration( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the backup configuration of an app. + + Description for Deletes the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup'} # type: ignore + + def get_backup_configuration( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupRequest" + """Gets the backup configuration of an app. + + Description for Gets the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup/list'} # type: ignore + + def update_connection_strings( + self, + resource_group_name, # type: str + name, # type: str + connection_strings, # type: "_models.ConnectionStringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.ConnectionStringDictionary" + """Replaces the connection strings of an app. + + Description for Replaces the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_strings: Connection strings of the app or deployment slot. See example. + :type connection_strings: ~azure.mgmt.web.v2020_06_01.models.ConnectionStringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_connection_strings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_strings, 'ConnectionStringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_connection_strings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings'} # type: ignore + + def list_connection_strings( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ConnectionStringDictionary" + """Gets the connection strings of an app. + + Description for Gets the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_connection_strings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_connection_strings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings/list'} # type: ignore + + def get_diagnostic_logs_configuration( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteLogsConfig" + """Gets the logging configuration of an app. + + Description for Gets the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostic_logs_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostic_logs_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs'} # type: ignore + + def update_diagnostic_logs_config( + self, + resource_group_name, # type: str + name, # type: str + site_logs_config, # type: "_models.SiteLogsConfig" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteLogsConfig" + """Updates the logging configuration of an app. + + Description for Updates the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_logs_config: A SiteLogsConfig JSON object that contains the logging configuration + to change in the "properties" property. + :type site_logs_config: ~azure.mgmt.web.v2020_06_01.models.SiteLogsConfig + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_diagnostic_logs_config.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_logs_config, 'SiteLogsConfig') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_diagnostic_logs_config.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs'} # type: ignore + + def update_metadata( + self, + resource_group_name, # type: str + name, # type: str + metadata, # type: "_models.StringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Replaces the metadata of an app. + + Description for Replaces the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param metadata: Edited metadata of the app or deployment slot. See example. + :type metadata: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_metadata.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(metadata, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_metadata.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata'} # type: ignore + + def list_metadata( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Gets the metadata of an app. + + Description for Gets the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_metadata.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_metadata.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata/list'} # type: ignore + + def _list_publishing_credentials_initial( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.User" + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._list_publishing_credentials_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_publishing_credentials_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list'} # type: ignore + + def begin_list_publishing_credentials( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.User"] + """Gets the Git/FTP publishing credentials of an app. + + Description for Gets the Git/FTP publishing credentials of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type 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: True for ARMPolling, False for no polling, or a + polling object for 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 User or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._list_publishing_credentials_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_publishing_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list'} # type: ignore + + def update_site_push_settings( + self, + resource_group_name, # type: str + name, # type: str + push_settings, # type: "_models.PushSettings" + **kwargs # type: Any + ): + # type: (...) -> "_models.PushSettings" + """Updates the Push settings associated with web app. + + Description for Updates the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param push_settings: Push settings associated with web app. + :type push_settings: ~azure.mgmt.web.v2020_06_01.models.PushSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_site_push_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(push_settings, 'PushSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_site_push_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings'} # type: ignore + + def list_site_push_settings( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PushSettings" + """Gets the Push settings associated with web app. + + Description for Gets the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_site_push_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_site_push_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings/list'} # type: ignore + + def list_slot_configuration_names( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SlotConfigNamesResource" + """Gets the names of app settings and connection strings that stick to the slot (not swapped). + + Description for Gets the names of app settings and connection strings that stick to the slot + (not swapped). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SlotConfigNamesResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SlotConfigNamesResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotConfigNamesResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_slot_configuration_names.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SlotConfigNamesResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_slot_configuration_names.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames'} # type: ignore + + def update_slot_configuration_names( + self, + resource_group_name, # type: str + name, # type: str + slot_config_names, # type: "_models.SlotConfigNamesResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.SlotConfigNamesResource" + """Updates the names of application settings and connection string that remain with the slot during swap operation. + + Description for Updates the names of application settings and connection string that remain + with the slot during swap operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_config_names: Names of application settings and connection strings. See example. + :type slot_config_names: ~azure.mgmt.web.v2020_06_01.models.SlotConfigNamesResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SlotConfigNamesResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SlotConfigNamesResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotConfigNamesResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_slot_configuration_names.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_config_names, 'SlotConfigNamesResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SlotConfigNamesResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_slot_configuration_names.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames'} # type: ignore + + def get_configuration( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, Always On, etc. + + Description for Gets the configuration of an app, such as platform version and bitness, default + documents, virtual applications, Always On, etc. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} # type: ignore + + def create_or_update_configuration( + self, + resource_group_name, # type: str + name, # type: str + site_config, # type: "_models.SiteConfigResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} # type: ignore + + def update_configuration( + self, + resource_group_name, # type: str + name, # type: str + site_config, # type: "_models.SiteConfigResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} # type: ignore + + def list_configuration_snapshot_info( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteConfigurationSnapshotInfoCollection"] + """Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. + + Description for Gets a list of web app configuration snapshots identifiers. Each element of the + list contains a timestamp and the ID of the snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigurationSnapshotInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.SiteConfigurationSnapshotInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigurationSnapshotInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configuration_snapshot_info.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigurationSnapshotInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_configuration_snapshot_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots'} # type: ignore + + def get_configuration_snapshot( + self, + resource_group_name, # type: str + name, # type: str + snapshot_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Gets a snapshot of the configuration of an app at a previous point in time. + + Description for Gets a snapshot of the configuration of an app at a previous point in time. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration_snapshot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}'} # type: ignore + + def recover_site_configuration_snapshot( + self, + resource_group_name, # type: str + name, # type: str + snapshot_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Reverts the configuration of an app to a previous snapshot. + + Description for Reverts the configuration of an app to a previous snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.recover_site_configuration_snapshot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + recover_site_configuration_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}/recover'} # type: ignore + + def get_web_site_container_logs( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[IO] + """Gets the last lines of docker logs for the given site. + + Description for Gets the last lines of docker logs for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/octet-stream" + + # Construct URL + url = self.get_web_site_container_logs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_site_container_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs'} # type: ignore + + def get_container_logs_zip( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[IO] + """Gets the ZIP archived docker log files for the given site. + + Description for Gets the ZIP archived docker log files for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/zip" + + # Construct URL + url = self.get_container_logs_zip.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_container_logs_zip.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download'} # type: ignore + + def list_continuous_web_jobs( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ContinuousWebJobCollection"] + """List continuous web jobs for an app, or a deployment slot. + + Description for List continuous web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ContinuousWebJobCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ContinuousWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContinuousWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_continuous_web_jobs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ContinuousWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_continuous_web_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs'} # type: ignore + + def get_continuous_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ContinuousWebJob"] + """Gets a continuous web job by its ID for an app, or a deployment slot. + + Description for Gets a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ContinuousWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ContinuousWebJob or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ContinuousWebJob"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ContinuousWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'} # type: ignore + + def delete_continuous_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a continuous web job by its ID for an app, or a deployment slot. + + Description for Delete a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'} # type: ignore + + def start_continuous_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Start a continuous web job for an app, or a deployment slot. + + Description for Start a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.start_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start'} # type: ignore + + def stop_continuous_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stop a continuous web job for an app, or a deployment slot. + + Description for Stop a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.stop_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop'} # type: ignore + + def list_deployments( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DeploymentCollection"] + """List deployments for an app, or a deployment slot. + + Description for List deployments for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeploymentCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.DeploymentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_deployments.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DeploymentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_deployments.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments'} # type: ignore + + def get_deployment( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Deployment" + """Get a deployment by its ID for an app, or a deployment slot. + + Description for Get a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_deployment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} # type: ignore + + def create_deployment( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + deployment, # type: "_models.Deployment" + **kwargs # type: Any + ): + # type: (...) -> "_models.Deployment" + """Create a deployment for an app, or a deployment slot. + + Description for Create a deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: ID of an existing deployment. + :type id: str + :param deployment: Deployment details. + :type deployment: ~azure.mgmt.web.v2020_06_01.models.Deployment + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_deployment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(deployment, 'Deployment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} # type: ignore + + def delete_deployment( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a deployment by its ID for an app, or a deployment slot. + + Description for Delete a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_deployment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} # type: ignore + + def list_deployment_log( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Deployment" + """List deployment log for specific deployment for an app, or a deployment slot. + + Description for List deployment log for specific deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: The ID of a specific deployment. This is the value of the name property in the JSON + response from "GET /api/sites/{siteName}/deployments". + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_deployment_log.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_deployment_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log'} # type: ignore + + def discover_backup( + self, + resource_group_name, # type: str + name, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.RestoreRequest" + """Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information about the databases stored in a backup. + + Description for Discovers an existing app backup that can be restored from a blob in Azure + storage. Use this to get information about the databases stored in a backup. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: A RestoreRequest object that includes Azure storage URL and blog name for + discovery of backup. + :type request: ~azure.mgmt.web.v2020_06_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RestoreRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RestoreRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestoreRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.discover_backup.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RestoreRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + discover_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup'} # type: ignore + + def list_domain_ownership_identifiers( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.IdentifierCollection"] + """Lists ownership identifiers for domain associated with web app. + + Description for Lists ownership identifiers for domain associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IdentifierCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.IdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_domain_ownership_identifiers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_domain_ownership_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers'} # type: ignore + + def get_domain_ownership_identifier( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Identifier" + """Get domain ownership identifier for web app. + + Description for Get domain ownership identifier for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def create_or_update_domain_ownership_identifier( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + domain_ownership_identifier, # type: "_models.Identifier" + **kwargs # type: Any + ): + # type: (...) -> "_models.Identifier" + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_06_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def delete_domain_ownership_identifier( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a domain ownership identifier for a web app. + + Description for Deletes a domain ownership identifier for a web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def update_domain_ownership_identifier( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + domain_ownership_identifier, # type: "_models.Identifier" + **kwargs # type: Any + ): + # type: (...) -> "_models.Identifier" + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_06_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def get_ms_deploy_status( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MSDeployStatus" + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} # type: ignore + + def _create_ms_deploy_operation_initial( + self, + resource_group_name, # type: str + name, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MSDeployStatus"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployStatus"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_ms_deploy_operation_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201, 409]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_ms_deploy_operation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} # type: ignore + + def begin_create_ms_deploy_operation( + self, + resource_group_name, # type: str + name, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.MSDeployStatus"] + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2020_06_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_ms_deploy_operation_initial( + resource_group_name=resource_group_name, + name=name, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_ms_deploy_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} # type: ignore + + def get_ms_deploy_log( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MSDeployLog"] + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.MSDeployLog or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployLog"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_log.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log'} # type: ignore + + def list_functions( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.FunctionEnvelopeCollection"] + """List the functions for a web site, or a deployment slot. + + Description for List the functions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FunctionEnvelopeCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.FunctionEnvelopeCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelopeCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('FunctionEnvelopeCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions'} # type: ignore + + def get_functions_admin_token( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> str + """Fetch a short lived token that can be exchanged for a master key. + + Description for Fetch a short lived token that can be exchanged for a master key. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_functions_admin_token.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_functions_admin_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token'} # type: ignore + + def get_function( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.FunctionEnvelope"] + """Get function information by its ID for web site, or a deployment slot. + + Description for Get function information by its ID for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionEnvelope, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.FunctionEnvelope or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FunctionEnvelope"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_function.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + def _create_function_initial( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + function_envelope, # type: "_models.FunctionEnvelope" + **kwargs # type: Any + ): + # type: (...) -> "_models.FunctionEnvelope" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_function_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(function_envelope, 'FunctionEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_function_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + def begin_create_function( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + function_envelope, # type: "_models.FunctionEnvelope" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.FunctionEnvelope"] + """Create function for web site, or a deployment slot. + + Description for Create function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param function_envelope: Function details. + :type function_envelope: ~azure.mgmt.web.v2020_06_01.models.FunctionEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 FunctionEnvelope or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.FunctionEnvelope] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_function_initial( + resource_group_name=resource_group_name, + name=name, + function_name=function_name, + function_envelope=function_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + def delete_function( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a function for web site, or a deployment slot. + + Description for Delete a function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_function.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + def create_or_update_function_secret( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + key_name, # type: str + key, # type: "_models.KeyInfo" + **kwargs # type: Any + ): + # type: (...) -> "_models.KeyInfo" + """Add or update a function secret. + + Description for Add or update a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2020_06_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_function_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_function_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}'} # type: ignore + + def delete_function_secret( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + key_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a function secret. + + Description for Delete a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_function_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_function_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}'} # type: ignore + + def list_function_keys( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Get function keys for a function in a web site, or a deployment slot. + + Description for Get function keys for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_function_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listkeys'} # type: ignore + + def list_function_secrets( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FunctionSecrets" + """Get function secrets for a function in a web site, or a deployment slot. + + Description for Get function secrets for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_function_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets'} # type: ignore + + def list_host_keys( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HostKeys" + """Get host secrets for a function app. + + Description for Get host secrets for a function app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostKeys, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HostKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_host_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_host_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listkeys'} # type: ignore + + def list_sync_status( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + list_sync_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listsyncstatus'} # type: ignore + + def sync_functions( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.sync_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/sync'} # type: ignore + + def create_or_update_host_secret( + self, + resource_group_name, # type: str + name, # type: str + key_type, # type: str + key_name, # type: str + key, # type: "_models.KeyInfo" + **kwargs # type: Any + ): + # type: (...) -> "_models.KeyInfo" + """Add or update a host level secret. + + Description for Add or update a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2020_06_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}'} # type: ignore + + def delete_host_secret( + self, + resource_group_name, # type: str + name, # type: str + key_type, # type: str + key_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a host level secret. + + Description for Delete a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}'} # type: ignore + + def list_host_name_bindings( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.HostNameBindingCollection"] + """Get hostname bindings for an app or a deployment slot. + + Description for Get hostname bindings for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HostNameBindingCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.HostNameBindingCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBindingCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_host_name_bindings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('HostNameBindingCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_host_name_bindings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings'} # type: ignore + + def get_host_name_binding( + self, + resource_group_name, # type: str + name, # type: str + host_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HostNameBinding" + """Get the named hostname binding for an app (or deployment slot, if specified). + + Description for Get the named hostname binding for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_host_name_binding.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} # type: ignore + + def create_or_update_host_name_binding( + self, + resource_group_name, # type: str + name, # type: str + host_name, # type: str + host_name_binding, # type: "_models.HostNameBinding" + **kwargs # type: Any + ): + # type: (...) -> "_models.HostNameBinding" + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :param host_name_binding: Binding details. This is the JSON representation of a HostNameBinding + object. + :type host_name_binding: ~azure.mgmt.web.v2020_06_01.models.HostNameBinding + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_name_binding.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(host_name_binding, 'HostNameBinding') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} # type: ignore + + def delete_host_name_binding( + self, + resource_group_name, # type: str + name, # type: str + host_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_name_binding.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} # type: ignore + + def get_hybrid_connection( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def create_or_update_hybrid_connection( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + connection_envelope, # type: "_models.HybridConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def delete_hybrid_connection( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Removes a Hybrid Connection from this site. + + Description for Removes a Hybrid Connection from this site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def update_hybrid_connection( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + connection_envelope, # type: "_models.HybridConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def list_hybrid_connections( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Retrieves all Service Bus Hybrid Connections used by this Web App. + + Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_hybrid_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_hybrid_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays'} # type: ignore + + def list_relay_service_connections( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Gets hybrid connections configured for an app (or deployment slot, if specified). + + Description for Gets hybrid connections configured for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_relay_service_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_relay_service_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection'} # type: ignore + + def get_relay_service_connection( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Gets a hybrid connection configuration by its name. + + Description for Gets a hybrid connection configuration by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection. + :type entity_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + def create_or_update_relay_service_connection( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + connection_envelope, # type: "_models.RelayServiceConnectionEntity" + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + def delete_relay_service_connection( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a relay service connection by its name. + + Description for Deletes a relay service connection by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + def update_relay_service_connection( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + connection_envelope, # type: "_models.RelayServiceConnectionEntity" + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + def list_instance_identifiers( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppInstanceStatusCollection"] + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppInstanceStatusCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.WebAppInstanceStatusCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppInstanceStatusCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_identifiers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppInstanceStatusCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances'} # type: ignore + + def get_instance_info( + self, + resource_group_name, # type: str + name, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WebSiteInstanceStatus" + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param instance_id: + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebSiteInstanceStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.WebSiteInstanceStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebSiteInstanceStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_info.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebSiteInstanceStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}'} # type: ignore + + def get_instance_ms_deploy_status( + self, + resource_group_name, # type: str + name, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MSDeployStatus" + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + def _create_instance_ms_deploy_operation_initial( + self, + resource_group_name, # type: str + name, # type: str + instance_id, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MSDeployStatus"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployStatus"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_instance_ms_deploy_operation_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201, 409]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_instance_ms_deploy_operation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + def begin_create_instance_ms_deploy_operation( + self, + resource_group_name, # type: str + name, # type: str + instance_id, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.MSDeployStatus"] + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param instance_id: ID of web app instance. + :type instance_id: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2020_06_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_instance_ms_deploy_operation_initial( + resource_group_name=resource_group_name, + name=name, + instance_id=instance_id, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_instance_ms_deploy_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + def get_instance_ms_deploy_log( + self, + resource_group_name, # type: str + name, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MSDeployLog"] + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.MSDeployLog or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployLog"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_log.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log'} # type: ignore + + def list_instance_processes( + self, + resource_group_name, # type: str + name, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessInfoCollection"] + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_processes.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_processes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes'} # type: ignore + + def get_instance_process( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProcessInfo"] + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ProcessInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'} # type: ignore + + def delete_instance_process( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_instance_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_instance_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'} # type: ignore + + def get_instance_process_dump( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[IO] + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_dump.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_dump.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump'} # type: ignore + + def list_instance_process_modules( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessModuleInfoCollection"] + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessModuleInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_modules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_process_modules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules'} # type: ignore + + def get_instance_process_module( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + base_address, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProcessModuleInfo"] + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ProcessModuleInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessModuleInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_module.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_module.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_instance_process_threads( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessThreadInfoCollection"] + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessThreadInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_threads.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_process_threads.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads'} # type: ignore + + def is_cloneable( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteCloneability" + """Shows whether an app can be cloned to another resource group or subscription. + + Description for Shows whether an app can be cloned to another resource group or subscription. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteCloneability, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteCloneability + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteCloneability"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.is_cloneable.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteCloneability', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + is_cloneable.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable'} # type: ignore + + def list_site_backups( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BackupItemCollection"] + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_backups.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_backups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listbackups'} # type: ignore + + def list_sync_function_triggers( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FunctionSecrets" + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_function_triggers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_sync_function_triggers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus'} # type: ignore + + def _migrate_storage_initial( + self, + subscription_name, # type: str + resource_group_name, # type: str + name, # type: str + migration_options, # type: "_models.StorageMigrationOptions" + **kwargs # type: Any + ): + # type: (...) -> "_models.StorageMigrationResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageMigrationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._migrate_storage_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['subscriptionName'] = self._serialize.query("subscription_name", subscription_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(migration_options, 'StorageMigrationOptions') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageMigrationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _migrate_storage_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate'} # type: ignore + + def begin_migrate_storage( + self, + subscription_name, # type: str + resource_group_name, # type: str + name, # type: str + migration_options, # type: "_models.StorageMigrationOptions" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.StorageMigrationResponse"] + """Restores a web app. + + Description for Restores a web app. + + :param subscription_name: Azure subscription. + :type subscription_name: str + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param migration_options: Migration migrationOptions. + :type migration_options: ~azure.mgmt.web.v2020_06_01.models.StorageMigrationOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 StorageMigrationResponse or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.StorageMigrationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageMigrationResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._migrate_storage_initial( + subscription_name=subscription_name, + resource_group_name=resource_group_name, + name=name, + migration_options=migration_options, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageMigrationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_migrate_storage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate'} # type: ignore + + def _migrate_my_sql_initial( + self, + resource_group_name, # type: str + name, # type: str + migration_request_envelope, # type: "_models.MigrateMySqlRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.Operation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Operation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._migrate_my_sql_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(migration_request_envelope, 'MigrateMySqlRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Operation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _migrate_my_sql_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql'} # type: ignore + + def begin_migrate_my_sql( + self, + resource_group_name, # type: str + name, # type: str + migration_request_envelope, # type: "_models.MigrateMySqlRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Operation"] + """Migrates a local (in-app) MySql database to a remote MySql database. + + Description for Migrates a local (in-app) MySql database to a remote MySql database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param migration_request_envelope: MySql migration options. + :type migration_request_envelope: ~azure.mgmt.web.v2020_06_01.models.MigrateMySqlRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 Operation or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Operation"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._migrate_my_sql_initial( + resource_group_name=resource_group_name, + name=name, + migration_request_envelope=migration_request_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Operation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_migrate_my_sql.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql'} # type: ignore + + def get_migrate_my_sql_status( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MigrateMySqlStatus" + """Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. + + Description for Returns the status of MySql in app migration, if one is active, and whether or + not MySql in app is enabled. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MigrateMySqlStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.MigrateMySqlStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrateMySqlStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_migrate_my_sql_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MigrateMySqlStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_migrate_my_sql_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status'} # type: ignore + + def get_swift_virtual_network_connection( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SwiftVirtualNetwork" + """Gets a Swift Virtual Network connection. + + Description for Gets a Swift Virtual Network connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_swift_virtual_network_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + def create_or_update_swift_virtual_network_connection( + self, + resource_group_name, # type: str + name, # type: str + connection_envelope, # type: "_models.SwiftVirtualNetwork" + **kwargs # type: Any + ): + # type: (...) -> "_models.SwiftVirtualNetwork" + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_swift_virtual_network_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + def delete_swift_virtual_network( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a Swift Virtual Network connection from an app (or deployment slot). + + Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_swift_virtual_network.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_swift_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + def update_swift_virtual_network_connection( + self, + resource_group_name, # type: str + name, # type: str + connection_envelope, # type: "_models.SwiftVirtualNetwork" + **kwargs # type: Any + ): + # type: (...) -> "_models.SwiftVirtualNetwork" + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_swift_virtual_network_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + def list_network_features( + self, + resource_group_name, # type: str + name, # type: str + view, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.NetworkFeatures"] + """Gets all network features used by the app (or deployment slot, if specified). + + Description for Gets all network features used by the app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param view: The type of view. This can either be "summary" or "detailed". + :type view: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFeatures, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.NetworkFeatures or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NetworkFeatures"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_network_features.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'view': self._serialize.url("view", view, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('NetworkFeatures', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_network_features.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}'} # type: ignore + + def get_network_trace_operation( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}'} # type: ignore + + def start_web_site_network_trace( + self, + resource_group_name, # type: str + name, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> str + """Start capturing network packets for the site (To be deprecated). + + Description for Start capturing network packets for the site (To be deprecated). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.start_web_site_network_trace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + start_web_site_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start'} # type: ignore + + def _start_web_site_network_trace_operation_initial( + self, + resource_group_name, # type: str + name, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._start_web_site_network_trace_operation_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_web_site_network_trace_operation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation'} # type: ignore + + def begin_start_web_site_network_trace_operation( + self, + resource_group_name, # type: str + name, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[List["_models.NetworkTrace"]] + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_web_site_network_trace_operation_initial( + resource_group_name=resource_group_name, + name=name, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_web_site_network_trace_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation'} # type: ignore + + def stop_web_site_network_trace( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.stop_web_site_network_trace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_web_site_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop'} # type: ignore + + def get_network_traces( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}'} # type: ignore + + def get_network_trace_operation_v2( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}'} # type: ignore + + def get_network_traces_v2( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}'} # type: ignore + + def generate_new_site_publishing_password( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Generates a new publishing password for an app (or deployment slot, if specified). + + Description for Generates a new publishing password for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.generate_new_site_publishing_password.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + generate_new_site_publishing_password.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword'} # type: ignore + + def list_perf_mon_counters( + self, + resource_group_name, # type: str + name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PerfMonCounterCollection"] + """Gets perfmon counters for web app. + + Description for Gets perfmon counters for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z + and timeGrain eq duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PerfMonCounterCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.PerfMonCounterCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PerfMonCounterCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_perf_mon_counters.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PerfMonCounterCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_perf_mon_counters.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters'} # type: ignore + + def get_site_php_error_log_flag( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SitePhpErrorLogFlag" + """Gets web app's event logs. + + Description for Gets web app's event logs. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SitePhpErrorLogFlag, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SitePhpErrorLogFlag + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SitePhpErrorLogFlag"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_php_error_log_flag.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SitePhpErrorLogFlag', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_php_error_log_flag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging'} # type: ignore + + def list_premier_add_ons( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Gets the premier add-ons of an app. + + Description for Gets the premier add-ons of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_premier_add_ons.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_premier_add_ons.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons'} # type: ignore + + def get_premier_add_on( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Gets a named add-on of an app. + + Description for Gets a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + def add_premier_add_on( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + premier_add_on, # type: "_models.PremierAddOn" + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2020_06_01.models.PremierAddOn + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.add_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOn') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + add_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + def delete_premier_add_on( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a premier add-on from an app. + + Description for Delete a premier add-on from an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + def update_premier_add_on( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + premier_add_on, # type: "_models.PremierAddOnPatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2020_06_01.models.PremierAddOnPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOnPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + def get_private_access( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateAccess" + """Gets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Gets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_private_access.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'} # type: ignore + + def put_private_access_vnet( + self, + resource_group_name, # type: str + name, # type: str + access, # type: "_models.PrivateAccess" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateAccess" + """Sets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Sets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param access: The information for the private access. + :type access: ~azure.mgmt.web.v2020_06_01.models.PrivateAccess + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put_private_access_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(access, 'PrivateAccess') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_private_access_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'} # type: ignore + + def list_processes( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessInfoCollection"] + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_processes.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_processes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes'} # type: ignore + + def get_process( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProcessInfo"] + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ProcessInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'} # type: ignore + + def delete_process( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'} # type: ignore + + def get_process_dump( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[IO] + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_process_dump.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_dump.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump'} # type: ignore + + def list_process_modules( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessModuleInfoCollection"] + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessModuleInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_modules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_process_modules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules'} # type: ignore + + def get_process_module( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + base_address, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProcessModuleInfo"] + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ProcessModuleInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessModuleInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_process_module.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_module.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_process_threads( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessThreadInfoCollection"] + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessThreadInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_threads.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_process_threads.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads'} # type: ignore + + def list_public_certificates( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PublicCertificateCollection"] + """Get public certificates for an app or a deployment slot. + + Description for Get public certificates for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicCertificateCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.PublicCertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_public_certificates.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PublicCertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_public_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates'} # type: ignore + + def get_public_certificate( + self, + resource_group_name, # type: str + name, # type: str + public_certificate_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PublicCertificate" + """Get the named public certificate for an app (or deployment slot, if specified). + + Description for Get the named public certificate for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_public_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} # type: ignore + + def create_or_update_public_certificate( + self, + resource_group_name, # type: str + name, # type: str + public_certificate_name, # type: str + public_certificate, # type: "_models.PublicCertificate" + **kwargs # type: Any + ): + # type: (...) -> "_models.PublicCertificate" + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :param public_certificate: Public certificate details. This is the JSON representation of a + PublicCertificate object. + :type public_certificate: ~azure.mgmt.web.v2020_06_01.models.PublicCertificate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_public_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(public_certificate, 'PublicCertificate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} # type: ignore + + def delete_public_certificate( + self, + resource_group_name, # type: str + name, # type: str + public_certificate_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_public_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} # type: ignore + + def list_publishing_profile_xml_with_secrets( + self, + resource_group_name, # type: str + name, # type: str + publishing_profile_options, # type: "_models.CsmPublishingProfileOptions" + **kwargs # type: Any + ): + # type: (...) -> IO + """Gets the publishing profile for an app (or deployment slot, if specified). + + Description for Gets the publishing profile for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param publishing_profile_options: Specifies publishingProfileOptions for publishing profile. + For example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + :type publishing_profile_options: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingProfileOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/xml" + + # Construct URL + url = self.list_publishing_profile_xml_with_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(publishing_profile_options, 'CsmPublishingProfileOptions') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_publishing_profile_xml_with_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml'} # type: ignore + + def reset_production_slot_config( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Resets the configuration settings of the current slot if they were previously modified by calling the API with POST. + + Description for Resets the configuration settings of the current slot if they were previously + modified by calling the API with POST. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.reset_production_slot_config.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_production_slot_config.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig'} # type: ignore + + def restart( + self, + resource_group_name, # type: str + name, # type: str + soft_restart=None, # type: Optional[bool] + synchronous=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + """Restarts an app (or deployment slot, if specified). + + Description for Restarts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param soft_restart: Specify true to apply the configuration settings and restarts the app only + if necessary. By default, the API always restarts and reprovisions the app. + :type soft_restart: bool + :param synchronous: Specify true to block until the app is restarted. By default, it is set to + false, and the API responds immediately (asynchronous). + :type synchronous: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.restart.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if soft_restart is not None: + query_parameters['softRestart'] = self._serialize.query("soft_restart", soft_restart, 'bool') + if synchronous is not None: + query_parameters['synchronous'] = self._serialize.query("synchronous", synchronous, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart'} # type: ignore + + def _restore_from_backup_blob_initial( + self, + resource_group_name, # type: str + name, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_backup_blob_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_backup_blob_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob'} # type: ignore + + def begin_restore_from_backup_blob( + self, + resource_group_name, # type: str + name, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores an app from a backup blob in Azure Storage. + + Description for Restores an app from a backup blob in Azure Storage. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2020_06_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_from_backup_blob_initial( + resource_group_name=resource_group_name, + name=name, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_backup_blob.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob'} # type: ignore + + def _restore_from_deleted_app_initial( + self, + resource_group_name, # type: str + name, # type: str + restore_request, # type: "_models.DeletedAppRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_deleted_app_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'DeletedAppRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_deleted_app_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp'} # type: ignore + + def begin_restore_from_deleted_app( + self, + resource_group_name, # type: str + name, # type: str + restore_request, # type: "_models.DeletedAppRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores a deleted web app to this web app. + + Description for Restores a deleted web app to this web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param restore_request: Deleted web app restore information. + :type restore_request: ~azure.mgmt.web.v2020_06_01.models.DeletedAppRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_from_deleted_app_initial( + resource_group_name=resource_group_name, + name=name, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_deleted_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp'} # type: ignore + + def _restore_snapshot_initial( + self, + resource_group_name, # type: str + name, # type: str + restore_request, # type: "_models.SnapshotRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_snapshot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'SnapshotRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_snapshot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot'} # type: ignore + + def begin_restore_snapshot( + self, + resource_group_name, # type: str + name, # type: str + restore_request, # type: "_models.SnapshotRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores a web app from a snapshot. + + Description for Restores a web app from a snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param restore_request: Snapshot restore settings. Snapshot information can be obtained by + calling GetDeletedSites or GetSiteSnapshots API. + :type restore_request: ~azure.mgmt.web.v2020_06_01.models.SnapshotRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_snapshot_initial( + resource_group_name=resource_group_name, + name=name, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot'} # type: ignore + + def list_site_extensions( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteExtensionInfoCollection"] + """Get list of siteextensions for a web site, or a deployment slot. + + Description for Get list of siteextensions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteExtensionInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.SiteExtensionInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_extensions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_extensions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions'} # type: ignore + + def get_site_extension( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.SiteExtensionInfo"] + """Get site extension information by its ID for a web site, or a deployment slot. + + Description for Get site extension information by its ID for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteExtensionInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteExtensionInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SiteExtensionInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_extension.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + def _install_site_extension_initial( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.SiteExtensionInfo"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SiteExtensionInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._install_site_extension_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 429]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _install_site_extension_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + def begin_install_site_extension( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SiteExtensionInfo"] + """Install site extension on a web site, or a deployment slot. + + Description for Install site extension on a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 SiteExtensionInfo or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.SiteExtensionInfo] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfo"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._install_site_extension_initial( + resource_group_name=resource_group_name, + name=name, + site_extension_id=site_extension_id, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + def delete_site_extension( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Remove a site extension from a web site, or a deployment slot. + + Description for Remove a site extension from a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_site_extension.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + def _copy_production_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + copy_slot_entity, # type: "_models.CsmCopySlotEntity" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._copy_production_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(copy_slot_entity, 'CsmCopySlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _copy_production_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotcopy'} # type: ignore + + def begin_copy_production_slot( + self, + resource_group_name, # type: str + name, # type: str + copy_slot_entity, # type: "_models.CsmCopySlotEntity" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Copies a deployment slot to another deployment slot of an app. + + Description for Copies a deployment slot to another deployment slot of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param copy_slot_entity: JSON object that contains the target slot name and site config + properties to override the source slot config. See example. + :type copy_slot_entity: ~azure.mgmt.web.v2020_06_01.models.CsmCopySlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._copy_production_slot_initial( + resource_group_name=resource_group_name, + name=name, + copy_slot_entity=copy_slot_entity, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_copy_production_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotcopy'} # type: ignore + + def list_slots( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppCollection"] + """Gets an app's deployment slots. + + Description for Gets an app's deployment slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_slots.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_slots.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots'} # type: ignore + + def get_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Site"] + """Gets the details of a web, mobile, or API app. + + Description for Gets the details of a web, mobile, or API app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. By default, this API returns the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Site or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Site"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + def _create_or_update_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_envelope, # type: "_models.Site" + **kwargs # type: Any + ): + # type: (...) -> "_models.Site" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'Site') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + def begin_create_or_update_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_envelope, # type: "_models.Site" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Site"] + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param slot: Name of the deployment slot to create or update. By default, this API attempts to + create or modify the production slot. + :type slot: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2020_06_01.models.Site + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 Site or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + site_envelope=site_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + def delete_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + delete_metrics=None, # type: Optional[bool] + delete_empty_server_farm=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a web, mobile, or API app, or one of the deployment slots. + + Description for Deletes a web, mobile, or API app, or one of the deployment slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app to delete. + :type name: str + :param slot: Name of the deployment slot to delete. By default, the API deletes the production + slot. + :type slot: str + :param delete_metrics: If true, web app metrics are also deleted. + :type delete_metrics: bool + :param delete_empty_server_farm: Specify true if the App Service plan will be empty after app + deletion and you want to delete the empty App Service plan. By default, the empty App Service + plan is not deleted. + :type delete_empty_server_farm: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if delete_metrics is not None: + query_parameters['deleteMetrics'] = self._serialize.query("delete_metrics", delete_metrics, 'bool') + if delete_empty_server_farm is not None: + query_parameters['deleteEmptyServerFarm'] = self._serialize.query("delete_empty_server_farm", delete_empty_server_farm, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + def update_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_envelope, # type: "_models.SitePatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.Site" + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param slot: Name of the deployment slot to create or update. By default, this API attempts to + create or modify the production slot. + :type slot: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2020_06_01.models.SitePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Site + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'SitePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + def analyze_custom_hostname_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + host_name=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.CustomHostnameAnalysisResult" + """Analyze a custom hostname. + + Description for Analyze a custom hostname. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param host_name: Custom hostname. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CustomHostnameAnalysisResult, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.CustomHostnameAnalysisResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomHostnameAnalysisResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.analyze_custom_hostname_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if host_name is not None: + query_parameters['hostName'] = self._serialize.query("host_name", host_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CustomHostnameAnalysisResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + analyze_custom_hostname_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/analyzeCustomHostname'} # type: ignore + + def apply_slot_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> None + """Applies the configuration settings from the target slot onto the current slot. + + Description for Applies the configuration settings from the target slot onto the current slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_06_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.apply_slot_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + apply_slot_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig'} # type: ignore + + def backup_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + request, # type: "_models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupItem" + """Creates a backup of an app. + + Description for Creates a backup of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create a + backup for the production slot. + :type slot: str + :param request: Backup configuration. You can use the JSON response from the POST action as + input here. + :type request: ~azure.mgmt.web.v2020_06_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.backup_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup'} # type: ignore + + def list_backups_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BackupItemCollection"] + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get backups + of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_backups_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_backups_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups'} # type: ignore + + def get_backup_status_slot( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupItem" + """Gets a backup of an app by its ID. + + Description for Gets a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a backup + of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}'} # type: ignore + + def delete_backup_slot( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a backup of an app by its ID. + + Description for Deletes a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete a + backup of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}'} # type: ignore + + def list_backup_status_secrets_slot( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + slot, # type: str + request, # type: "_models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupItem" + """Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + + Description for Gets status of a web app backup that may be in progress, including secrets + associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the + SAS URL for the backup if a new URL is passed in the request body. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param backup_id: ID of backup. + :type backup_id: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param request: Information on backup request. + :type request: ~azure.mgmt.web.v2020_06_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_backup_status_secrets_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_backup_status_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list'} # type: ignore + + def _restore_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + slot, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore'} # type: ignore + + def begin_restore_slot( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + slot, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores a specific backup to another app (or deployment slot, if specified). + + Description for Restores a specific backup to another app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will restore a + backup of the production slot. + :type slot: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2020_06_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_slot_initial( + resource_group_name=resource_group_name, + name=name, + backup_id=backup_id, + slot=slot, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore'} # type: ignore + + def list_configurations_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteConfigResourceCollection"] + """List the configurations of an app. + + Description for List the configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigResourceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.SiteConfigResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configurations_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_configurations_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config'} # type: ignore + + def update_application_settings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + app_settings, # type: "_models.StringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Replaces the application settings of an app. + + Description for Replaces the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + application settings for the production slot. + :type slot: str + :param app_settings: Application settings of the app. + :type app_settings: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_application_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_application_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings'} # type: ignore + + def list_application_settings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Gets the application settings of an app. + + Description for Gets the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + application settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_application_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_application_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list'} # type: ignore + + def update_auth_settings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_auth_settings, # type: "_models.SiteAuthSettings" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettings" + """Updates the Authentication / Authorization settings associated with web app. + + Description for Updates the Authentication / Authorization settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param site_auth_settings: Auth settings associated with web app. + :type site_auth_settings: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings, 'SiteAuthSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings'} # type: ignore + + def get_auth_settings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettings" + """Gets the Authentication/Authorization settings of an app. + + Description for Gets the Authentication/Authorization settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list'} # type: ignore + + def update_auth_settings_v2_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_auth_settings_v2, # type: "_models.SiteAuthSettingsV2" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettingsV2" + """Updates site's Authentication / Authorization settings for apps via the V2 format. + + Description for Updates site's Authentication / Authorization settings for apps via the V2 + format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param site_auth_settings_v2: Auth settings associated with web app. + :type site_auth_settings_v2: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettingsV2 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings_v2_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings_v2, 'SiteAuthSettingsV2') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings_v2_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2'} # type: ignore + + def get_auth_settings_v2_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettingsV2" + """Gets site's Authentication / Authorization settings for apps via the V2 format. + + Description for Gets site's Authentication / Authorization settings for apps via the V2 format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings_v2_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings_v2_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2/list'} # type: ignore + + def update_azure_storage_accounts_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + azure_storage_accounts, # type: "_models.AzureStoragePropertyDictionaryResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AzureStoragePropertyDictionaryResource" + """Updates the Azure storage account configurations of an app. + + Description for Updates the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + Azure storage account configurations for the production slot. + :type slot: str + :param azure_storage_accounts: Azure storage accounts of the app. + :type azure_storage_accounts: ~azure.mgmt.web.v2020_06_01.models.AzureStoragePropertyDictionaryResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_azure_storage_accounts_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(azure_storage_accounts, 'AzureStoragePropertyDictionaryResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_azure_storage_accounts_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts'} # type: ignore + + def list_azure_storage_accounts_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AzureStoragePropertyDictionaryResource" + """Gets the Azure storage account configurations of an app. + + Description for Gets the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + Azure storage account configurations for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_azure_storage_accounts_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_azure_storage_accounts_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts/list'} # type: ignore + + def update_backup_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + request, # type: "_models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupRequest" + """Updates the backup configuration of an app. + + Description for Updates the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + backup configuration for the production slot. + :type slot: str + :param request: Edited backup configuration. + :type request: ~azure.mgmt.web.v2020_06_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_backup_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup'} # type: ignore + + def delete_backup_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the backup configuration of an app. + + Description for Deletes the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + backup configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup'} # type: ignore + + def get_backup_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupRequest" + """Gets the backup configuration of an app. + + Description for Gets the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + backup configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list'} # type: ignore + + def update_connection_strings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + connection_strings, # type: "_models.ConnectionStringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.ConnectionStringDictionary" + """Replaces the connection strings of an app. + + Description for Replaces the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + connection settings for the production slot. + :type slot: str + :param connection_strings: Connection strings of the app or deployment slot. See example. + :type connection_strings: ~azure.mgmt.web.v2020_06_01.models.ConnectionStringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_connection_strings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_strings, 'ConnectionStringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_connection_strings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings'} # type: ignore + + def list_connection_strings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ConnectionStringDictionary" + """Gets the connection strings of an app. + + Description for Gets the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + connection settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_connection_strings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_connection_strings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list'} # type: ignore + + def get_diagnostic_logs_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteLogsConfig" + """Gets the logging configuration of an app. + + Description for Gets the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + logging configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostic_logs_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostic_logs_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs'} # type: ignore + + def update_diagnostic_logs_config_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_logs_config, # type: "_models.SiteLogsConfig" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteLogsConfig" + """Updates the logging configuration of an app. + + Description for Updates the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + logging configuration for the production slot. + :type slot: str + :param site_logs_config: A SiteLogsConfig JSON object that contains the logging configuration + to change in the "properties" property. + :type site_logs_config: ~azure.mgmt.web.v2020_06_01.models.SiteLogsConfig + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_diagnostic_logs_config_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_logs_config, 'SiteLogsConfig') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_diagnostic_logs_config_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs'} # type: ignore + + def update_metadata_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + metadata, # type: "_models.StringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Replaces the metadata of an app. + + Description for Replaces the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + metadata for the production slot. + :type slot: str + :param metadata: Edited metadata of the app or deployment slot. See example. + :type metadata: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_metadata_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(metadata, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_metadata_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata'} # type: ignore + + def list_metadata_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Gets the metadata of an app. + + Description for Gets the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + metadata for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_metadata_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_metadata_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list'} # type: ignore + + def _list_publishing_credentials_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.User" + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._list_publishing_credentials_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_publishing_credentials_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list'} # type: ignore + + def begin_list_publishing_credentials_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.User"] + """Gets the Git/FTP publishing credentials of an app. + + Description for Gets the Git/FTP publishing credentials of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + publishing credentials for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 User or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._list_publishing_credentials_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_publishing_credentials_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list'} # type: ignore + + def update_site_push_settings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + push_settings, # type: "_models.PushSettings" + **kwargs # type: Any + ): + # type: (...) -> "_models.PushSettings" + """Updates the Push settings associated with web app. + + Description for Updates the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param push_settings: Push settings associated with web app. + :type push_settings: ~azure.mgmt.web.v2020_06_01.models.PushSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_site_push_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(push_settings, 'PushSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_site_push_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings'} # type: ignore + + def list_site_push_settings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PushSettings" + """Gets the Push settings associated with web app. + + Description for Gets the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_site_push_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_site_push_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings/list'} # type: ignore + + def get_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, Always On, etc. + + Description for Gets the configuration of an app, such as platform version and bitness, default + documents, virtual applications, Always On, etc. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} # type: ignore + + def create_or_update_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_config, # type: "_models.SiteConfigResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update + configuration for the production slot. + :type slot: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} # type: ignore + + def update_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_config, # type: "_models.SiteConfigResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update + configuration for the production slot. + :type slot: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} # type: ignore + + def list_configuration_snapshot_info_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteConfigurationSnapshotInfoCollection"] + """Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. + + Description for Gets a list of web app configuration snapshots identifiers. Each element of the + list contains a timestamp and the ID of the snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigurationSnapshotInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.SiteConfigurationSnapshotInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigurationSnapshotInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configuration_snapshot_info_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigurationSnapshotInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_configuration_snapshot_info_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots'} # type: ignore + + def get_configuration_snapshot_slot( + self, + resource_group_name, # type: str + name, # type: str + snapshot_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Gets a snapshot of the configuration of an app at a previous point in time. + + Description for Gets a snapshot of the configuration of an app at a previous point in time. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration_snapshot_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}'} # type: ignore + + def recover_site_configuration_snapshot_slot( + self, + resource_group_name, # type: str + name, # type: str + snapshot_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Reverts the configuration of an app to a previous snapshot. + + Description for Reverts the configuration of an app to a previous snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.recover_site_configuration_snapshot_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + recover_site_configuration_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}/recover'} # type: ignore + + def get_web_site_container_logs_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[IO] + """Gets the last lines of docker logs for the given site. + + Description for Gets the last lines of docker logs for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/octet-stream" + + # Construct URL + url = self.get_web_site_container_logs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_site_container_logs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs'} # type: ignore + + def get_container_logs_zip_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[IO] + """Gets the ZIP archived docker log files for the given site. + + Description for Gets the ZIP archived docker log files for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/zip" + + # Construct URL + url = self.get_container_logs_zip_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_container_logs_zip_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download'} # type: ignore + + def list_continuous_web_jobs_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ContinuousWebJobCollection"] + """List continuous web jobs for an app, or a deployment slot. + + Description for List continuous web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ContinuousWebJobCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ContinuousWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContinuousWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_continuous_web_jobs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ContinuousWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_continuous_web_jobs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs'} # type: ignore + + def get_continuous_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ContinuousWebJob"] + """Gets a continuous web job by its ID for an app, or a deployment slot. + + Description for Gets a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ContinuousWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ContinuousWebJob or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ContinuousWebJob"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ContinuousWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}'} # type: ignore + + def delete_continuous_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a continuous web job by its ID for an app, or a deployment slot. + + Description for Delete a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}'} # type: ignore + + def start_continuous_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Start a continuous web job for an app, or a deployment slot. + + Description for Start a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.start_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/start'} # type: ignore + + def stop_continuous_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stop a continuous web job for an app, or a deployment slot. + + Description for Stop a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.stop_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/stop'} # type: ignore + + def list_deployments_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DeploymentCollection"] + """List deployments for an app, or a deployment slot. + + Description for List deployments for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeploymentCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.DeploymentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_deployments_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DeploymentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_deployments_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments'} # type: ignore + + def get_deployment_slot( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Deployment" + """Get a deployment by its ID for an app, or a deployment slot. + + Description for Get a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets a deployment + for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_deployment_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} # type: ignore + + def create_deployment_slot( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + slot, # type: str + deployment, # type: "_models.Deployment" + **kwargs # type: Any + ): + # type: (...) -> "_models.Deployment" + """Create a deployment for an app, or a deployment slot. + + Description for Create a deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: ID of an existing deployment. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API creates a + deployment for the production slot. + :type slot: str + :param deployment: Deployment details. + :type deployment: ~azure.mgmt.web.v2020_06_01.models.Deployment + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_deployment_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(deployment, 'Deployment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} # type: ignore + + def delete_deployment_slot( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a deployment by its ID for an app, or a deployment slot. + + Description for Delete a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_deployment_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} # type: ignore + + def list_deployment_log_slot( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Deployment" + """List deployment log for specific deployment for an app, or a deployment slot. + + Description for List deployment log for specific deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: The ID of a specific deployment. This is the value of the name property in the JSON + response from "GET /api/sites/{siteName}/deployments". + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_deployment_log_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_deployment_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log'} # type: ignore + + def discover_backup_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.RestoreRequest" + """Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information about the databases stored in a backup. + + Description for Discovers an existing app backup that can be restored from a blob in Azure + storage. Use this to get information about the databases stored in a backup. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will perform + discovery for the production slot. + :type slot: str + :param request: A RestoreRequest object that includes Azure storage URL and blog name for + discovery of backup. + :type request: ~azure.mgmt.web.v2020_06_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RestoreRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RestoreRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestoreRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.discover_backup_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RestoreRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + discover_backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/discoverbackup'} # type: ignore + + def list_domain_ownership_identifiers_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.IdentifierCollection"] + """Lists ownership identifiers for domain associated with web app. + + Description for Lists ownership identifiers for domain associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IdentifierCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.IdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_domain_ownership_identifiers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_domain_ownership_identifiers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers'} # type: ignore + + def get_domain_ownership_identifier_slot( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Identifier" + """Get domain ownership identifier for web app. + + Description for Get domain ownership identifier for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def create_or_update_domain_ownership_identifier_slot( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + slot, # type: str + domain_ownership_identifier, # type: "_models.Identifier" + **kwargs # type: Any + ): + # type: (...) -> "_models.Identifier" + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_06_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def delete_domain_ownership_identifier_slot( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a domain ownership identifier for a web app. + + Description for Deletes a domain ownership identifier for a web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def update_domain_ownership_identifier_slot( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + slot, # type: str + domain_ownership_identifier, # type: "_models.Identifier" + **kwargs # type: Any + ): + # type: (...) -> "_models.Identifier" + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_06_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def get_ms_deploy_status_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MSDeployStatus" + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} # type: ignore + + def _create_ms_deploy_operation_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MSDeployStatus"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployStatus"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_ms_deploy_operation_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201, 409]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_ms_deploy_operation_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} # type: ignore + + def begin_create_ms_deploy_operation_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.MSDeployStatus"] + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2020_06_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_ms_deploy_operation_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_ms_deploy_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} # type: ignore + + def get_ms_deploy_log_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MSDeployLog"] + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.MSDeployLog or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployLog"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_log_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log'} # type: ignore + + def list_instance_functions_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.FunctionEnvelopeCollection"] + """List the functions for a web site, or a deployment slot. + + Description for List the functions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FunctionEnvelopeCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.FunctionEnvelopeCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelopeCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_functions_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('FunctionEnvelopeCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_functions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions'} # type: ignore + + def get_functions_admin_token_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> str + """Fetch a short lived token that can be exchanged for a master key. + + Description for Fetch a short lived token that can be exchanged for a master key. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_functions_admin_token_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_functions_admin_token_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/admin/token'} # type: ignore + + def get_instance_function_slot( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.FunctionEnvelope"] + """Get function information by its ID for web site, or a deployment slot. + + Description for Get function information by its ID for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionEnvelope, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.FunctionEnvelope or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FunctionEnvelope"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_function_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + def _create_instance_function_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + slot, # type: str + function_envelope, # type: "_models.FunctionEnvelope" + **kwargs # type: Any + ): + # type: (...) -> "_models.FunctionEnvelope" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_instance_function_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(function_envelope, 'FunctionEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_instance_function_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + def begin_create_instance_function_slot( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + slot, # type: str + function_envelope, # type: "_models.FunctionEnvelope" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.FunctionEnvelope"] + """Create function for web site, or a deployment slot. + + Description for Create function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :param function_envelope: Function details. + :type function_envelope: ~azure.mgmt.web.v2020_06_01.models.FunctionEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 FunctionEnvelope or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.FunctionEnvelope] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_instance_function_slot_initial( + resource_group_name=resource_group_name, + name=name, + function_name=function_name, + slot=slot, + function_envelope=function_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + def delete_instance_function_slot( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a function for web site, or a deployment slot. + + Description for Delete a function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_instance_function_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + def create_or_update_function_secret_slot( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + key_name, # type: str + slot, # type: str + key, # type: "_models.KeyInfo" + **kwargs # type: Any + ): + # type: (...) -> "_models.KeyInfo" + """Add or update a function secret. + + Description for Add or update a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2020_06_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_function_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_function_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}'} # type: ignore + + def delete_function_secret_slot( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + key_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a function secret. + + Description for Delete a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_function_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_function_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}'} # type: ignore + + def list_function_keys_slot( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Get function keys for a function in a web site, or a deployment slot. + + Description for Get function keys for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_function_keys_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_keys_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listkeys'} # type: ignore + + def list_function_secrets_slot( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FunctionSecrets" + """Get function secrets for a function in a web site, or a deployment slot. + + Description for Get function secrets for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_function_secrets_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets'} # type: ignore + + def list_host_keys_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HostKeys" + """Get host secrets for a function app. + + Description for Get host secrets for a function app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostKeys, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HostKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_host_keys_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_host_keys_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listkeys'} # type: ignore + + def list_sync_status_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + list_sync_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listsyncstatus'} # type: ignore + + def sync_functions_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.sync_functions_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_functions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/sync'} # type: ignore + + def create_or_update_host_secret_slot( + self, + resource_group_name, # type: str + name, # type: str + key_type, # type: str + key_name, # type: str + slot, # type: str + key, # type: "_models.KeyInfo" + **kwargs # type: Any + ): + # type: (...) -> "_models.KeyInfo" + """Add or update a host level secret. + + Description for Add or update a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2020_06_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}'} # type: ignore + + def delete_host_secret_slot( + self, + resource_group_name, # type: str + name, # type: str + key_type, # type: str + key_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a host level secret. + + Description for Delete a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}'} # type: ignore + + def list_host_name_bindings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.HostNameBindingCollection"] + """Get hostname bindings for an app or a deployment slot. + + Description for Get hostname bindings for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets hostname + bindings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HostNameBindingCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.HostNameBindingCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBindingCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_host_name_bindings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('HostNameBindingCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_host_name_bindings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings'} # type: ignore + + def get_host_name_binding_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + host_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HostNameBinding" + """Get the named hostname binding for an app (or deployment slot, if specified). + + Description for Get the named hostname binding for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API the named binding + for the production slot. + :type slot: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_host_name_binding_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} # type: ignore + + def create_or_update_host_name_binding_slot( + self, + resource_group_name, # type: str + name, # type: str + host_name, # type: str + slot, # type: str + host_name_binding, # type: "_models.HostNameBinding" + **kwargs # type: Any + ): + # type: (...) -> "_models.HostNameBinding" + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create a + binding for the production slot. + :type slot: str + :param host_name_binding: Binding details. This is the JSON representation of a HostNameBinding + object. + :type host_name_binding: ~azure.mgmt.web.v2020_06_01.models.HostNameBinding + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_name_binding_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(host_name_binding, 'HostNameBinding') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} # type: ignore + + def delete_host_name_binding_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + host_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_name_binding_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} # type: ignore + + def get_hybrid_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def create_or_update_hybrid_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.HybridConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def delete_hybrid_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Removes a Hybrid Connection from this site. + + Description for Removes a Hybrid Connection from this site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def update_hybrid_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.HybridConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def list_hybrid_connections_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Retrieves all Service Bus Hybrid Connections used by this Web App. + + Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_hybrid_connections_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_hybrid_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays'} # type: ignore + + def list_relay_service_connections_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Gets hybrid connections configured for an app (or deployment slot, if specified). + + Description for Gets hybrid connections configured for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get hybrid + connections for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_relay_service_connections_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_relay_service_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection'} # type: ignore + + def get_relay_service_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Gets a hybrid connection configuration by its name. + + Description for Gets a hybrid connection configuration by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a hybrid + connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + def create_or_update_relay_service_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.RelayServiceConnectionEntity" + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create or + update a hybrid connection for the production slot. + :type slot: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + def delete_relay_service_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a relay service connection by its name. + + Description for Deletes a relay service connection by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete a + hybrid connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + def update_relay_service_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.RelayServiceConnectionEntity" + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create or + update a hybrid connection for the production slot. + :type slot: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + def list_instance_identifiers_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppInstanceStatusCollection"] + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets the + production slot instances. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppInstanceStatusCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.WebAppInstanceStatusCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppInstanceStatusCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_identifiers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppInstanceStatusCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_identifiers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances'} # type: ignore + + def get_instance_info_slot( + self, + resource_group_name, # type: str + name, # type: str + instance_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WebSiteInstanceStatus" + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param instance_id: + :type instance_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets the + production slot instances. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebSiteInstanceStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.WebSiteInstanceStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebSiteInstanceStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_info_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebSiteInstanceStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_info_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}'} # type: ignore + + def get_instance_ms_deploy_status_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MSDeployStatus" + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + def _create_instance_ms_deploy_operation_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + instance_id, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MSDeployStatus"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployStatus"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_instance_ms_deploy_operation_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201, 409]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_instance_ms_deploy_operation_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + def begin_create_instance_ms_deploy_operation_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + instance_id, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.MSDeployStatus"] + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param instance_id: ID of web app instance. + :type instance_id: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2020_06_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_instance_ms_deploy_operation_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + instance_id=instance_id, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_instance_ms_deploy_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + def get_instance_ms_deploy_log_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MSDeployLog"] + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.MSDeployLog or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployLog"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_log_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log'} # type: ignore + + def list_instance_processes_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessInfoCollection"] + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_processes_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_processes_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes'} # type: ignore + + def get_instance_process_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProcessInfo"] + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ProcessInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'} # type: ignore + + def delete_instance_process_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_instance_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_instance_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'} # type: ignore + + def get_instance_process_dump_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[IO] + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_dump_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_dump_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump'} # type: ignore + + def list_instance_process_modules_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessModuleInfoCollection"] + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessModuleInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_modules_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_process_modules_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules'} # type: ignore + + def get_instance_process_module_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + base_address, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProcessModuleInfo"] + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ProcessModuleInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessModuleInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_module_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_module_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_instance_process_threads_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessThreadInfoCollection"] + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessThreadInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_threads_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_process_threads_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads'} # type: ignore + + def is_cloneable_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteCloneability" + """Shows whether an app can be cloned to another resource group or subscription. + + Description for Shows whether an app can be cloned to another resource group or subscription. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. By default, this API returns information on the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteCloneability, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteCloneability + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteCloneability"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.is_cloneable_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteCloneability', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + is_cloneable_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable'} # type: ignore + + def list_site_backups_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BackupItemCollection"] + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get backups + of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_backups_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_backups_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listbackups'} # type: ignore + + def list_sync_function_triggers_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FunctionSecrets" + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_function_triggers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_sync_function_triggers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus'} # type: ignore + + def get_migrate_my_sql_status_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MigrateMySqlStatus" + """Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. + + Description for Returns the status of MySql in app migration, if one is active, and whether or + not MySql in app is enabled. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MigrateMySqlStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.MigrateMySqlStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrateMySqlStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_migrate_my_sql_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MigrateMySqlStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_migrate_my_sql_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status'} # type: ignore + + def get_swift_virtual_network_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SwiftVirtualNetwork" + """Gets a Swift Virtual Network connection. + + Description for Gets a Swift Virtual Network connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a + gateway for the production slot's Virtual Network. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_swift_virtual_network_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_swift_virtual_network_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + def create_or_update_swift_virtual_network_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + connection_envelope, # type: "_models.SwiftVirtualNetwork" + **kwargs # type: Any + ): + # type: (...) -> "_models.SwiftVirtualNetwork" + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_swift_virtual_network_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_swift_virtual_network_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + def delete_swift_virtual_network_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a Swift Virtual Network connection from an app (or deployment slot). + + Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_swift_virtual_network_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_swift_virtual_network_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + def update_swift_virtual_network_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + connection_envelope, # type: "_models.SwiftVirtualNetwork" + **kwargs # type: Any + ): + # type: (...) -> "_models.SwiftVirtualNetwork" + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_swift_virtual_network_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_swift_virtual_network_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + def list_network_features_slot( + self, + resource_group_name, # type: str + name, # type: str + view, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.NetworkFeatures"] + """Gets all network features used by the app (or deployment slot, if specified). + + Description for Gets all network features used by the app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param view: The type of view. This can either be "summary" or "detailed". + :type view: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get network + features for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFeatures, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.NetworkFeatures or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NetworkFeatures"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_network_features_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'view': self._serialize.url("view", view, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('NetworkFeatures', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_network_features_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkFeatures/{view}'} # type: ignore + + def get_network_trace_operation_slot( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/operationresults/{operationId}'} # type: ignore + + def start_web_site_network_trace_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> str + """Start capturing network packets for the site (To be deprecated). + + Description for Start capturing network packets for the site (To be deprecated). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.start_web_site_network_trace_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + start_web_site_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/start'} # type: ignore + + def _start_web_site_network_trace_operation_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._start_web_site_network_trace_operation_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_web_site_network_trace_operation_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation'} # type: ignore + + def begin_start_web_site_network_trace_operation_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[List["_models.NetworkTrace"]] + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_web_site_network_trace_operation_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_web_site_network_trace_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation'} # type: ignore + + def stop_web_site_network_trace_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.stop_web_site_network_trace_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_web_site_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/stop'} # type: ignore + + def get_network_traces_slot( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/{operationId}'} # type: ignore + + def get_network_trace_operation_slot_v2( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation_slot_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation_slot_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/current/operationresults/{operationId}'} # type: ignore + + def get_network_traces_slot_v2( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces_slot_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces_slot_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/{operationId}'} # type: ignore + + def generate_new_site_publishing_password_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Generates a new publishing password for an app (or deployment slot, if specified). + + Description for Generates a new publishing password for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API generate a new + publishing password for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.generate_new_site_publishing_password_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + generate_new_site_publishing_password_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword'} # type: ignore + + def list_perf_mon_counters_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PerfMonCounterCollection"] + """Gets perfmon counters for web app. + + Description for Gets perfmon counters for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z + and timeGrain eq duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PerfMonCounterCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.PerfMonCounterCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PerfMonCounterCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_perf_mon_counters_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PerfMonCounterCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_perf_mon_counters_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/perfcounters'} # type: ignore + + def get_site_php_error_log_flag_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SitePhpErrorLogFlag" + """Gets web app's event logs. + + Description for Gets web app's event logs. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SitePhpErrorLogFlag, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SitePhpErrorLogFlag + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SitePhpErrorLogFlag"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_php_error_log_flag_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SitePhpErrorLogFlag', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_php_error_log_flag_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging'} # type: ignore + + def list_premier_add_ons_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Gets the premier add-ons of an app. + + Description for Gets the premier add-ons of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + premier add-ons for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_premier_add_ons_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_premier_add_ons_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons'} # type: ignore + + def get_premier_add_on_slot( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Gets a named add-on of an app. + + Description for Gets a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + named add-on for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + def add_premier_add_on_slot( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + slot, # type: str + premier_add_on, # type: "_models.PremierAddOn" + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + named add-on for the production slot. + :type slot: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2020_06_01.models.PremierAddOn + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.add_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOn') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + add_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + def delete_premier_add_on_slot( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a premier add-on from an app. + + Description for Delete a premier add-on from an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + named add-on for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + def update_premier_add_on_slot( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + slot, # type: str + premier_add_on, # type: "_models.PremierAddOnPatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + named add-on for the production slot. + :type slot: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2020_06_01.models.PremierAddOnPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOnPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + def get_private_access_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateAccess" + """Gets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Gets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_private_access_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_access_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks'} # type: ignore + + def put_private_access_vnet_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + access, # type: "_models.PrivateAccess" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateAccess" + """Sets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Sets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for the web app. + :type slot: str + :param access: The information for the private access. + :type access: ~azure.mgmt.web.v2020_06_01.models.PrivateAccess + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put_private_access_vnet_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(access, 'PrivateAccess') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_private_access_vnet_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks'} # type: ignore + + def get_private_endpoint_connection( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnectionResource" + """Gets a private endpoint connection. + + Description for Gets a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PrivateEndpointConnectionResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_private_endpoint_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _approve_or_reject_private_endpoint_connection_initial( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + private_endpoint_wrapper, # type: "_models.PrivateLinkConnectionApprovalRequestResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnectionResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._approve_or_reject_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_wrapper, 'PrivateLinkConnectionApprovalRequestResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _approve_or_reject_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_approve_or_reject_private_endpoint_connection( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + private_endpoint_wrapper, # type: "_models.PrivateLinkConnectionApprovalRequestResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PrivateEndpointConnectionResource"] + """Approves or rejects a private endpoint connection. + + Description for Approves or rejects a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :param private_endpoint_wrapper: + :type private_endpoint_wrapper: ~azure.mgmt.web.v2020_06_01.models.PrivateLinkConnectionApprovalRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 PrivateEndpointConnectionResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.PrivateEndpointConnectionResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._approve_or_reject_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + private_endpoint_wrapper=private_endpoint_wrapper, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_approve_or_reject_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _delete_private_endpoint_connection_initial( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> object + cls = kwargs.pop('cls', None) # type: ClsType[object] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._delete_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 204: + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_delete_private_endpoint_connection( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[object] + """Deletes a private endpoint connection. + + Description for Deletes a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_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: True for ARMPolling, False for no polling, or a + polling object for 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 object or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[object] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[object] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def get_private_link_resources( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateLinkResourcesWrapper" + """Gets the private link resources. + + Description for Gets the private link resources. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesWrapper, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PrivateLinkResourcesWrapper + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourcesWrapper"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_private_link_resources.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourcesWrapper', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_link_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateLinkResources'} # type: ignore + + def list_processes_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessInfoCollection"] + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_processes_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_processes_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes'} # type: ignore + + def get_process_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProcessInfo"] + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ProcessInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}'} # type: ignore + + def delete_process_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}'} # type: ignore + + def get_process_dump_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[IO] + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_process_dump_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_dump_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/dump'} # type: ignore + + def list_process_modules_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessModuleInfoCollection"] + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessModuleInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_modules_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_process_modules_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules'} # type: ignore + + def get_process_module_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + base_address, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProcessModuleInfo"] + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ProcessModuleInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessModuleInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_process_module_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_module_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_process_threads_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessThreadInfoCollection"] + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.ProcessThreadInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_threads_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_process_threads_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads'} # type: ignore + + def list_public_certificates_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PublicCertificateCollection"] + """Get public certificates for an app or a deployment slot. + + Description for Get public certificates for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets hostname + bindings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicCertificateCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.PublicCertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_public_certificates_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PublicCertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_public_certificates_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates'} # type: ignore + + def get_public_certificate_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + public_certificate_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PublicCertificate" + """Get the named public certificate for an app (or deployment slot, if specified). + + Description for Get the named public certificate for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API the named binding + for the production slot. + :type slot: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_public_certificate_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_public_certificate_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'} # type: ignore + + def create_or_update_public_certificate_slot( + self, + resource_group_name, # type: str + name, # type: str + public_certificate_name, # type: str + slot, # type: str + public_certificate, # type: "_models.PublicCertificate" + **kwargs # type: Any + ): + # type: (...) -> "_models.PublicCertificate" + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create a + binding for the production slot. + :type slot: str + :param public_certificate: Public certificate details. This is the JSON representation of a + PublicCertificate object. + :type public_certificate: ~azure.mgmt.web.v2020_06_01.models.PublicCertificate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_public_certificate_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(public_certificate, 'PublicCertificate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_public_certificate_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'} # type: ignore + + def delete_public_certificate_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + public_certificate_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_public_certificate_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_public_certificate_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'} # type: ignore + + def list_publishing_profile_xml_with_secrets_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + publishing_profile_options, # type: "_models.CsmPublishingProfileOptions" + **kwargs # type: Any + ): + # type: (...) -> IO + """Gets the publishing profile for an app (or deployment slot, if specified). + + Description for Gets the publishing profile for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + publishing profile for the production slot. + :type slot: str + :param publishing_profile_options: Specifies publishingProfileOptions for publishing profile. + For example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + :type publishing_profile_options: ~azure.mgmt.web.v2020_06_01.models.CsmPublishingProfileOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/xml" + + # Construct URL + url = self.list_publishing_profile_xml_with_secrets_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(publishing_profile_options, 'CsmPublishingProfileOptions') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_publishing_profile_xml_with_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml'} # type: ignore + + def reset_slot_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Resets the configuration settings of the current slot if they were previously modified by calling the API with POST. + + Description for Resets the configuration settings of the current slot if they were previously + modified by calling the API with POST. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API resets + configuration settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.reset_slot_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_slot_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig'} # type: ignore + + def restart_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + soft_restart=None, # type: Optional[bool] + synchronous=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + """Restarts an app (or deployment slot, if specified). + + Description for Restarts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will restart the + production slot. + :type slot: str + :param soft_restart: Specify true to apply the configuration settings and restarts the app only + if necessary. By default, the API always restarts and reprovisions the app. + :type soft_restart: bool + :param synchronous: Specify true to block until the app is restarted. By default, it is set to + false, and the API responds immediately (asynchronous). + :type synchronous: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.restart_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if soft_restart is not None: + query_parameters['softRestart'] = self._serialize.query("soft_restart", soft_restart, 'bool') + if synchronous is not None: + query_parameters['synchronous'] = self._serialize.query("synchronous", synchronous, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restart_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restart'} # type: ignore + + def _restore_from_backup_blob_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_backup_blob_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_backup_blob_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob'} # type: ignore + + def begin_restore_from_backup_blob_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores an app from a backup blob in Azure Storage. + + Description for Restores an app from a backup blob in Azure Storage. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will restore a + backup of the production slot. + :type slot: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2020_06_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_from_backup_blob_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_backup_blob_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob'} # type: ignore + + def _restore_from_deleted_app_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + restore_request, # type: "_models.DeletedAppRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_deleted_app_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'DeletedAppRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_deleted_app_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp'} # type: ignore + + def begin_restore_from_deleted_app_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + restore_request, # type: "_models.DeletedAppRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores a deleted web app to this web app. + + Description for Restores a deleted web app to this web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param restore_request: Deleted web app restore information. + :type restore_request: ~azure.mgmt.web.v2020_06_01.models.DeletedAppRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_from_deleted_app_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_deleted_app_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp'} # type: ignore + + def _restore_snapshot_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + restore_request, # type: "_models.SnapshotRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_snapshot_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'SnapshotRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_snapshot_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot'} # type: ignore + + def begin_restore_snapshot_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + restore_request, # type: "_models.SnapshotRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores a web app from a snapshot. + + Description for Restores a web app from a snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param restore_request: Snapshot restore settings. Snapshot information can be obtained by + calling GetDeletedSites or GetSiteSnapshots API. + :type restore_request: ~azure.mgmt.web.v2020_06_01.models.SnapshotRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_snapshot_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot'} # type: ignore + + def list_site_extensions_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteExtensionInfoCollection"] + """Get list of siteextensions for a web site, or a deployment slot. + + Description for Get list of siteextensions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteExtensionInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.SiteExtensionInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_extensions_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_extensions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions'} # type: ignore + + def get_site_extension_slot( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.SiteExtensionInfo"] + """Get site extension information by its ID for a web site, or a deployment slot. + + Description for Get site extension information by its ID for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteExtensionInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteExtensionInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SiteExtensionInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_site_extension_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_extension_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + def _install_site_extension_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.SiteExtensionInfo"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SiteExtensionInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._install_site_extension_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 429]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _install_site_extension_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + def begin_install_site_extension_slot( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SiteExtensionInfo"] + """Install site extension on a web site, or a deployment slot. + + Description for Install site extension on a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 SiteExtensionInfo or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.SiteExtensionInfo] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfo"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._install_site_extension_slot_initial( + resource_group_name=resource_group_name, + name=name, + site_extension_id=site_extension_id, + slot=slot, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_site_extension_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + def delete_site_extension_slot( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Remove a site extension from a web site, or a deployment slot. + + Description for Remove a site extension from a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_site_extension_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_site_extension_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + def _copy_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + copy_slot_entity, # type: "_models.CsmCopySlotEntity" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._copy_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(copy_slot_entity, 'CsmCopySlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _copy_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotcopy'} # type: ignore + + def begin_copy_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + copy_slot_entity, # type: "_models.CsmCopySlotEntity" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Copies a deployment slot to another deployment slot of an app. + + Description for Copies a deployment slot to another deployment slot of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param copy_slot_entity: JSON object that contains the target slot name and site config + properties to override the source slot config. See example. + :type copy_slot_entity: ~azure.mgmt.web.v2020_06_01.models.CsmCopySlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._copy_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + copy_slot_entity=copy_slot_entity, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_copy_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotcopy'} # type: ignore + + def list_slot_differences_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SlotDifferenceCollection"] + """Get the difference in configuration settings between two web app slots. + + Description for Get the difference in configuration settings between two web app slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_06_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SlotDifferenceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.SlotDifferenceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotDifferenceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_slot_differences_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SlotDifferenceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_slot_differences_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs'} # type: ignore + + def _swap_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._swap_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _swap_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap'} # type: ignore + + def begin_swap_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Swaps two deployment slots of an app. + + Description for Swaps two deployment slots of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_06_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._swap_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + slot_swap_entity=slot_swap_entity, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_swap_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap'} # type: ignore + + def list_snapshots_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SnapshotCollection"] + """Returns all Snapshots to the user. + + Description for Returns all Snapshots to the user. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :param slot: Website Slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_snapshots_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots'} # type: ignore + + def list_snapshots_from_dr_secondary_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SnapshotCollection"] + """Returns all Snapshots to the user from DRSecondary endpoint. + + Description for Returns all Snapshots to the user from DRSecondary endpoint. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :param slot: Website Slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots_from_dr_secondary_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_snapshots_from_dr_secondary_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshotsdr'} # type: ignore + + def get_source_control_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteSourceControl" + """Gets the source control configuration of an app. + + Description for Gets the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + source control configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_source_control_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + def _create_or_update_source_control_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_source_control, # type: "_models.SiteSourceControl" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteSourceControl" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_source_control_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_source_control_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + def begin_create_or_update_source_control_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_source_control, # type: "_models.SiteSourceControl" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SiteSourceControl"] + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + source control configuration for the production slot. + :type slot: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2020_06_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 SiteSourceControl or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.SiteSourceControl] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_source_control_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + site_source_control=site_source_control, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + def delete_source_control_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the source control configuration of an app. + + Description for Deletes the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + source control configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_source_control_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + def update_source_control_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_source_control, # type: "_models.SiteSourceControl" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteSourceControl" + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + source control configuration for the production slot. + :type slot: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2020_06_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_source_control_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + def start_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Starts an app (or deployment slot, if specified). + + Description for Starts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will start the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.start_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start'} # type: ignore + + def _start_network_trace_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._start_network_trace_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_network_trace_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace'} # type: ignore + + def begin_start_network_trace_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[List["_models.NetworkTrace"]] + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_network_trace_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace'} # type: ignore + + def stop_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stops an app (or deployment slot, if specified). + + Description for Stops an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will stop the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.stop_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop'} # type: ignore + + def stop_network_trace_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.stop_network_trace_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stopNetworkTrace'} # type: ignore + + def sync_repository_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Sync web app repository. + + Description for Sync web app repository. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.sync_repository_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_repository_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync'} # type: ignore + + def sync_function_triggers_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.sync_function_triggers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_function_triggers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/syncfunctiontriggers'} # type: ignore + + def list_triggered_web_jobs_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.TriggeredWebJobCollection"] + """List triggered web jobs for an app, or a deployment slot. + + Description for List triggered web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredWebJobCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.TriggeredWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_jobs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_triggered_web_jobs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs'} # type: ignore + + def get_triggered_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.TriggeredWebJob"] + """Gets a triggered web job by its ID for an app, or a deployment slot. + + Description for Gets a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.TriggeredWebJob or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.TriggeredWebJob"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TriggeredWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}'} # type: ignore + + def delete_triggered_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a triggered web job by its ID for an app, or a deployment slot. + + Description for Delete a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes web job + for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_triggered_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_triggered_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}'} # type: ignore + + def list_triggered_web_job_history_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.TriggeredJobHistoryCollection"] + """List a triggered web job's history for an app, or a deployment slot. + + Description for List a triggered web job's history for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredJobHistoryCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.TriggeredJobHistoryCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredJobHistoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_job_history_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredJobHistoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_triggered_web_job_history_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history'} # type: ignore + + def get_triggered_web_job_history_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.TriggeredJobHistory"] + """Gets a triggered web job's history by its ID for an app, , or a deployment slot. + + Description for Gets a triggered web job's history by its ID for an app, , or a deployment + slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param id: History ID. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredJobHistory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.TriggeredJobHistory or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.TriggeredJobHistory"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job_history_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TriggeredJobHistory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job_history_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}'} # type: ignore + + def run_triggered_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Run a triggered web job for an app, or a deployment slot. + + Description for Run a triggered web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.run_triggered_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + run_triggered_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/run'} # type: ignore + + def list_usages_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CsmUsageQuotaCollection"] + """Gets the quota usage information of an app (or deployment slot, if specified). + + Description for Gets the quota usage information of an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get quota + information of the production slot. + :type slot: str + :param filter: Return only information specified in the filter (using OData syntax). For + example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq + 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_usages_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages'} # type: ignore + + def list_vnet_connections_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.VnetInfo"] + """Gets the virtual networks the app (or deployment slot) is connected to. + + Description for Gets the virtual networks the app (or deployment slot) is connected to. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get virtual + network connections for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetInfo, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.VnetInfo] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_vnet_connections_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetInfo]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_vnet_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections'} # type: ignore + + def get_vnet_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetInfo" + """Gets a virtual network the app (or deployment slot) is connected to by name. + + Description for Gets a virtual network the app (or deployment slot) is connected to by name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + named virtual network for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def create_or_update_vnet_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.VnetInfo" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetInfo" + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def delete_vnet_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a connection from an app (or deployment slot to a named virtual network. + + Description for Deletes a connection from an app (or deployment slot to a named virtual + network. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def update_vnet_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.VnetInfo" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetInfo" + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfo') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def get_vnet_connection_gateway_slot( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VnetGateway"] + """Gets an app's Virtual Network gateway. + + Description for Gets an app's Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a + gateway for the production slot's Virtual Network. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetGateway or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VnetGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection_gateway_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection_gateway_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def create_or_update_vnet_connection_gateway_slot( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.VnetGateway" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetGateway" + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update a gateway for the production slot's Virtual Network. + :type slot: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection_gateway_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection_gateway_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def update_vnet_connection_gateway_slot( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.VnetGateway" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetGateway" + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update a gateway for the production slot's Virtual Network. + :type slot: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection_gateway_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection_gateway_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def list_web_jobs_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebJobCollection"] + """List webjobs for an app, or a deployment slot. + + Description for List webjobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebJobCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.WebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_jobs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_web_jobs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs'} # type: ignore + + def get_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WebJob" + """Get webjob information for an app, or a deployment slot. + + Description for Get webjob information for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of the web job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.WebJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs/{webJobName}'} # type: ignore + + def list_slot_differences_from_production( + self, + resource_group_name, # type: str + name, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SlotDifferenceCollection"] + """Get the difference in configuration settings between two web app slots. + + Description for Get the difference in configuration settings between two web app slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_06_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SlotDifferenceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.SlotDifferenceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotDifferenceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_slot_differences_from_production.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SlotDifferenceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_slot_differences_from_production.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs'} # type: ignore + + def _swap_slot_with_production_initial( + self, + resource_group_name, # type: str + name, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._swap_slot_with_production_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _swap_slot_with_production_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap'} # type: ignore + + def begin_swap_slot_with_production( + self, + resource_group_name, # type: str + name, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Swaps two deployment slots of an app. + + Description for Swaps two deployment slots of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_06_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._swap_slot_with_production_initial( + resource_group_name=resource_group_name, + name=name, + slot_swap_entity=slot_swap_entity, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_swap_slot_with_production.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap'} # type: ignore + + def list_snapshots( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SnapshotCollection"] + """Returns all Snapshots to the user. + + Description for Returns all Snapshots to the user. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_snapshots.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots'} # type: ignore + + def list_snapshots_from_dr_secondary( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SnapshotCollection"] + """Returns all Snapshots to the user from DRSecondary endpoint. + + Description for Returns all Snapshots to the user from DRSecondary endpoint. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots_from_dr_secondary.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_snapshots_from_dr_secondary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshotsdr'} # type: ignore + + def get_source_control( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteSourceControl" + """Gets the source control configuration of an app. + + Description for Gets the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + def _create_or_update_source_control_initial( + self, + resource_group_name, # type: str + name, # type: str + site_source_control, # type: "_models.SiteSourceControl" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteSourceControl" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_source_control_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_source_control_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + def begin_create_or_update_source_control( + self, + resource_group_name, # type: str + name, # type: str + site_source_control, # type: "_models.SiteSourceControl" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SiteSourceControl"] + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2020_06_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 SiteSourceControl or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_06_01.models.SiteSourceControl] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_source_control_initial( + resource_group_name=resource_group_name, + name=name, + site_source_control=site_source_control, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + def delete_source_control( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the source control configuration of an app. + + Description for Deletes the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + def update_source_control( + self, + resource_group_name, # type: str + name, # type: str + site_source_control, # type: "_models.SiteSourceControl" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteSourceControl" + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2020_06_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + def start( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Starts an app (or deployment slot, if specified). + + Description for Starts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.start.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/start'} # type: ignore + + def _start_network_trace_initial( + self, + resource_group_name, # type: str + name, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self._start_network_trace_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_network_trace_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace'} # type: ignore + + def begin_start_network_trace( + self, + resource_group_name, # type: str + name, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[List["_models.NetworkTrace"]] + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[list[~azure.mgmt.web.v2020_06_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_network_trace_initial( + resource_group_name=resource_group_name, + name=name, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace'} # type: ignore + + def stop( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stops an app (or deployment slot, if specified). + + Description for Stops an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.stop.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stop'} # type: ignore + + def stop_network_trace( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.stop_network_trace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stopNetworkTrace'} # type: ignore + + def sync_repository( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Sync web app repository. + + Description for Sync web app repository. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.sync_repository.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_repository.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sync'} # type: ignore + + def sync_function_triggers( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.sync_function_triggers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_function_triggers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/syncfunctiontriggers'} # type: ignore + + def list_triggered_web_jobs( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.TriggeredWebJobCollection"] + """List triggered web jobs for an app, or a deployment slot. + + Description for List triggered web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredWebJobCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.TriggeredWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_jobs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_triggered_web_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs'} # type: ignore + + def get_triggered_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.TriggeredWebJob"] + """Gets a triggered web job by its ID for an app, or a deployment slot. + + Description for Gets a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.TriggeredWebJob or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.TriggeredWebJob"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TriggeredWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}'} # type: ignore + + def delete_triggered_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a triggered web job by its ID for an app, or a deployment slot. + + Description for Delete a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_triggered_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_triggered_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}'} # type: ignore + + def list_triggered_web_job_history( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.TriggeredJobHistoryCollection"] + """List a triggered web job's history for an app, or a deployment slot. + + Description for List a triggered web job's history for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredJobHistoryCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.TriggeredJobHistoryCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredJobHistoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_job_history.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredJobHistoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_triggered_web_job_history.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history'} # type: ignore + + def get_triggered_web_job_history( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.TriggeredJobHistory"] + """Gets a triggered web job's history by its ID for an app, , or a deployment slot. + + Description for Gets a triggered web job's history by its ID for an app, , or a deployment + slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param id: History ID. + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredJobHistory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.TriggeredJobHistory or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.TriggeredJobHistory"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job_history.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TriggeredJobHistory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job_history.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history/{id}'} # type: ignore + + def run_triggered_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Run a triggered web job for an app, or a deployment slot. + + Description for Run a triggered web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.run_triggered_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + run_triggered_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/run'} # type: ignore + + def list_usages( + self, + resource_group_name, # type: str + name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CsmUsageQuotaCollection"] + """Gets the quota usage information of an app (or deployment slot, if specified). + + Description for Gets the quota usage information of an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param filter: Return only information specified in the filter (using OData syntax). For + example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq + 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/usages'} # type: ignore + + def list_vnet_connections( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.VnetInfo"] + """Gets the virtual networks the app (or deployment slot) is connected to. + + Description for Gets the virtual networks the app (or deployment slot) is connected to. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetInfo, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_06_01.models.VnetInfo] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_vnet_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetInfo]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_vnet_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections'} # type: ignore + + def get_vnet_connection( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetInfo" + """Gets a virtual network the app (or deployment slot) is connected to by name. + + Description for Gets a virtual network the app (or deployment slot) is connected to by name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def create_or_update_vnet_connection( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + connection_envelope, # type: "_models.VnetInfo" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetInfo" + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def delete_vnet_connection( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a connection from an app (or deployment slot to a named virtual network. + + Description for Deletes a connection from an app (or deployment slot to a named virtual + network. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def update_vnet_connection( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + connection_envelope, # type: "_models.VnetInfo" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetInfo" + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfo') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def get_vnet_connection_gateway( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VnetGateway"] + """Gets an app's Virtual Network gateway. + + Description for Gets an app's Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetGateway or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VnetGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def create_or_update_vnet_connection_gateway( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + connection_envelope, # type: "_models.VnetGateway" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetGateway" + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def update_vnet_connection_gateway( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + connection_envelope, # type: "_models.VnetGateway" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetGateway" + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def list_web_jobs( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebJobCollection"] + """List webjobs for an app, or a deployment slot. + + Description for List webjobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebJobCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.WebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_jobs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_web_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs'} # type: ignore + + def get_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WebJob" + """Get webjob information for an app, or a deployment slot. + + Description for Get webjob information for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of the web job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.WebJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs/{webJobName}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_web_site_management_client_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_web_site_management_client_operations.py new file mode 100644 index 000000000000..cf7559bc0c76 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/operations/_web_site_management_client_operations.py @@ -0,0 +1,1079 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WebSiteManagementClientOperationsMixin(object): + + def get_publishing_user( + self, + **kwargs # type: Any + ): + # type: (...) -> "_models.User" + """Gets publishing user. + + Description for Gets publishing user. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: User, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.User + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_publishing_user.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_publishing_user.metadata = {'url': '/providers/Microsoft.Web/publishingUsers/web'} # type: ignore + + def update_publishing_user( + self, + user_details, # type: "_models.User" + **kwargs # type: Any + ): + # type: (...) -> "_models.User" + """Updates publishing user. + + Description for Updates publishing user. + + :param user_details: Details of publishing user. + :type user_details: ~azure.mgmt.web.v2020_06_01.models.User + :keyword callable cls: A custom type or function that will be passed the direct response + :return: User, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.User + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_publishing_user.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(user_details, 'User') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_publishing_user.metadata = {'url': '/providers/Microsoft.Web/publishingUsers/web'} # type: ignore + + def list_source_controls( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SourceControlCollection"] + """Gets the source controls available for Azure websites. + + Description for Gets the source controls available for Azure websites. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SourceControlCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.SourceControlCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_source_controls.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SourceControlCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_source_controls.metadata = {'url': '/providers/Microsoft.Web/sourcecontrols'} # type: ignore + + def get_source_control( + self, + source_control_type, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SourceControl" + """Gets source control token. + + Description for Gets source control token. + + :param source_control_type: Type of source control. + :type source_control_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'sourceControlType': self._serialize.url("source_control_type", source_control_type, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_source_control.metadata = {'url': '/providers/Microsoft.Web/sourcecontrols/{sourceControlType}'} # type: ignore + + def update_source_control( + self, + source_control_type, # type: str + request_message, # type: "_models.SourceControl" + **kwargs # type: Any + ): + # type: (...) -> "_models.SourceControl" + """Updates source control token. + + Description for Updates source control token. + + :param source_control_type: Type of source control. + :type source_control_type: str + :param request_message: Source control token information. + :type request_message: ~azure.mgmt.web.v2020_06_01.models.SourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'sourceControlType': self._serialize.url("source_control_type", source_control_type, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request_message, 'SourceControl') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_source_control.metadata = {'url': '/providers/Microsoft.Web/sourcecontrols/{sourceControlType}'} # type: ignore + + def list_billing_meters( + self, + billing_location=None, # type: Optional[str] + os_type=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BillingMeterCollection"] + """Gets a list of meters for a given location. + + Description for Gets a list of meters for a given location. + + :param billing_location: Azure Location of billable resource. + :type billing_location: str + :param os_type: App Service OS type meters used for. + :type os_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BillingMeterCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.BillingMeterCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BillingMeterCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_billing_meters.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if billing_location is not None: + query_parameters['billingLocation'] = self._serialize.query("billing_location", billing_location, 'str') + if os_type is not None: + query_parameters['osType'] = self._serialize.query("os_type", os_type, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BillingMeterCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_billing_meters.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters'} # type: ignore + + def check_name_availability( + self, + name, # type: str + type, # type: Union[str, "_models.CheckNameResourceTypes"] + is_fqdn=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> "_models.ResourceNameAvailability" + """Check if a resource name is available. + + Description for Check if a resource name is available. + + :param name: Resource name to verify. + :type name: str + :param type: Resource type used for verification. + :type type: str or ~azure.mgmt.web.v2020_06_01.models.CheckNameResourceTypes + :param is_fqdn: Is fully qualified domain name. + :type is_fqdn: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceNameAvailability, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ResourceNameAvailability + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNameAvailability"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _request = _models.ResourceNameAvailabilityRequest(name=name, type=type, is_fqdn=is_fqdn) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_request, 'ResourceNameAvailabilityRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceNameAvailability', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability'} # type: ignore + + def get_subscription_deployment_locations( + self, + **kwargs # type: Any + ): + # type: (...) -> "_models.DeploymentLocations" + """Gets list of available geo regions plus ministamps. + + Description for Gets list of available geo regions plus ministamps. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeploymentLocations, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.DeploymentLocations + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLocations"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.get_subscription_deployment_locations.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeploymentLocations', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_subscription_deployment_locations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/deploymentLocations'} # type: ignore + + def list_geo_regions( + self, + sku=None, # type: Optional[Union[str, "_models.SkuName"]] + linux_workers_enabled=None, # type: Optional[bool] + xenon_workers_enabled=None, # type: Optional[bool] + linux_dynamic_workers_enabled=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GeoRegionCollection"] + """Get a list of available geographical regions. + + Description for Get a list of available geographical regions. + + :param sku: Name of SKU used to filter the regions. + :type sku: str or ~azure.mgmt.web.v2020_06_01.models.SkuName + :param linux_workers_enabled: Specify :code:`true` if you want to filter to only + regions that support Linux workers. + :type linux_workers_enabled: bool + :param xenon_workers_enabled: Specify :code:`true` if you want to filter to only + regions that support Xenon workers. + :type xenon_workers_enabled: bool + :param linux_dynamic_workers_enabled: Specify :code:`true` if you want to filter + to only regions that support Linux Consumption Workers. + :type linux_dynamic_workers_enabled: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GeoRegionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.GeoRegionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GeoRegionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_geo_regions.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if sku is not None: + query_parameters['sku'] = self._serialize.query("sku", sku, 'str') + if linux_workers_enabled is not None: + query_parameters['linuxWorkersEnabled'] = self._serialize.query("linux_workers_enabled", linux_workers_enabled, 'bool') + if xenon_workers_enabled is not None: + query_parameters['xenonWorkersEnabled'] = self._serialize.query("xenon_workers_enabled", xenon_workers_enabled, 'bool') + if linux_dynamic_workers_enabled is not None: + query_parameters['linuxDynamicWorkersEnabled'] = self._serialize.query("linux_dynamic_workers_enabled", linux_dynamic_workers_enabled, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('GeoRegionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_geo_regions.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/geoRegions'} # type: ignore + + def list_site_identifiers_assigned_to_host_name( + self, + name_identifier, # type: "_models.NameIdentifier" + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.IdentifierCollection"] + """List all apps that are assigned to a hostname. + + Description for List all apps that are assigned to a hostname. + + :param name_identifier: Hostname information. + :type name_identifier: ~azure.mgmt.web.v2020_06_01.models.NameIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IdentifierCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.IdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_identifiers_assigned_to_host_name.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(name_identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(name_identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_identifiers_assigned_to_host_name.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/listSitesAssignedToHostName'} # type: ignore + + def list_premier_add_on_offers( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PremierAddOnOfferCollection"] + """List all premier add-on offers. + + Description for List all premier add-on offers. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PremierAddOnOfferCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_06_01.models.PremierAddOnOfferCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOnOfferCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_premier_add_on_offers.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PremierAddOnOfferCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_premier_add_on_offers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/premieraddonoffers'} # type: ignore + + def list_skus( + self, + **kwargs # type: Any + ): + # type: (...) -> "_models.SkuInfos" + """List all SKUs. + + Description for List all SKUs. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuInfos, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.SkuInfos + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInfos"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json" + + # Construct URL + url = self.list_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuInfos', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/skus'} # type: ignore + + def verify_hosting_environment_vnet( + self, + parameters, # type: "_models.VnetParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetValidationFailureDetails" + """Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules. + + Description for Verifies if this VNET is compatible with an App Service Environment by + analyzing the Network Security Group rules. + + :param parameters: VNET information. + :type parameters: ~azure.mgmt.web.v2020_06_01.models.VnetParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetValidationFailureDetails, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.VnetValidationFailureDetails + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetValidationFailureDetails"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.verify_hosting_environment_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VnetParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetValidationFailureDetails', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + verify_hosting_environment_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/verifyHostingEnvironmentVnet'} # type: ignore + + def move( + self, + resource_group_name, # type: str + move_resource_envelope, # type: "_models.CsmMoveResourceEnvelope" + **kwargs # type: Any + ): + # type: (...) -> None + """Move resources between resource groups. + + Description for Move resources between resource groups. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param move_resource_envelope: Object that represents the resource to move. + :type move_resource_envelope: ~azure.mgmt.web.v2020_06_01.models.CsmMoveResourceEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.move.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(move_resource_envelope, 'CsmMoveResourceEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources'} # type: ignore + + def validate( + self, + resource_group_name, # type: str + validate_request, # type: "_models.ValidateRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.ValidateResponse" + """Validate if a resource can be created. + + Description for Validate if a resource can be created. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param validate_request: Request with the resources to validate. + :type validate_request: ~azure.mgmt.web.v2020_06_01.models.ValidateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidateResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_06_01.models.ValidateResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(validate_request, 'ValidateRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ValidateResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validate'} # type: ignore + + def validate_move( + self, + resource_group_name, # type: str + move_resource_envelope, # type: "_models.CsmMoveResourceEnvelope" + **kwargs # type: Any + ): + # type: (...) -> None + """Validate whether a resource can be moved. + + Description for Validate whether a resource can be moved. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param move_resource_envelope: Object that represents the resource to move. + :type move_resource_envelope: ~azure.mgmt.web.v2020_06_01.models.CsmMoveResourceEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_move.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(move_resource_envelope, 'CsmMoveResourceEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + validate_move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/validateMoveResources'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/py.typed b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/__init__.py similarity index 69% rename from sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/_version.py rename to sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/__init__.py index 5c14e0d8303d..32779ae9e1b0 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/__init__.py @@ -6,4 +6,11 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.42.0" +from ._web_site_management_client import WebSiteManagementClient +__all__ = ['WebSiteManagementClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/_configuration.py new file mode 100644 index 000000000000..7d1aa8d0daa7 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/_configuration.py @@ -0,0 +1,70 @@ +# 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 TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class WebSiteManagementClientConfiguration(Configuration): + """Configuration for WebSiteManagementClient. + + 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. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(WebSiteManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-09-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-web/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.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.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/_metadata.json b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/_metadata.json new file mode 100644 index 000000000000..421e5a53f91c --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/_metadata.json @@ -0,0 +1,279 @@ +{ + "chosen_version": "2020-09-01", + "total_api_version_list": ["2020-09-01"], + "client": { + "name": "WebSiteManagementClient", + "filename": "_web_site_management_client", + "description": "WebSite Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null + }, + "operation_groups": { + "app_service_certificate_orders": "AppServiceCertificateOrdersOperations", + "certificate_registration_provider": "CertificateRegistrationProviderOperations", + "domains": "DomainsOperations", + "top_level_domains": "TopLevelDomainsOperations", + "domain_registration_provider": "DomainRegistrationProviderOperations", + "certificates": "CertificatesOperations", + "deleted_web_apps": "DeletedWebAppsOperations", + "diagnostics": "DiagnosticsOperations", + "provider": "ProviderOperations", + "recommendations": "RecommendationsOperations", + "web_apps": "WebAppsOperations", + "static_sites": "StaticSitesOperations", + "app_service_environments": "AppServiceEnvironmentsOperations", + "app_service_plans": "AppServicePlansOperations", + "resource_health_metadata": "ResourceHealthMetadataOperations" + }, + "operation_mixins": { + "generate_github_access_token_for_appservice_cli_async" : { + "sync": { + "signature": "def generate_github_access_token_for_appservice_cli_async(\n self,\n code, # type: str\n state, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Exchange code for GitHub access token for AppService CLI.\n\nDescription for Exchange code for GitHub access token for AppService CLI.\n\n:param code: Code string to exchange for Github Access token.\n:type code: str\n:param state: State string used for verification.\n:type state: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AppserviceGithubToken, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_09_01.models.AppserviceGithubToken\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def generate_github_access_token_for_appservice_cli_async(\n self,\n code: str,\n state: str,\n **kwargs\n) -\u003e \"_models.AppserviceGithubToken\":\n", + "doc": "\"\"\"Exchange code for GitHub access token for AppService CLI.\n\nDescription for Exchange code for GitHub access token for AppService CLI.\n\n:param code: Code string to exchange for Github Access token.\n:type code: str\n:param state: State string used for verification.\n:type state: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AppserviceGithubToken, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_09_01.models.AppserviceGithubToken\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "code, state" + }, + "get_publishing_user" : { + "sync": { + "signature": "def get_publishing_user(\n self,\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Gets publishing user.\n\nDescription for Gets publishing user.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: User, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_09_01.models.User\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_publishing_user(\n self,\n **kwargs\n) -\u003e \"_models.User\":\n", + "doc": "\"\"\"Gets publishing user.\n\nDescription for Gets publishing user.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: User, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_09_01.models.User\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "" + }, + "update_publishing_user" : { + "sync": { + "signature": "def update_publishing_user(\n self,\n user_details, # type: \"_models.User\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Updates publishing user.\n\nDescription for Updates publishing user.\n\n:param user_details: Details of publishing user.\n:type user_details: ~azure.mgmt.web.v2020_09_01.models.User\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: User, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_09_01.models.User\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def update_publishing_user(\n self,\n user_details: \"_models.User\",\n **kwargs\n) -\u003e \"_models.User\":\n", + "doc": "\"\"\"Updates publishing user.\n\nDescription for Updates publishing user.\n\n:param user_details: Details of publishing user.\n:type user_details: ~azure.mgmt.web.v2020_09_01.models.User\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: User, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_09_01.models.User\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "user_details" + }, + "list_source_controls" : { + "sync": { + "signature": "def list_source_controls(\n self,\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Gets the source controls available for Azure websites.\n\nDescription for Gets the source controls available for Azure websites.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either SourceControlCollection or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.SourceControlCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": false, + "signature": "def list_source_controls(\n self,\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.SourceControlCollection\"]:\n", + "doc": "\"\"\"Gets the source controls available for Azure websites.\n\nDescription for Gets the source controls available for Azure websites.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either SourceControlCollection or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.SourceControlCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "" + }, + "get_source_control" : { + "sync": { + "signature": "def get_source_control(\n self,\n source_control_type, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Gets source control token.\n\nDescription for Gets source control token.\n\n:param source_control_type: Type of source control.\n:type source_control_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SourceControl, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_09_01.models.SourceControl\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_source_control(\n self,\n source_control_type: str,\n **kwargs\n) -\u003e \"_models.SourceControl\":\n", + "doc": "\"\"\"Gets source control token.\n\nDescription for Gets source control token.\n\n:param source_control_type: Type of source control.\n:type source_control_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SourceControl, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_09_01.models.SourceControl\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "source_control_type" + }, + "update_source_control" : { + "sync": { + "signature": "def update_source_control(\n self,\n source_control_type, # type: str\n request_message, # type: \"_models.SourceControl\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Updates source control token.\n\nDescription for Updates source control token.\n\n:param source_control_type: Type of source control.\n:type source_control_type: str\n:param request_message: Source control token information.\n:type request_message: ~azure.mgmt.web.v2020_09_01.models.SourceControl\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SourceControl, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_09_01.models.SourceControl\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def update_source_control(\n self,\n source_control_type: str,\n request_message: \"_models.SourceControl\",\n **kwargs\n) -\u003e \"_models.SourceControl\":\n", + "doc": "\"\"\"Updates source control token.\n\nDescription for Updates source control token.\n\n:param source_control_type: Type of source control.\n:type source_control_type: str\n:param request_message: Source control token information.\n:type request_message: ~azure.mgmt.web.v2020_09_01.models.SourceControl\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SourceControl, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_09_01.models.SourceControl\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "source_control_type, request_message" + }, + "list_billing_meters" : { + "sync": { + "signature": "def list_billing_meters(\n self,\n billing_location=None, # type: Optional[str]\n os_type=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Gets a list of meters for a given location.\n\nDescription for Gets a list of meters for a given location.\n\n:param billing_location: Azure Location of billable resource.\n:type billing_location: str\n:param os_type: App Service OS type meters used for.\n:type os_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BillingMeterCollection or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.BillingMeterCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": false, + "signature": "def list_billing_meters(\n self,\n billing_location: Optional[str] = None,\n os_type: Optional[str] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.BillingMeterCollection\"]:\n", + "doc": "\"\"\"Gets a list of meters for a given location.\n\nDescription for Gets a list of meters for a given location.\n\n:param billing_location: Azure Location of billable resource.\n:type billing_location: str\n:param os_type: App Service OS type meters used for.\n:type os_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BillingMeterCollection or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.BillingMeterCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "billing_location, os_type" + }, + "check_name_availability" : { + "sync": { + "signature": "def check_name_availability(\n self,\n name, # type: str\n type, # type: Union[str, \"_models.CheckNameResourceTypes\"]\n is_fqdn=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Check if a resource name is available.\n\nDescription for Check if a resource name is available.\n\n:param name: Resource name to verify.\n:type name: str\n:param type: Resource type used for verification.\n:type type: str or ~azure.mgmt.web.v2020_09_01.models.CheckNameResourceTypes\n:param is_fqdn: Is fully qualified domain name.\n:type is_fqdn: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ResourceNameAvailability, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_09_01.models.ResourceNameAvailability\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def check_name_availability(\n self,\n name: str,\n type: Union[str, \"_models.CheckNameResourceTypes\"],\n is_fqdn: Optional[bool] = None,\n **kwargs\n) -\u003e \"_models.ResourceNameAvailability\":\n", + "doc": "\"\"\"Check if a resource name is available.\n\nDescription for Check if a resource name is available.\n\n:param name: Resource name to verify.\n:type name: str\n:param type: Resource type used for verification.\n:type type: str or ~azure.mgmt.web.v2020_09_01.models.CheckNameResourceTypes\n:param is_fqdn: Is fully qualified domain name.\n:type is_fqdn: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ResourceNameAvailability, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_09_01.models.ResourceNameAvailability\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "name, type, is_fqdn" + }, + "get_subscription_deployment_locations" : { + "sync": { + "signature": "def get_subscription_deployment_locations(\n self,\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Gets list of available geo regions plus ministamps.\n\nDescription for Gets list of available geo regions plus ministamps.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeploymentLocations, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_09_01.models.DeploymentLocations\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_subscription_deployment_locations(\n self,\n **kwargs\n) -\u003e \"_models.DeploymentLocations\":\n", + "doc": "\"\"\"Gets list of available geo regions plus ministamps.\n\nDescription for Gets list of available geo regions plus ministamps.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeploymentLocations, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_09_01.models.DeploymentLocations\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "" + }, + "list_geo_regions" : { + "sync": { + "signature": "def list_geo_regions(\n self,\n sku=None, # type: Optional[Union[str, \"_models.SkuName\"]]\n linux_workers_enabled=None, # type: Optional[bool]\n xenon_workers_enabled=None, # type: Optional[bool]\n linux_dynamic_workers_enabled=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Get a list of available geographical regions.\n\nDescription for Get a list of available geographical regions.\n\n:param sku: Name of SKU used to filter the regions.\n:type sku: str or ~azure.mgmt.web.v2020_09_01.models.SkuName\n:param linux_workers_enabled: Specify :code:`\u003ccode\u003etrue\u003c/code\u003e` if you want to filter to only\n regions that support Linux workers.\n:type linux_workers_enabled: bool\n:param xenon_workers_enabled: Specify :code:`\u003ccode\u003etrue\u003c/code\u003e` if you want to filter to only\n regions that support Xenon workers.\n:type xenon_workers_enabled: bool\n:param linux_dynamic_workers_enabled: Specify :code:`\u003ccode\u003etrue\u003c/code\u003e` if you want to filter\n to only regions that support Linux Consumption Workers.\n:type linux_dynamic_workers_enabled: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either GeoRegionCollection or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.GeoRegionCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": false, + "signature": "def list_geo_regions(\n self,\n sku: Optional[Union[str, \"_models.SkuName\"]] = None,\n linux_workers_enabled: Optional[bool] = None,\n xenon_workers_enabled: Optional[bool] = None,\n linux_dynamic_workers_enabled: Optional[bool] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.GeoRegionCollection\"]:\n", + "doc": "\"\"\"Get a list of available geographical regions.\n\nDescription for Get a list of available geographical regions.\n\n:param sku: Name of SKU used to filter the regions.\n:type sku: str or ~azure.mgmt.web.v2020_09_01.models.SkuName\n:param linux_workers_enabled: Specify :code:`\u003ccode\u003etrue\u003c/code\u003e` if you want to filter to only\n regions that support Linux workers.\n:type linux_workers_enabled: bool\n:param xenon_workers_enabled: Specify :code:`\u003ccode\u003etrue\u003c/code\u003e` if you want to filter to only\n regions that support Xenon workers.\n:type xenon_workers_enabled: bool\n:param linux_dynamic_workers_enabled: Specify :code:`\u003ccode\u003etrue\u003c/code\u003e` if you want to filter\n to only regions that support Linux Consumption Workers.\n:type linux_dynamic_workers_enabled: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either GeoRegionCollection or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.GeoRegionCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "sku, linux_workers_enabled, xenon_workers_enabled, linux_dynamic_workers_enabled" + }, + "list_site_identifiers_assigned_to_host_name" : { + "sync": { + "signature": "def list_site_identifiers_assigned_to_host_name(\n self,\n name_identifier, # type: \"_models.NameIdentifier\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"List all apps that are assigned to a hostname.\n\nDescription for List all apps that are assigned to a hostname.\n\n:param name_identifier: Hostname information.\n:type name_identifier: ~azure.mgmt.web.v2020_09_01.models.NameIdentifier\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either IdentifierCollection or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.IdentifierCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": false, + "signature": "def list_site_identifiers_assigned_to_host_name(\n self,\n name_identifier: \"_models.NameIdentifier\",\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.IdentifierCollection\"]:\n", + "doc": "\"\"\"List all apps that are assigned to a hostname.\n\nDescription for List all apps that are assigned to a hostname.\n\n:param name_identifier: Hostname information.\n:type name_identifier: ~azure.mgmt.web.v2020_09_01.models.NameIdentifier\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either IdentifierCollection or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.IdentifierCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "name_identifier" + }, + "list_premier_add_on_offers" : { + "sync": { + "signature": "def list_premier_add_on_offers(\n self,\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"List all premier add-on offers.\n\nDescription for List all premier add-on offers.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either PremierAddOnOfferCollection or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.PremierAddOnOfferCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": false, + "signature": "def list_premier_add_on_offers(\n self,\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.PremierAddOnOfferCollection\"]:\n", + "doc": "\"\"\"List all premier add-on offers.\n\nDescription for List all premier add-on offers.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either PremierAddOnOfferCollection or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.PremierAddOnOfferCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "" + }, + "list_skus" : { + "sync": { + "signature": "def list_skus(\n self,\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"List all SKUs.\n\nDescription for List all SKUs.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SkuInfos, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_09_01.models.SkuInfos\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def list_skus(\n self,\n **kwargs\n) -\u003e \"_models.SkuInfos\":\n", + "doc": "\"\"\"List all SKUs.\n\nDescription for List all SKUs.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SkuInfos, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_09_01.models.SkuInfos\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "" + }, + "verify_hosting_environment_vnet" : { + "sync": { + "signature": "def verify_hosting_environment_vnet(\n self,\n parameters, # type: \"_models.VnetParameters\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules.\n\nDescription for Verifies if this VNET is compatible with an App Service Environment by\nanalyzing the Network Security Group rules.\n\n:param parameters: VNET information.\n:type parameters: ~azure.mgmt.web.v2020_09_01.models.VnetParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VnetValidationFailureDetails, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_09_01.models.VnetValidationFailureDetails\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def verify_hosting_environment_vnet(\n self,\n parameters: \"_models.VnetParameters\",\n **kwargs\n) -\u003e \"_models.VnetValidationFailureDetails\":\n", + "doc": "\"\"\"Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules.\n\nDescription for Verifies if this VNET is compatible with an App Service Environment by\nanalyzing the Network Security Group rules.\n\n:param parameters: VNET information.\n:type parameters: ~azure.mgmt.web.v2020_09_01.models.VnetParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VnetValidationFailureDetails, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_09_01.models.VnetValidationFailureDetails\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "parameters" + }, + "move" : { + "sync": { + "signature": "def move(\n self,\n resource_group_name, # type: str\n move_resource_envelope, # type: \"_models.CsmMoveResourceEnvelope\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Move resources between resource groups.\n\nDescription for Move resources between resource groups.\n\n:param resource_group_name: Name of the resource group to which the resource belongs.\n:type resource_group_name: str\n:param move_resource_envelope: Object that represents the resource to move.\n:type move_resource_envelope: ~azure.mgmt.web.v2020_09_01.models.CsmMoveResourceEnvelope\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def move(\n self,\n resource_group_name: str,\n move_resource_envelope: \"_models.CsmMoveResourceEnvelope\",\n **kwargs\n) -\u003e None:\n", + "doc": "\"\"\"Move resources between resource groups.\n\nDescription for Move resources between resource groups.\n\n:param resource_group_name: Name of the resource group to which the resource belongs.\n:type resource_group_name: str\n:param move_resource_envelope: Object that represents the resource to move.\n:type move_resource_envelope: ~azure.mgmt.web.v2020_09_01.models.CsmMoveResourceEnvelope\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "resource_group_name, move_resource_envelope" + }, + "validate" : { + "sync": { + "signature": "def validate(\n self,\n resource_group_name, # type: str\n validate_request, # type: \"_models.ValidateRequest\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Validate if a resource can be created.\n\nDescription for Validate if a resource can be created.\n\n:param resource_group_name: Name of the resource group to which the resource belongs.\n:type resource_group_name: str\n:param validate_request: Request with the resources to validate.\n:type validate_request: ~azure.mgmt.web.v2020_09_01.models.ValidateRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ValidateResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_09_01.models.ValidateResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def validate(\n self,\n resource_group_name: str,\n validate_request: \"_models.ValidateRequest\",\n **kwargs\n) -\u003e \"_models.ValidateResponse\":\n", + "doc": "\"\"\"Validate if a resource can be created.\n\nDescription for Validate if a resource can be created.\n\n:param resource_group_name: Name of the resource group to which the resource belongs.\n:type resource_group_name: str\n:param validate_request: Request with the resources to validate.\n:type validate_request: ~azure.mgmt.web.v2020_09_01.models.ValidateRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ValidateResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2020_09_01.models.ValidateResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "resource_group_name, validate_request" + }, + "validate_move" : { + "sync": { + "signature": "def validate_move(\n self,\n resource_group_name, # type: str\n move_resource_envelope, # type: \"_models.CsmMoveResourceEnvelope\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Validate whether a resource can be moved.\n\nDescription for Validate whether a resource can be moved.\n\n:param resource_group_name: Name of the resource group to which the resource belongs.\n:type resource_group_name: str\n:param move_resource_envelope: Object that represents the resource to move.\n:type move_resource_envelope: ~azure.mgmt.web.v2020_09_01.models.CsmMoveResourceEnvelope\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def validate_move(\n self,\n resource_group_name: str,\n move_resource_envelope: \"_models.CsmMoveResourceEnvelope\",\n **kwargs\n) -\u003e None:\n", + "doc": "\"\"\"Validate whether a resource can be moved.\n\nDescription for Validate whether a resource can be moved.\n\n:param resource_group_name: Name of the resource group to which the resource belongs.\n:type resource_group_name: str\n:param move_resource_envelope: Object that represents the resource to move.\n:type move_resource_envelope: ~azure.mgmt.web.v2020_09_01.models.CsmMoveResourceEnvelope\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "resource_group_name, move_resource_envelope" + } + }, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Iterable\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"], \"azure.core.async_paging\": [\"AsyncItemPaged\", \"AsyncList\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}" +} \ No newline at end of file diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/_web_site_management_client.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/_web_site_management_client.py new file mode 100644 index 000000000000..349db70b7430 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/_web_site_management_client.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import WebSiteManagementClientConfiguration +from .operations import AppServiceCertificateOrdersOperations +from .operations import CertificateRegistrationProviderOperations +from .operations import DomainsOperations +from .operations import TopLevelDomainsOperations +from .operations import DomainRegistrationProviderOperations +from .operations import CertificatesOperations +from .operations import DeletedWebAppsOperations +from .operations import DiagnosticsOperations +from .operations import ProviderOperations +from .operations import RecommendationsOperations +from .operations import WebSiteManagementClientOperationsMixin +from .operations import WebAppsOperations +from .operations import StaticSitesOperations +from .operations import AppServiceEnvironmentsOperations +from .operations import AppServicePlansOperations +from .operations import ResourceHealthMetadataOperations +from . import models + + +class WebSiteManagementClient(WebSiteManagementClientOperationsMixin): + """WebSite Management Client. + + :ivar app_service_certificate_orders: AppServiceCertificateOrdersOperations operations + :vartype app_service_certificate_orders: azure.mgmt.web.v2020_09_01.operations.AppServiceCertificateOrdersOperations + :ivar certificate_registration_provider: CertificateRegistrationProviderOperations operations + :vartype certificate_registration_provider: azure.mgmt.web.v2020_09_01.operations.CertificateRegistrationProviderOperations + :ivar domains: DomainsOperations operations + :vartype domains: azure.mgmt.web.v2020_09_01.operations.DomainsOperations + :ivar top_level_domains: TopLevelDomainsOperations operations + :vartype top_level_domains: azure.mgmt.web.v2020_09_01.operations.TopLevelDomainsOperations + :ivar domain_registration_provider: DomainRegistrationProviderOperations operations + :vartype domain_registration_provider: azure.mgmt.web.v2020_09_01.operations.DomainRegistrationProviderOperations + :ivar certificates: CertificatesOperations operations + :vartype certificates: azure.mgmt.web.v2020_09_01.operations.CertificatesOperations + :ivar deleted_web_apps: DeletedWebAppsOperations operations + :vartype deleted_web_apps: azure.mgmt.web.v2020_09_01.operations.DeletedWebAppsOperations + :ivar diagnostics: DiagnosticsOperations operations + :vartype diagnostics: azure.mgmt.web.v2020_09_01.operations.DiagnosticsOperations + :ivar provider: ProviderOperations operations + :vartype provider: azure.mgmt.web.v2020_09_01.operations.ProviderOperations + :ivar recommendations: RecommendationsOperations operations + :vartype recommendations: azure.mgmt.web.v2020_09_01.operations.RecommendationsOperations + :ivar web_apps: WebAppsOperations operations + :vartype web_apps: azure.mgmt.web.v2020_09_01.operations.WebAppsOperations + :ivar static_sites: StaticSitesOperations operations + :vartype static_sites: azure.mgmt.web.v2020_09_01.operations.StaticSitesOperations + :ivar app_service_environments: AppServiceEnvironmentsOperations operations + :vartype app_service_environments: azure.mgmt.web.v2020_09_01.operations.AppServiceEnvironmentsOperations + :ivar app_service_plans: AppServicePlansOperations operations + :vartype app_service_plans: azure.mgmt.web.v2020_09_01.operations.AppServicePlansOperations + :ivar resource_health_metadata: ResourceHealthMetadataOperations operations + :vartype resource_health_metadata: azure.mgmt.web.v2020_09_01.operations.ResourceHealthMetadataOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = WebSiteManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = 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._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.app_service_certificate_orders = AppServiceCertificateOrdersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.certificate_registration_provider = CertificateRegistrationProviderOperations( + self._client, self._config, self._serialize, self._deserialize) + self.domains = DomainsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.top_level_domains = TopLevelDomainsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.domain_registration_provider = DomainRegistrationProviderOperations( + self._client, self._config, self._serialize, self._deserialize) + self.certificates = CertificatesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.deleted_web_apps = DeletedWebAppsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.diagnostics = DiagnosticsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.provider = ProviderOperations( + self._client, self._config, self._serialize, self._deserialize) + self.recommendations = RecommendationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.web_apps = WebAppsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.static_sites = StaticSitesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.app_service_environments = AppServiceEnvironmentsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.app_service_plans = AppServicePlansOperations( + self._client, self._config, self._serialize, self._deserialize) + self.resource_health_metadata = ResourceHealthMetadataOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> WebSiteManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/__init__.py similarity index 81% rename from sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/_version.py rename to sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/__init__.py index 5c14e0d8303d..fc106a4f3d78 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/__init__.py @@ -6,4 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.42.0" +from ._web_site_management_client import WebSiteManagementClient +__all__ = ['WebSiteManagementClient'] diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/_configuration.py new file mode 100644 index 000000000000..43ef6707eb52 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class WebSiteManagementClientConfiguration(Configuration): + """Configuration for WebSiteManagementClient. + + 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. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(WebSiteManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-09-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-web/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.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.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/_web_site_management_client.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/_web_site_management_client.py new file mode 100644 index 000000000000..d4a0aa96e900 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/_web_site_management_client.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import WebSiteManagementClientConfiguration +from .operations import AppServiceCertificateOrdersOperations +from .operations import CertificateRegistrationProviderOperations +from .operations import DomainsOperations +from .operations import TopLevelDomainsOperations +from .operations import DomainRegistrationProviderOperations +from .operations import CertificatesOperations +from .operations import DeletedWebAppsOperations +from .operations import DiagnosticsOperations +from .operations import ProviderOperations +from .operations import RecommendationsOperations +from .operations import WebSiteManagementClientOperationsMixin +from .operations import WebAppsOperations +from .operations import StaticSitesOperations +from .operations import AppServiceEnvironmentsOperations +from .operations import AppServicePlansOperations +from .operations import ResourceHealthMetadataOperations +from .. import models + + +class WebSiteManagementClient(WebSiteManagementClientOperationsMixin): + """WebSite Management Client. + + :ivar app_service_certificate_orders: AppServiceCertificateOrdersOperations operations + :vartype app_service_certificate_orders: azure.mgmt.web.v2020_09_01.aio.operations.AppServiceCertificateOrdersOperations + :ivar certificate_registration_provider: CertificateRegistrationProviderOperations operations + :vartype certificate_registration_provider: azure.mgmt.web.v2020_09_01.aio.operations.CertificateRegistrationProviderOperations + :ivar domains: DomainsOperations operations + :vartype domains: azure.mgmt.web.v2020_09_01.aio.operations.DomainsOperations + :ivar top_level_domains: TopLevelDomainsOperations operations + :vartype top_level_domains: azure.mgmt.web.v2020_09_01.aio.operations.TopLevelDomainsOperations + :ivar domain_registration_provider: DomainRegistrationProviderOperations operations + :vartype domain_registration_provider: azure.mgmt.web.v2020_09_01.aio.operations.DomainRegistrationProviderOperations + :ivar certificates: CertificatesOperations operations + :vartype certificates: azure.mgmt.web.v2020_09_01.aio.operations.CertificatesOperations + :ivar deleted_web_apps: DeletedWebAppsOperations operations + :vartype deleted_web_apps: azure.mgmt.web.v2020_09_01.aio.operations.DeletedWebAppsOperations + :ivar diagnostics: DiagnosticsOperations operations + :vartype diagnostics: azure.mgmt.web.v2020_09_01.aio.operations.DiagnosticsOperations + :ivar provider: ProviderOperations operations + :vartype provider: azure.mgmt.web.v2020_09_01.aio.operations.ProviderOperations + :ivar recommendations: RecommendationsOperations operations + :vartype recommendations: azure.mgmt.web.v2020_09_01.aio.operations.RecommendationsOperations + :ivar web_apps: WebAppsOperations operations + :vartype web_apps: azure.mgmt.web.v2020_09_01.aio.operations.WebAppsOperations + :ivar static_sites: StaticSitesOperations operations + :vartype static_sites: azure.mgmt.web.v2020_09_01.aio.operations.StaticSitesOperations + :ivar app_service_environments: AppServiceEnvironmentsOperations operations + :vartype app_service_environments: azure.mgmt.web.v2020_09_01.aio.operations.AppServiceEnvironmentsOperations + :ivar app_service_plans: AppServicePlansOperations operations + :vartype app_service_plans: azure.mgmt.web.v2020_09_01.aio.operations.AppServicePlansOperations + :ivar resource_health_metadata: ResourceHealthMetadataOperations operations + :vartype resource_health_metadata: azure.mgmt.web.v2020_09_01.aio.operations.ResourceHealthMetadataOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = WebSiteManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = 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._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.app_service_certificate_orders = AppServiceCertificateOrdersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.certificate_registration_provider = CertificateRegistrationProviderOperations( + self._client, self._config, self._serialize, self._deserialize) + self.domains = DomainsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.top_level_domains = TopLevelDomainsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.domain_registration_provider = DomainRegistrationProviderOperations( + self._client, self._config, self._serialize, self._deserialize) + self.certificates = CertificatesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.deleted_web_apps = DeletedWebAppsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.diagnostics = DiagnosticsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.provider = ProviderOperations( + self._client, self._config, self._serialize, self._deserialize) + self.recommendations = RecommendationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.web_apps = WebAppsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.static_sites = StaticSitesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.app_service_environments = AppServiceEnvironmentsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.app_service_plans = AppServicePlansOperations( + self._client, self._config, self._serialize, self._deserialize) + self.resource_health_metadata = ResourceHealthMetadataOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "WebSiteManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/__init__.py new file mode 100644 index 000000000000..8f414125deed --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/__init__.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._app_service_certificate_orders_operations import AppServiceCertificateOrdersOperations +from ._certificate_registration_provider_operations import CertificateRegistrationProviderOperations +from ._domains_operations import DomainsOperations +from ._top_level_domains_operations import TopLevelDomainsOperations +from ._domain_registration_provider_operations import DomainRegistrationProviderOperations +from ._certificates_operations import CertificatesOperations +from ._deleted_web_apps_operations import DeletedWebAppsOperations +from ._diagnostics_operations import DiagnosticsOperations +from ._provider_operations import ProviderOperations +from ._recommendations_operations import RecommendationsOperations +from ._web_site_management_client_operations import WebSiteManagementClientOperationsMixin +from ._web_apps_operations import WebAppsOperations +from ._static_sites_operations import StaticSitesOperations +from ._app_service_environments_operations import AppServiceEnvironmentsOperations +from ._app_service_plans_operations import AppServicePlansOperations +from ._resource_health_metadata_operations import ResourceHealthMetadataOperations + +__all__ = [ + 'AppServiceCertificateOrdersOperations', + 'CertificateRegistrationProviderOperations', + 'DomainsOperations', + 'TopLevelDomainsOperations', + 'DomainRegistrationProviderOperations', + 'CertificatesOperations', + 'DeletedWebAppsOperations', + 'DiagnosticsOperations', + 'ProviderOperations', + 'RecommendationsOperations', + 'WebSiteManagementClientOperationsMixin', + 'WebAppsOperations', + 'StaticSitesOperations', + 'AppServiceEnvironmentsOperations', + 'AppServicePlansOperations', + 'ResourceHealthMetadataOperations', +] diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_app_service_certificate_orders_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_app_service_certificate_orders_operations.py new file mode 100644 index 000000000000..6e39e565b9c5 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_app_service_certificate_orders_operations.py @@ -0,0 +1,1491 @@ +# 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, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AppServiceCertificateOrdersOperations: + """AppServiceCertificateOrdersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.AppServiceCertificateOrderCollection"]: + """List all certificate orders in a subscription. + + Description for List all certificate orders in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceCertificateOrderCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrderCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrderCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateOrderCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/certificateOrders'} # type: ignore + + async def validate_purchase_information( + self, + app_service_certificate_order: "_models.AppServiceCertificateOrder", + **kwargs + ) -> None: + """Validate information for a certificate order. + + Description for Validate information for a certificate order. + + :param app_service_certificate_order: Information for a certificate order. + :type app_service_certificate_order: ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrder + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_purchase_information.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_service_certificate_order, 'AppServiceCertificateOrder') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + validate_purchase_information.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/validateCertificateRegistrationInformation'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.AppServiceCertificateOrderCollection"]: + """Get certificate orders in a resource group. + + Description for Get certificate orders in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 AppServiceCertificateOrderCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrderCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrderCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateOrderCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.CertificateRegistration/certificateOrders'} # type: ignore + + async def get( + self, + resource_group_name: str, + certificate_order_name: str, + **kwargs + ) -> "_models.AppServiceCertificateOrder": + """Get a certificate order. + + Description for Get a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order.. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateOrder, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrder + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + certificate_order_name: str, + certificate_distinguished_name: "_models.AppServiceCertificateOrder", + **kwargs + ) -> "_models.AppServiceCertificateOrder": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_distinguished_name, 'AppServiceCertificateOrder') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + certificate_order_name: str, + certificate_distinguished_name: "_models.AppServiceCertificateOrder", + **kwargs + ) -> AsyncLROPoller["_models.AppServiceCertificateOrder"]: + """Create or update a certificate purchase order. + + Description for Create or update a certificate purchase order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param certificate_distinguished_name: Distinguished name to use for the certificate order. + :type certificate_distinguished_name: ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrder + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 AppServiceCertificateOrder or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrder] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + certificate_order_name=certificate_order_name, + certificate_distinguished_name=certificate_distinguished_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + certificate_order_name: str, + **kwargs + ) -> None: + """Delete an existing certificate order. + + Description for Delete an existing certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + certificate_order_name: str, + certificate_distinguished_name: "_models.AppServiceCertificateOrderPatchResource", + **kwargs + ) -> "_models.AppServiceCertificateOrder": + """Create or update a certificate purchase order. + + Description for Create or update a certificate purchase order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param certificate_distinguished_name: Distinguished name to use for the certificate order. + :type certificate_distinguished_name: ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrderPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateOrder, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrder + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_distinguished_name, 'AppServiceCertificateOrderPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + def list_certificates( + self, + resource_group_name: str, + certificate_order_name: str, + **kwargs + ) -> AsyncIterable["_models.AppServiceCertificateCollection"]: + """List all certificates associated with a certificate order. + + Description for List all certificates associated with a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceCertificateCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_certificates.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates'} # type: ignore + + async def get_certificate( + self, + resource_group_name: str, + certificate_order_name: str, + name: str, + **kwargs + ) -> "_models.AppServiceCertificateResource": + """Get the certificate associated with a certificate order. + + Description for Get the certificate associated with a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + async def _create_or_update_certificate_initial( + self, + resource_group_name: str, + certificate_order_name: str, + name: str, + key_vault_certificate: "_models.AppServiceCertificateResource", + **kwargs + ) -> "_models.AppServiceCertificateResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_certificate_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key_vault_certificate, 'AppServiceCertificateResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_certificate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + async def begin_create_or_update_certificate( + self, + resource_group_name: str, + certificate_order_name: str, + name: str, + key_vault_certificate: "_models.AppServiceCertificateResource", + **kwargs + ) -> AsyncLROPoller["_models.AppServiceCertificateResource"]: + """Creates or updates a certificate and associates with key vault secret. + + Description for Creates or updates a certificate and associates with key vault secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :param key_vault_certificate: Key vault certificate resource Id. + :type key_vault_certificate: ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 AppServiceCertificateResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_certificate_initial( + resource_group_name=resource_group_name, + certificate_order_name=certificate_order_name, + name=name, + key_vault_certificate=key_vault_certificate, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + async def delete_certificate( + self, + resource_group_name: str, + certificate_order_name: str, + name: str, + **kwargs + ) -> None: + """Delete the certificate associated with a certificate order. + + Description for Delete the certificate associated with a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + async def update_certificate( + self, + resource_group_name: str, + certificate_order_name: str, + name: str, + key_vault_certificate: "_models.AppServiceCertificatePatchResource", + **kwargs + ) -> "_models.AppServiceCertificateResource": + """Creates or updates a certificate and associates with key vault secret. + + Description for Creates or updates a certificate and associates with key vault secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :param key_vault_certificate: Key vault certificate resource Id. + :type key_vault_certificate: ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificatePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key_vault_certificate, 'AppServiceCertificatePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + async def reissue( + self, + resource_group_name: str, + certificate_order_name: str, + reissue_certificate_order_request: "_models.ReissueCertificateOrderRequest", + **kwargs + ) -> None: + """Reissue an existing certificate order. + + Description for Reissue an existing certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param reissue_certificate_order_request: Parameters for the reissue. + :type reissue_certificate_order_request: ~azure.mgmt.web.v2020_09_01.models.ReissueCertificateOrderRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.reissue.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(reissue_certificate_order_request, 'ReissueCertificateOrderRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reissue.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/reissue'} # type: ignore + + async def renew( + self, + resource_group_name: str, + certificate_order_name: str, + renew_certificate_order_request: "_models.RenewCertificateOrderRequest", + **kwargs + ) -> None: + """Renew an existing certificate order. + + Description for Renew an existing certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param renew_certificate_order_request: Renew parameters. + :type renew_certificate_order_request: ~azure.mgmt.web.v2020_09_01.models.RenewCertificateOrderRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.renew.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(renew_certificate_order_request, 'RenewCertificateOrderRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + renew.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/renew'} # type: ignore + + async def resend_email( + self, + resource_group_name: str, + certificate_order_name: str, + **kwargs + ) -> None: + """Resend certificate email. + + Description for Resend certificate email. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.resend_email.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + resend_email.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendEmail'} # type: ignore + + async def resend_request_emails( + self, + resource_group_name: str, + certificate_order_name: str, + name_identifier: "_models.NameIdentifier", + **kwargs + ) -> None: + """Verify domain ownership for this certificate order. + + Description for Verify domain ownership for this certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name_identifier: Email address. + :type name_identifier: ~azure.mgmt.web.v2020_09_01.models.NameIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.resend_request_emails.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(name_identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + resend_request_emails.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendRequestEmails'} # type: ignore + + async def retrieve_site_seal( + self, + resource_group_name: str, + certificate_order_name: str, + site_seal_request: "_models.SiteSealRequest", + **kwargs + ) -> "_models.SiteSeal": + """Verify domain ownership for this certificate order. + + Description for Verify domain ownership for this certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param site_seal_request: Site seal request. + :type site_seal_request: ~azure.mgmt.web.v2020_09_01.models.SiteSealRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSeal, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteSeal + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSeal"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.retrieve_site_seal.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_seal_request, 'SiteSealRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteSeal', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_site_seal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/retrieveSiteSeal'} # type: ignore + + async def verify_domain_ownership( + self, + resource_group_name: str, + certificate_order_name: str, + **kwargs + ) -> None: + """Verify domain ownership for this certificate order. + + Description for Verify domain ownership for this certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.verify_domain_ownership.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + verify_domain_ownership.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/verifyDomainOwnership'} # type: ignore + + async def retrieve_certificate_actions( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> List["_models.CertificateOrderAction"]: + """Retrieve the list of certificate actions. + + Description for Retrieve the list of certificate actions. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate order. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of CertificateOrderAction, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.CertificateOrderAction] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.CertificateOrderAction"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.retrieve_certificate_actions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[CertificateOrderAction]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_certificate_actions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveCertificateActions'} # type: ignore + + async def retrieve_certificate_email_history( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> List["_models.CertificateEmail"]: + """Retrieve email history. + + Description for Retrieve email history. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate order. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of CertificateEmail, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.CertificateEmail] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.CertificateEmail"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.retrieve_certificate_email_history.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[CertificateEmail]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_certificate_email_history.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveEmailHistory'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_app_service_environments_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_app_service_environments_operations.py new file mode 100644 index 000000000000..cf98ca3dcaf1 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_app_service_environments_operations.py @@ -0,0 +1,3246 @@ +# 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, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AppServiceEnvironmentsOperations: + """AppServiceEnvironmentsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.AppServiceEnvironmentCollection"]: + """Get all App Service Environments for a subscription. + + Description for Get all App Service Environments for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceEnvironmentCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.AppServiceEnvironmentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceEnvironmentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/hostingEnvironments'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.AppServiceEnvironmentCollection"]: + """Get all App Service Environments in a resource group. + + Description for Get all App Service Environments in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 AppServiceEnvironmentCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.AppServiceEnvironmentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceEnvironmentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.Web/hostingEnvironments'} # type: ignore + + async def get( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.AppServiceEnvironmentResource": + """Get the properties of an App Service Environment. + + Description for Get the properties of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceEnvironmentResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AppServiceEnvironmentResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + name: str, + hosting_environment_envelope: "_models.AppServiceEnvironmentResource", + **kwargs + ) -> "_models.AppServiceEnvironmentResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(hosting_environment_envelope, 'AppServiceEnvironmentResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + name: str, + hosting_environment_envelope: "_models.AppServiceEnvironmentResource", + **kwargs + ) -> AsyncLROPoller["_models.AppServiceEnvironmentResource"]: + """Create or update an App Service Environment. + + Description for Create or update an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param hosting_environment_envelope: Configuration details of the App Service Environment. + :type hosting_environment_envelope: ~azure.mgmt.web.v2020_09_01.models.AppServiceEnvironmentResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 AppServiceEnvironmentResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.AppServiceEnvironmentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + hosting_environment_envelope=hosting_environment_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + name: str, + force_delete: Optional[bool] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if force_delete is not None: + query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **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(_models.DefaultErrorResponse, 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.Web/hostingEnvironments/{name}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + name: str, + force_delete: Optional[bool] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Delete an App Service Environment. + + Description for Delete an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param force_delete: Specify :code:`true` to force the deletion even if the App + Service Environment contains resources. The default is :code:`false`. + :type force_delete: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + name=name, + force_delete=force_delete, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + async def update( + self, + resource_group_name: str, + name: str, + hosting_environment_envelope: "_models.AppServiceEnvironmentPatchResource", + **kwargs + ) -> "_models.AppServiceEnvironmentResource": + """Create or update an App Service Environment. + + Description for Create or update an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param hosting_environment_envelope: Configuration details of the App Service Environment. + :type hosting_environment_envelope: ~azure.mgmt.web.v2020_09_01.models.AppServiceEnvironmentPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceEnvironmentResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AppServiceEnvironmentResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(hosting_environment_envelope, 'AppServiceEnvironmentPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + def list_capacities( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.StampCapacityCollection"]: + """Get the used, available, and total worker capacity an App Service Environment. + + Description for Get the used, available, and total worker capacity an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StampCapacityCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.StampCapacityCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StampCapacityCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_capacities.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StampCapacityCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_capacities.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/compute'} # type: ignore + + async def get_vip_info( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.AddressResponse": + """Get IP addresses assigned to an App Service Environment. + + Description for Get IP addresses assigned to an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AddressResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AddressResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_vip_info.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AddressResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vip_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/virtualip'} # type: ignore + + async def _change_vnet_initial( + self, + resource_group_name: str, + name: str, + vnet_info: "_models.VirtualNetworkProfile", + **kwargs + ) -> "_models.WebAppCollection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._change_vnet_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vnet_info, 'VirtualNetworkProfile') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _change_vnet_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork'} # type: ignore + + async def begin_change_vnet( + self, + resource_group_name: str, + name: str, + vnet_info: "_models.VirtualNetworkProfile", + **kwargs + ) -> AsyncLROPoller[AsyncItemPaged["_models.WebAppCollection"]]: + """Move an App Service Environment to a different VNET. + + Description for Move an App Service Environment to a different VNET. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param vnet_info: Details for the new virtual network. + :type vnet_info: ~azure.mgmt.web.v2020_09_01.models.VirtualNetworkProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 an iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.WebAppCollection]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.change_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vnet_info, 'VirtualNetworkProfile') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vnet_info, 'VirtualNetworkProfile') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._change_vnet_initial( + resource_group_name=resource_group_name, + name=name, + vnet_info=vnet_info, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + async def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return await get_next(next_link) + + return AsyncItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_change_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork'} # type: ignore + + async def list_diagnostics( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> List["_models.HostingEnvironmentDiagnostics"]: + """Get diagnostic information for an App Service Environment. + + Description for Get diagnostic information for an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of HostingEnvironmentDiagnostics, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentDiagnostics] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.HostingEnvironmentDiagnostics"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_diagnostics.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[HostingEnvironmentDiagnostics]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_diagnostics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics'} # type: ignore + + async def get_diagnostics_item( + self, + resource_group_name: str, + name: str, + diagnostics_name: str, + **kwargs + ) -> "_models.HostingEnvironmentDiagnostics": + """Get a diagnostics item for an App Service Environment. + + Description for Get a diagnostics item for an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param diagnostics_name: Name of the diagnostics item. + :type diagnostics_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostingEnvironmentDiagnostics, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentDiagnostics + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostingEnvironmentDiagnostics"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostics_item.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'diagnosticsName': self._serialize.url("diagnostics_name", diagnostics_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostingEnvironmentDiagnostics', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostics_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics/{diagnosticsName}'} # type: ignore + + def get_inbound_network_dependencies_endpoints( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.InboundEnvironmentEndpointCollection"]: + """Get the network endpoints of all inbound dependencies of an App Service Environment. + + Description for Get the network endpoints of all inbound dependencies of an App Service + Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either InboundEnvironmentEndpointCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.InboundEnvironmentEndpointCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundEnvironmentEndpointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_inbound_network_dependencies_endpoints.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('InboundEnvironmentEndpointCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_inbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/inboundNetworkDependenciesEndpoints'} # type: ignore + + def list_multi_role_pools( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.WorkerPoolCollection"]: + """Get all multi-role pools. + + Description for Get all multi-role pools. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkerPoolCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.WorkerPoolCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_pools.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkerPoolCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_multi_role_pools.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools'} # type: ignore + + async def get_multi_role_pool( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.WorkerPoolResource": + """Get properties of a multi-role pool. + + Description for Get properties of a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_multi_role_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_multi_role_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + async def _create_or_update_multi_role_pool_initial( + self, + resource_group_name: str, + name: str, + multi_role_pool_envelope: "_models.WorkerPoolResource", + **kwargs + ) -> "_models.WorkerPoolResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_multi_role_pool_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(multi_role_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_multi_role_pool_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + async def begin_create_or_update_multi_role_pool( + self, + resource_group_name: str, + name: str, + multi_role_pool_envelope: "_models.WorkerPoolResource", + **kwargs + ) -> AsyncLROPoller["_models.WorkerPoolResource"]: + """Create or update a multi-role pool. + + Description for Create or update a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param multi_role_pool_envelope: Properties of the multi-role pool. + :type multi_role_pool_envelope: ~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 WorkerPoolResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_multi_role_pool_initial( + resource_group_name=resource_group_name, + name=name, + multi_role_pool_envelope=multi_role_pool_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_multi_role_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + async def update_multi_role_pool( + self, + resource_group_name: str, + name: str, + multi_role_pool_envelope: "_models.WorkerPoolResource", + **kwargs + ) -> "_models.WorkerPoolResource": + """Create or update a multi-role pool. + + Description for Create or update a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param multi_role_pool_envelope: Properties of the multi-role pool. + :type multi_role_pool_envelope: ~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_multi_role_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(multi_role_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_multi_role_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + def list_multi_role_pool_instance_metric_definitions( + self, + resource_group_name: str, + name: str, + instance: str, + **kwargs + ) -> AsyncIterable["_models.ResourceMetricDefinitionCollection"]: + """Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. + + Description for Get metric definitions for a specific instance of a multi-role pool of an App + Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param instance: Name of the instance in the multi-role pool. + :type instance: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_pool_instance_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instance': self._serialize.url("instance", instance, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_multi_role_pool_instance_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions'} # type: ignore + + def list_multi_role_metric_definitions( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.ResourceMetricDefinitionCollection"]: + """Get metric definitions for a multi-role pool of an App Service Environment. + + Description for Get metric definitions for a multi-role pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_multi_role_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions'} # type: ignore + + def list_multi_role_pool_skus( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.SkuInfoCollection"]: + """Get available SKUs for scaling a multi-role pool. + + Description for Get available SKUs for scaling a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.SkuInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_pool_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SkuInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_multi_role_pool_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/skus'} # type: ignore + + def list_multi_role_usages( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.UsageCollection"]: + """Get usage metrics for a multi-role pool of an App Service Environment. + + Description for Get usage metrics for a multi-role pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsageCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.UsageCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('UsageCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_multi_role_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/usages'} # type: ignore + + async def list_operations( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> List["_models.Operation"]: + """List all currently running operations on the App Service Environment. + + Description for List all currently running operations on the App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Operation, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.Operation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Operation"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[Operation]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_operations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations'} # type: ignore + + def get_outbound_network_dependencies_endpoints( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.OutboundEnvironmentEndpointCollection"]: + """Get the network endpoints of all outbound dependencies of an App Service Environment. + + Description for Get the network endpoints of all outbound dependencies of an App Service + Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.OutboundEnvironmentEndpointCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_outbound_network_dependencies_endpoints.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OutboundEnvironmentEndpointCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/outboundNetworkDependenciesEndpoints'} # type: ignore + + async def reboot( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Reboot all machines in an App Service Environment. + + Description for Reboot all machines in an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.reboot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reboot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/reboot'} # type: ignore + + async def _resume_initial( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.WebAppCollection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._resume_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _resume_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume'} # type: ignore + + async def begin_resume( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncLROPoller[AsyncItemPaged["_models.WebAppCollection"]]: + """Resume an App Service Environment. + + Description for Resume an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type 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: True for ARMPolling, False for no polling, or a + polling object for 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 an iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.WebAppCollection]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.resume.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._resume_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + async def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return await get_next(next_link) + + return AsyncItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume'} # type: ignore + + def list_app_service_plans( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.AppServicePlanCollection"]: + """Get all App Service plans in an App Service Environment. + + Description for Get all App Service plans in an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServicePlanCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.AppServicePlanCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlanCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_app_service_plans.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServicePlanCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_app_service_plans.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/serverfarms'} # type: ignore + + def list_web_apps( + self, + resource_group_name: str, + name: str, + properties_to_include: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.WebAppCollection"]: + """Get all apps in an App Service Environment. + + Description for Get all apps in an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param properties_to_include: Comma separated list of app properties to include. + :type properties_to_include: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_apps.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if properties_to_include is not None: + query_parameters['propertiesToInclude'] = self._serialize.query("properties_to_include", properties_to_include, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_web_apps.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/sites'} # type: ignore + + async def _suspend_initial( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.WebAppCollection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._suspend_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _suspend_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend'} # type: ignore + + async def begin_suspend( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncLROPoller[AsyncItemPaged["_models.WebAppCollection"]]: + """Suspend an App Service Environment. + + Description for Suspend an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type 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: True for ARMPolling, False for no polling, or a + polling object for 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 an iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.WebAppCollection]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.suspend.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._suspend_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + async def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return await get_next(next_link) + + return AsyncItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_suspend.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend'} # type: ignore + + def list_usages( + self, + resource_group_name: str, + name: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.CsmUsageQuotaCollection"]: + """Get global usage metrics of an App Service Environment. + + Description for Get global usage metrics of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq + 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages'} # type: ignore + + def list_worker_pools( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.WorkerPoolCollection"]: + """Get all worker pools of an App Service Environment. + + Description for Get all worker pools of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkerPoolCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.WorkerPoolCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_worker_pools.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkerPoolCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_worker_pools.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools'} # type: ignore + + async def get_worker_pool( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + **kwargs + ) -> "_models.WorkerPoolResource": + """Get properties of a worker pool. + + Description for Get properties of a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_worker_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_worker_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + async def _create_or_update_worker_pool_initial( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + worker_pool_envelope: "_models.WorkerPoolResource", + **kwargs + ) -> "_models.WorkerPoolResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_worker_pool_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(worker_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_worker_pool_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + async def begin_create_or_update_worker_pool( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + worker_pool_envelope: "_models.WorkerPoolResource", + **kwargs + ) -> AsyncLROPoller["_models.WorkerPoolResource"]: + """Create or update a worker pool. + + Description for Create or update a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :param worker_pool_envelope: Properties of the worker pool. + :type worker_pool_envelope: ~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 WorkerPoolResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_worker_pool_initial( + resource_group_name=resource_group_name, + name=name, + worker_pool_name=worker_pool_name, + worker_pool_envelope=worker_pool_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_worker_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + async def update_worker_pool( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + worker_pool_envelope: "_models.WorkerPoolResource", + **kwargs + ) -> "_models.WorkerPoolResource": + """Create or update a worker pool. + + Description for Create or update a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :param worker_pool_envelope: Properties of the worker pool. + :type worker_pool_envelope: ~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_worker_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(worker_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_worker_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + def list_worker_pool_instance_metric_definitions( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + instance: str, + **kwargs + ) -> AsyncIterable["_models.ResourceMetricDefinitionCollection"]: + """Get metric definitions for a specific instance of a worker pool of an App Service Environment. + + Description for Get metric definitions for a specific instance of a worker pool of an App + Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :param instance: Name of the instance in the worker pool. + :type instance: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_worker_pool_instance_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'instance': self._serialize.url("instance", instance, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_worker_pool_instance_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metricdefinitions'} # type: ignore + + def list_web_worker_metric_definitions( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + **kwargs + ) -> AsyncIterable["_models.ResourceMetricDefinitionCollection"]: + """Get metric definitions for a worker pool of an App Service Environment. + + Description for Get metric definitions for a worker pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_worker_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_web_worker_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metricdefinitions'} # type: ignore + + def list_worker_pool_skus( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + **kwargs + ) -> AsyncIterable["_models.SkuInfoCollection"]: + """Get available SKUs for scaling a worker pool. + + Description for Get available SKUs for scaling a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.SkuInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_worker_pool_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SkuInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_worker_pool_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/skus'} # type: ignore + + def list_web_worker_usages( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + **kwargs + ) -> AsyncIterable["_models.UsageCollection"]: + """Get usage metrics for a worker pool of an App Service Environment. + + Description for Get usage metrics for a worker pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsageCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.UsageCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_worker_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('UsageCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_web_worker_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/usages'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_app_service_plans_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_app_service_plans_operations.py new file mode 100644 index 000000000000..72cfe2c63901 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_app_service_plans_operations.py @@ -0,0 +1,2007 @@ +# 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, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AppServicePlansOperations: + """AppServicePlansOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + detailed: Optional[bool] = None, + **kwargs + ) -> AsyncIterable["_models.AppServicePlanCollection"]: + """Get all App Service plans for a subscription. + + Description for Get all App Service plans for a subscription. + + :param detailed: Specify :code:`true` to return all App Service plan properties. + The default is :code:`false`, which returns a subset of the properties. + Retrieval of all properties may increase the API latency. + :type detailed: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServicePlanCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.AppServicePlanCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlanCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if detailed is not None: + query_parameters['detailed'] = self._serialize.query("detailed", detailed, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServicePlanCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/serverfarms'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.AppServicePlanCollection"]: + """Get all App Service plans in a resource group. + + Description for Get all App Service plans in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 AppServicePlanCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.AppServicePlanCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlanCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServicePlanCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.Web/serverfarms'} # type: ignore + + async def get( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> Optional["_models.AppServicePlan"]: + """Get an App Service plan. + + Description for Get an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServicePlan, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AppServicePlan or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AppServicePlan"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + name: str, + app_service_plan: "_models.AppServicePlan", + **kwargs + ) -> "_models.AppServicePlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlan"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_service_plan, 'AppServicePlan') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + name: str, + app_service_plan: "_models.AppServicePlan", + **kwargs + ) -> AsyncLROPoller["_models.AppServicePlan"]: + """Creates or updates an App Service Plan. + + Description for Creates or updates an App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param app_service_plan: Details of the App Service plan. + :type app_service_plan: ~azure.mgmt.web.v2020_09_01.models.AppServicePlan + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 AppServicePlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.AppServicePlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlan"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + app_service_plan=app_service_plan, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Delete an App Service plan. + + Description for Delete an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + async def update( + self, + resource_group_name: str, + name: str, + app_service_plan: "_models.AppServicePlanPatchResource", + **kwargs + ) -> "_models.AppServicePlan": + """Creates or updates an App Service Plan. + + Description for Creates or updates an App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param app_service_plan: Details of the App Service plan. + :type app_service_plan: ~azure.mgmt.web.v2020_09_01.models.AppServicePlanPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServicePlan, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AppServicePlan + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlan"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_service_plan, 'AppServicePlanPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + async def list_capabilities( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> List["_models.Capability"]: + """List all capabilities of an App Service plan. + + Description for List all capabilities of an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Capability, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.Capability] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Capability"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_capabilities.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[Capability]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_capabilities.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/capabilities'} # type: ignore + + async def get_hybrid_connection( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + **kwargs + ) -> "_models.HybridConnection": + """Retrieve a Hybrid Connection in use in an App Service plan. + + Description for Retrieve a Hybrid Connection in use in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: Name of the Service Bus namespace. + :type namespace_name: str + :param relay_name: Name of the Service Bus relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def delete_hybrid_connection( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + **kwargs + ) -> None: + """Delete a Hybrid Connection in use in an App Service plan. + + Description for Delete a Hybrid Connection in use in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: Name of the Service Bus namespace. + :type namespace_name: str + :param relay_name: Name of the Service Bus relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def list_hybrid_connection_keys( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + **kwargs + ) -> "_models.HybridConnectionKey": + """Get the send key name and value of a Hybrid Connection. + + Description for Get the send key name and value of a Hybrid Connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: The name of the Service Bus namespace. + :type namespace_name: str + :param relay_name: The name of the Service Bus relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnectionKey, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnectionKey + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnectionKey"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_hybrid_connection_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnectionKey', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_hybrid_connection_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'} # type: ignore + + def list_web_apps_by_hybrid_connection( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + **kwargs + ) -> AsyncIterable["_models.ResourceCollection"]: + """Get all apps that use a Hybrid Connection in an App Service Plan. + + Description for Get all apps that use a Hybrid Connection in an App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: Name of the Hybrid Connection namespace. + :type namespace_name: str + :param relay_name: Name of the Hybrid Connection relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_apps_by_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_web_apps_by_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/sites'} # type: ignore + + async def get_hybrid_connection_plan_limit( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.HybridConnectionLimits": + """Get the maximum number of Hybrid Connections allowed in an App Service plan. + + Description for Get the maximum number of Hybrid Connections allowed in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnectionLimits, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnectionLimits + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnectionLimits"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection_plan_limit.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnectionLimits', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection_plan_limit.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionPlanLimits/limit'} # type: ignore + + def list_hybrid_connections( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.HybridConnectionCollection"]: + """Retrieve all Hybrid Connections in use in an App Service plan. + + Description for Retrieve all Hybrid Connections in use in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HybridConnectionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.HybridConnectionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnectionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_hybrid_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('HybridConnectionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_hybrid_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionRelays'} # type: ignore + + async def restart_web_apps( + self, + resource_group_name: str, + name: str, + soft_restart: Optional[bool] = None, + **kwargs + ) -> None: + """Restart all apps in an App Service plan. + + Description for Restart all apps in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param soft_restart: Specify :code:`true` to perform a soft restart, applies the + configuration settings and restarts the apps if necessary. The default is + :code:`false`, which always restarts and reprovisions the apps. + :type soft_restart: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.restart_web_apps.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if soft_restart is not None: + query_parameters['softRestart'] = self._serialize.query("soft_restart", soft_restart, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restart_web_apps.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/restartSites'} # type: ignore + + def list_web_apps( + self, + resource_group_name: str, + name: str, + skip_token: Optional[str] = None, + filter: Optional[str] = None, + top: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.WebAppCollection"]: + """Get all apps associated with an App Service plan. + + Description for Get all apps associated with an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param skip_token: Skip to a web app in the list of webapps associated with app service plan. + If specified, the resulting list will contain web apps starting from (including) the skipToken. + Otherwise, the resulting list contains web apps from the start of the list. + :type skip_token: str + :param filter: Supported filter: $filter=state eq running. Returns only web apps that are + currently running. + :type filter: str + :param top: List page size. If specified, results are paged. + :type top: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_apps.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_web_apps.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites'} # type: ignore + + async def get_server_farm_skus( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> object: + """Gets all selectable SKUs for a given App Service Plan. + + Description for Gets all selectable SKUs for a given App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of App Service Plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: object, or the result of cls(response) + :rtype: object + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[object] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_server_farm_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_server_farm_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/skus'} # type: ignore + + def list_usages( + self, + resource_group_name: str, + name: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.CsmUsageQuotaCollection"]: + """Gets server farm usage information. + + Description for Gets server farm usage information. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of App Service Plan. + :type name: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/usages'} # type: ignore + + async def list_vnets( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> List["_models.VnetInfo"]: + """Get all Virtual Networks associated with an App Service plan. + + Description for Get all Virtual Networks associated with an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetInfo, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.VnetInfo] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_vnets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetInfo]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_vnets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections'} # type: ignore + + async def get_vnet_from_server_farm( + self, + resource_group_name: str, + name: str, + vnet_name: str, + **kwargs + ) -> Optional["_models.VnetInfo"]: + """Get a Virtual Network associated with an App Service plan. + + Description for Get a Virtual Network associated with an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VnetInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_from_server_farm.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_from_server_farm.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def get_vnet_gateway( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + **kwargs + ) -> "_models.VnetGateway": + """Get a Virtual Network gateway. + + Description for Get a Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Only the 'primary' gateway is supported. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + async def update_vnet_gateway( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + connection_envelope: "_models.VnetGateway", + **kwargs + ) -> "_models.VnetGateway": + """Update a Virtual Network gateway. + + Description for Update a Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Only the 'primary' gateway is supported. + :type gateway_name: str + :param connection_envelope: Definition of the gateway. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + async def list_routes_for_vnet( + self, + resource_group_name: str, + name: str, + vnet_name: str, + **kwargs + ) -> List["_models.VnetRoute"]: + """Get all routes that are associated with a Virtual Network in an App Service plan. + + Description for Get all routes that are associated with a Virtual Network in an App Service + plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetRoute, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.VnetRoute] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetRoute"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_routes_for_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetRoute]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_routes_for_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes'} # type: ignore + + async def get_route_for_vnet( + self, + resource_group_name: str, + name: str, + vnet_name: str, + route_name: str, + **kwargs + ) -> Optional[List["_models.VnetRoute"]]: + """Get a Virtual Network route in an App Service plan. + + Description for Get a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetRoute, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.VnetRoute] or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[List["_models.VnetRoute"]]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_route_for_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[VnetRoute]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_route_for_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + async def create_or_update_vnet_route( + self, + resource_group_name: str, + name: str, + vnet_name: str, + route_name: str, + route: "_models.VnetRoute", + **kwargs + ) -> Optional["_models.VnetRoute"]: + """Create or update a Virtual Network route in an App Service plan. + + Description for Create or update a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :param route: Definition of the Virtual Network route. + :type route: ~azure.mgmt.web.v2020_09_01.models.VnetRoute + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetRoute, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetRoute or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VnetRoute"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_route.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route, 'VnetRoute') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 400, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VnetRoute', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + async def delete_vnet_route( + self, + resource_group_name: str, + name: str, + vnet_name: str, + route_name: str, + **kwargs + ) -> None: + """Delete a Virtual Network route in an App Service plan. + + Description for Delete a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_vnet_route.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_vnet_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + async def update_vnet_route( + self, + resource_group_name: str, + name: str, + vnet_name: str, + route_name: str, + route: "_models.VnetRoute", + **kwargs + ) -> Optional["_models.VnetRoute"]: + """Create or update a Virtual Network route in an App Service plan. + + Description for Create or update a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :param route: Definition of the Virtual Network route. + :type route: ~azure.mgmt.web.v2020_09_01.models.VnetRoute + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetRoute, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetRoute or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VnetRoute"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_route.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route, 'VnetRoute') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 400, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VnetRoute', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + async def reboot_worker( + self, + resource_group_name: str, + name: str, + worker_name: str, + **kwargs + ) -> None: + """Reboot a worker machine in an App Service plan. + + Description for Reboot a worker machine in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param worker_name: Name of worker machine, which typically starts with RD. + :type worker_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.reboot_worker.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerName': self._serialize.url("worker_name", worker_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reboot_worker.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/workers/{workerName}/reboot'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_certificate_registration_provider_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_certificate_registration_provider_operations.py new file mode 100644 index 000000000000..590540ed7050 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_certificate_registration_provider_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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CertificateRegistrationProviderOperations: + """CertificateRegistrationProviderOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_operations( + self, + **kwargs + ) -> AsyncIterable["_models.CsmOperationCollection"]: + """Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. + + Description for Implements Csm operations Api to exposes the list of available Csm Apis under + the resource provider. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmOperationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.CsmOperationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmOperationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CsmOperationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_operations.metadata = {'url': '/providers/Microsoft.CertificateRegistration/operations'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_certificates_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_certificates_operations.py new file mode 100644 index 000000000000..5026824326f7 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_certificates_operations.py @@ -0,0 +1,441 @@ +# 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, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CertificatesOperations: + """CertificatesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.CertificateCollection"]: + """Get all certificates for a subscription. + + Description for Get all certificates for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CertificateCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.CertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/certificates'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.CertificateCollection"]: + """Get all certificates in a resource group. + + Description for Get all certificates in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 CertificateCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.CertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.Web/certificates'} # type: ignore + + async def get( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.Certificate": + """Get a certificate. + + Description for Get a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + name: str, + certificate_envelope: "_models.Certificate", + **kwargs + ) -> "_models.Certificate": + """Create or update a certificate. + + Description for Create or update a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :param certificate_envelope: Details of certificate, if it exists already. + :type certificate_envelope: ~azure.mgmt.web.v2020_09_01.models.Certificate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_envelope, 'Certificate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Delete a certificate. + + Description for Delete a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore + + async def update( + self, + resource_group_name: str, + name: str, + certificate_envelope: "_models.CertificatePatchResource", + **kwargs + ) -> "_models.Certificate": + """Create or update a certificate. + + Description for Create or update a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :param certificate_envelope: Details of certificate, if it exists already. + :type certificate_envelope: ~azure.mgmt.web.v2020_09_01.models.CertificatePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_envelope, 'CertificatePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_deleted_web_apps_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_deleted_web_apps_operations.py new file mode 100644 index 000000000000..c64b4fc69963 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_deleted_web_apps_operations.py @@ -0,0 +1,245 @@ +# 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, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DeletedWebAppsOperations: + """DeletedWebAppsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.DeletedWebAppCollection"]: + """Get all deleted apps for a subscription. + + Description for Get all deleted apps for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeletedWebAppCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.DeletedWebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedWebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DeletedWebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites'} # type: ignore + + def list_by_location( + self, + location: str, + **kwargs + ) -> AsyncIterable["_models.DeletedWebAppCollection"]: + """Get all deleted apps for a subscription at location. + + Description for Get all deleted apps for a subscription at location. + + :param location: + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeletedWebAppCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.DeletedWebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedWebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_location.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DeletedWebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/deletedSites'} # type: ignore + + async def get_deleted_web_app_by_location( + self, + location: str, + deleted_site_id: str, + **kwargs + ) -> "_models.DeletedSite": + """Get deleted app for a subscription at location. + + Description for Get deleted app for a subscription at location. + + :param location: + :type location: str + :param deleted_site_id: The numeric ID of the deleted app, e.g. 12345. + :type deleted_site_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeletedSite, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DeletedSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedSite"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_deleted_web_app_by_location.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'deletedSiteId': self._serialize.url("deleted_site_id", deleted_site_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeletedSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deleted_web_app_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/deletedSites/{deletedSiteId}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_diagnostics_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_diagnostics_operations.py new file mode 100644 index 000000000000..dd7ac8f0e1e4 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_diagnostics_operations.py @@ -0,0 +1,1774 @@ +# 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. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DiagnosticsOperations: + """DiagnosticsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_hosting_environment_detector_responses( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.DetectorResponseCollection"]: + """List Hosting Environment Detector Responses. + + Description for List Hosting Environment Detector Responses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site Name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DetectorResponseCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.DetectorResponseCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponseCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_hosting_environment_detector_responses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DetectorResponseCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_hosting_environment_detector_responses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors'} # type: ignore + + async def get_hosting_environment_detector_response( + self, + resource_group_name: str, + name: str, + detector_name: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs + ) -> "_models.DetectorResponse": + """Get Hosting Environment Detector Response. + + Description for Get Hosting Environment Detector Response. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: App Service Environment Name. + :type name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_hosting_environment_detector_response.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hosting_environment_detector_response.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors/{detectorName}'} # type: ignore + + def list_site_detector_responses( + self, + resource_group_name: str, + site_name: str, + **kwargs + ) -> AsyncIterable["_models.DetectorResponseCollection"]: + """List Site Detector Responses. + + Description for List Site Detector Responses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DetectorResponseCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.DetectorResponseCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponseCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detector_responses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DetectorResponseCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_detector_responses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors'} # type: ignore + + async def get_site_detector_response( + self, + resource_group_name: str, + site_name: str, + detector_name: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs + ) -> "_models.DetectorResponse": + """Get site detector response. + + Description for Get site detector response. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector_response.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector_response.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors/{detectorName}'} # type: ignore + + def list_site_diagnostic_categories( + self, + resource_group_name: str, + site_name: str, + **kwargs + ) -> AsyncIterable["_models.DiagnosticCategoryCollection"]: + """Get Diagnostics Categories. + + Description for Get Diagnostics Categories. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticCategoryCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.DiagnosticCategoryCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_diagnostic_categories.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticCategoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_diagnostic_categories.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics'} # type: ignore + + async def get_site_diagnostic_category( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + **kwargs + ) -> "_models.DiagnosticCategory": + """Get Diagnostics Category. + + Description for Get Diagnostics Category. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticCategory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DiagnosticCategory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategory"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_diagnostic_category.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticCategory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_diagnostic_category.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}'} # type: ignore + + def list_site_analyses( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + **kwargs + ) -> AsyncIterable["_models.DiagnosticAnalysisCollection"]: + """Get Site Analyses. + + Description for Get Site Analyses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticAnalysisCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.DiagnosticAnalysisCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysisCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_analyses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticAnalysisCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_analyses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses'} # type: ignore + + async def get_site_analysis( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + analysis_name: str, + **kwargs + ) -> "_models.AnalysisDefinition": + """Get Site Analysis. + + Description for Get Site Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param analysis_name: Analysis Name. + :type analysis_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalysisDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AnalysisDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalysisDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_analysis.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AnalysisDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_analysis.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}'} # type: ignore + + async def execute_site_analysis( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + analysis_name: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs + ) -> "_models.DiagnosticAnalysis": + """Execute Analysis. + + Description for Execute Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param analysis_name: Analysis Resource Name. + :type analysis_name: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticAnalysis, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DiagnosticAnalysis + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysis"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_analysis.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticAnalysis', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_analysis.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute'} # type: ignore + + def list_site_detectors( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + **kwargs + ) -> AsyncIterable["_models.DiagnosticDetectorCollection"]: + """Get Detectors. + + Description for Get Detectors. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticDetectorCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.DiagnosticDetectorCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detectors.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticDetectorCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_detectors.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors'} # type: ignore + + async def get_site_detector( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + detector_name: str, + **kwargs + ) -> "_models.DetectorDefinition": + """Get Detector. + + Description for Get Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param detector_name: Detector Name. + :type detector_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DetectorDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}'} # type: ignore + + async def execute_site_detector( + self, + resource_group_name: str, + site_name: str, + detector_name: str, + diagnostic_category: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs + ) -> "_models.DiagnosticDetectorResponse": + """Execute Detector. + + Description for Execute Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticDetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DiagnosticDetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_detector.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticDetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_detector.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute'} # type: ignore + + def list_site_detector_responses_slot( + self, + resource_group_name: str, + site_name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.DetectorResponseCollection"]: + """List Site Detector Responses. + + Description for List Site Detector Responses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DetectorResponseCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.DetectorResponseCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponseCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detector_responses_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DetectorResponseCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_detector_responses_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors'} # type: ignore + + async def get_site_detector_response_slot( + self, + resource_group_name: str, + site_name: str, + detector_name: str, + slot: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs + ) -> "_models.DetectorResponse": + """Get site detector response. + + Description for Get site detector response. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param slot: Slot Name. + :type slot: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector_response_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector_response_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors/{detectorName}'} # type: ignore + + def list_site_diagnostic_categories_slot( + self, + resource_group_name: str, + site_name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.DiagnosticCategoryCollection"]: + """Get Diagnostics Categories. + + Description for Get Diagnostics Categories. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticCategoryCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.DiagnosticCategoryCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_diagnostic_categories_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticCategoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_diagnostic_categories_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics'} # type: ignore + + async def get_site_diagnostic_category_slot( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + slot: str, + **kwargs + ) -> "_models.DiagnosticCategory": + """Get Diagnostics Category. + + Description for Get Diagnostics Category. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticCategory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DiagnosticCategory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategory"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_diagnostic_category_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticCategory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_diagnostic_category_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}'} # type: ignore + + def list_site_analyses_slot( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.DiagnosticAnalysisCollection"]: + """Get Site Analyses. + + Description for Get Site Analyses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticAnalysisCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.DiagnosticAnalysisCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysisCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_analyses_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticAnalysisCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_analyses_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses'} # type: ignore + + async def get_site_analysis_slot( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + analysis_name: str, + slot: str, + **kwargs + ) -> "_models.AnalysisDefinition": + """Get Site Analysis. + + Description for Get Site Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param analysis_name: Analysis Name. + :type analysis_name: str + :param slot: Slot - optional. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalysisDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AnalysisDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalysisDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_analysis_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AnalysisDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_analysis_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses/{analysisName}'} # type: ignore + + async def execute_site_analysis_slot( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + analysis_name: str, + slot: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs + ) -> "_models.DiagnosticAnalysis": + """Execute Analysis. + + Description for Execute Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param analysis_name: Analysis Resource Name. + :type analysis_name: str + :param slot: Slot Name. + :type slot: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticAnalysis, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DiagnosticAnalysis + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysis"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_analysis_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticAnalysis', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_analysis_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute'} # type: ignore + + def list_site_detectors_slot( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.DiagnosticDetectorCollection"]: + """Get Detectors. + + Description for Get Detectors. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticDetectorCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.DiagnosticDetectorCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detectors_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticDetectorCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_detectors_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors'} # type: ignore + + async def get_site_detector_slot( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + detector_name: str, + slot: str, + **kwargs + ) -> "_models.DetectorDefinition": + """Get Detector. + + Description for Get Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param detector_name: Detector Name. + :type detector_name: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DetectorDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors/{detectorName}'} # type: ignore + + async def execute_site_detector_slot( + self, + resource_group_name: str, + site_name: str, + detector_name: str, + diagnostic_category: str, + slot: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs + ) -> "_models.DiagnosticDetectorResponse": + """Execute Detector. + + Description for Execute Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticDetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DiagnosticDetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_detector_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticDetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_detector_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_domain_registration_provider_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_domain_registration_provider_operations.py new file mode 100644 index 000000000000..8572356db15d --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_domain_registration_provider_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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DomainRegistrationProviderOperations: + """DomainRegistrationProviderOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_operations( + self, + **kwargs + ) -> AsyncIterable["_models.CsmOperationCollection"]: + """Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. + + Description for Implements Csm operations Api to exposes the list of available Csm Apis under + the resource provider. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmOperationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.CsmOperationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmOperationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CsmOperationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_operations.metadata = {'url': '/providers/Microsoft.DomainRegistration/operations'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_domains_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_domains_operations.py new file mode 100644 index 000000000000..f7fae46156e3 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_domains_operations.py @@ -0,0 +1,1119 @@ +# 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, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DomainsOperations: + """DomainsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def check_availability( + self, + identifier: "_models.NameIdentifier", + **kwargs + ) -> "_models.DomainAvailabilityCheckResult": + """Check if a domain is available for registration. + + Description for Check if a domain is available for registration. + + :param identifier: Name of the domain. + :type identifier: ~azure.mgmt.web.v2020_09_01.models.NameIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainAvailabilityCheckResult, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DomainAvailabilityCheckResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainAvailabilityCheckResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainAvailabilityCheckResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/checkDomainAvailability'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.DomainCollection"]: + """Get all domains in a subscription. + + Description for Get all domains in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DomainCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.DomainCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DomainCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/domains'} # type: ignore + + async def get_control_center_sso_request( + self, + **kwargs + ) -> "_models.DomainControlCenterSsoRequest": + """Generate a single sign-on request for the domain management portal. + + Description for Generate a single sign-on request for the domain management portal. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainControlCenterSsoRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DomainControlCenterSsoRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainControlCenterSsoRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_control_center_sso_request.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainControlCenterSsoRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_control_center_sso_request.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/generateSsoRequest'} # type: ignore + + def list_recommendations( + self, + parameters: "_models.DomainRecommendationSearchParameters", + **kwargs + ) -> AsyncIterable["_models.NameIdentifierCollection"]: + """Get domain name recommendations based on keywords. + + Description for Get domain name recommendations based on keywords. + + :param parameters: Search parameters for domain name recommendations. + :type parameters: ~azure.mgmt.web.v2020_09_01.models.DomainRecommendationSearchParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NameIdentifierCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.NameIdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NameIdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_recommendations.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DomainRecommendationSearchParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DomainRecommendationSearchParameters') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NameIdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_recommendations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/listDomainRecommendations'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.DomainCollection"]: + """Get all domains in a resource group. + + Description for Get all domains in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 DomainCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.DomainCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DomainCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.DomainRegistration/domains'} # type: ignore + + async def get( + self, + resource_group_name: str, + domain_name: str, + **kwargs + ) -> "_models.Domain": + """Get a domain. + + Description for Get a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Domain, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Domain + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + domain_name: str, + domain: "_models.Domain", + **kwargs + ) -> "_models.Domain": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str', pattern=r'[a-zA-Z0-9][a-zA-Z0-9\.-]+'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain, 'Domain') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Domain', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + domain_name: str, + domain: "_models.Domain", + **kwargs + ) -> AsyncLROPoller["_models.Domain"]: + """Creates or updates a domain. + + Description for Creates or updates a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param domain: Domain registration information. + :type domain: ~azure.mgmt.web.v2020_09_01.models.Domain + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 Domain or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.Domain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + domain_name=domain_name, + domain=domain, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str', pattern=r'[a-zA-Z0-9][a-zA-Z0-9\.-]+'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + domain_name: str, + force_hard_delete_domain: Optional[bool] = None, + **kwargs + ) -> None: + """Delete a domain. + + Description for Delete a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param force_hard_delete_domain: Specify :code:`true` to delete the domain + immediately. The default is :code:`false` which deletes the domain after 24 hours. + :type force_hard_delete_domain: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if force_hard_delete_domain is not None: + query_parameters['forceHardDeleteDomain'] = self._serialize.query("force_hard_delete_domain", force_hard_delete_domain, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + domain_name: str, + domain: "_models.DomainPatchResource", + **kwargs + ) -> "_models.Domain": + """Creates or updates a domain. + + Description for Creates or updates a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param domain: Domain registration information. + :type domain: ~azure.mgmt.web.v2020_09_01.models.DomainPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Domain, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Domain + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str', pattern=r'[a-zA-Z0-9][a-zA-Z0-9\.-]+'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain, 'DomainPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Domain', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + def list_ownership_identifiers( + self, + resource_group_name: str, + domain_name: str, + **kwargs + ) -> AsyncIterable["_models.DomainOwnershipIdentifierCollection"]: + """Lists domain ownership identifiers. + + Description for Lists domain ownership identifiers. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type 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 DomainOwnershipIdentifierCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.DomainOwnershipIdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_ownership_identifiers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DomainOwnershipIdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_ownership_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers'} # type: ignore + + async def get_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + **kwargs + ) -> "_models.DomainOwnershipIdentifier": + """Get ownership identifier for domain. + + Description for Get ownership identifier for domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainOwnershipIdentifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DomainOwnershipIdentifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainOwnershipIdentifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + async def create_or_update_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + domain_ownership_identifier: "_models.DomainOwnershipIdentifier", + **kwargs + ) -> "_models.DomainOwnershipIdentifier": + """Creates an ownership identifier for a domain or updates identifier details for an existing identifer. + + Description for Creates an ownership identifier for a domain or updates identifier details for + an existing identifer. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_09_01.models.DomainOwnershipIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainOwnershipIdentifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DomainOwnershipIdentifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'DomainOwnershipIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainOwnershipIdentifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + async def delete_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + **kwargs + ) -> None: + """Delete ownership identifier for domain. + + Description for Delete ownership identifier for domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + async def update_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + domain_ownership_identifier: "_models.DomainOwnershipIdentifier", + **kwargs + ) -> "_models.DomainOwnershipIdentifier": + """Creates an ownership identifier for a domain or updates identifier details for an existing identifer. + + Description for Creates an ownership identifier for a domain or updates identifier details for + an existing identifer. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_09_01.models.DomainOwnershipIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainOwnershipIdentifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DomainOwnershipIdentifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'DomainOwnershipIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainOwnershipIdentifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + async def renew( + self, + resource_group_name: str, + domain_name: str, + **kwargs + ) -> None: + """Renew a domain. + + Description for Renew a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.renew.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + renew.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/renew'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_provider_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_provider_operations.py new file mode 100644 index 000000000000..82d217246b84 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_provider_operations.py @@ -0,0 +1,252 @@ +# 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, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProviderOperations: + """ProviderOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get_available_stacks( + self, + os_type_selected: Optional[Union[str, "_models.Enum5"]] = None, + **kwargs + ) -> AsyncIterable["_models.ApplicationStackCollection"]: + """Get available application frameworks and their versions. + + Description for Get available application frameworks and their versions. + + :param os_type_selected: + :type os_type_selected: str or ~azure.mgmt.web.v2020_09_01.models.Enum5 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationStackCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ApplicationStackCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationStackCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_available_stacks.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if os_type_selected is not None: + query_parameters['osTypeSelected'] = self._serialize.query("os_type_selected", os_type_selected, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationStackCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_available_stacks.metadata = {'url': '/providers/Microsoft.Web/availableStacks'} # type: ignore + + def list_operations( + self, + **kwargs + ) -> AsyncIterable["_models.CsmOperationCollection"]: + """Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. + + Description for Gets all available operations for the Microsoft.Web resource provider. Also + exposes resource metric definitions. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmOperationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.CsmOperationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmOperationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CsmOperationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_operations.metadata = {'url': '/providers/Microsoft.Web/operations'} # type: ignore + + def get_available_stacks_on_prem( + self, + os_type_selected: Optional[Union[str, "_models.Enum6"]] = None, + **kwargs + ) -> AsyncIterable["_models.ApplicationStackCollection"]: + """Get available application frameworks and their versions. + + Description for Get available application frameworks and their versions. + + :param os_type_selected: + :type os_type_selected: str or ~azure.mgmt.web.v2020_09_01.models.Enum6 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationStackCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ApplicationStackCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationStackCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_available_stacks_on_prem.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if os_type_selected is not None: + query_parameters['osTypeSelected'] = self._serialize.query("os_type_selected", os_type_selected, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationStackCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_available_stacks_on_prem.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_recommendations_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_recommendations_operations.py new file mode 100644 index 000000000000..31dcf46197d8 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_recommendations_operations.py @@ -0,0 +1,1109 @@ +# 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, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RecommendationsOperations: + """RecommendationsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + featured: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.RecommendationCollection"]: + """List all recommendations for a subscription. + + Description for List all recommendations for a subscription. + + :param featured: Specify :code:`true` to return only the most critical + recommendations. The default is :code:`false`, which returns all recommendations. + :type featured: bool + :param filter: Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or + channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq + 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if featured is not None: + query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations'} # type: ignore + + async def reset_all_filters( + self, + **kwargs + ) -> None: + """Reset all recommendation opt-out settings for a subscription. + + Description for Reset all recommendation opt-out settings for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.reset_all_filters.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_all_filters.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/reset'} # type: ignore + + async def disable_recommendation_for_subscription( + self, + name: str, + **kwargs + ) -> None: + """Disables the specified rule so it will not apply to a subscription in the future. + + Description for Disables the specified rule so it will not apply to a subscription in the + future. + + :param name: Rule name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.disable_recommendation_for_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_recommendation_for_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/{name}/disable'} # type: ignore + + def list_history_for_hosting_environment( + self, + resource_group_name: str, + hosting_environment_name: str, + expired_only: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.RecommendationCollection"]: + """Get past recommendations for an app, optionally specified by the time range. + + Description for Get past recommendations for an app, optionally specified by the time range. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param hosting_environment_name: Name of the hosting environment. + :type hosting_environment_name: str + :param expired_only: Specify :code:`false` to return all recommendations. The + default is :code:`true`, which returns only expired recommendations. + :type expired_only: bool + :param filter: Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or + channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq + 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_history_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expired_only is not None: + query_parameters['expiredOnly'] = self._serialize.query("expired_only", expired_only, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_history_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendationHistory'} # type: ignore + + def list_recommended_rules_for_hosting_environment( + self, + resource_group_name: str, + hosting_environment_name: str, + featured: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.RecommendationCollection"]: + """Get all recommendations for a hosting environment. + + Description for Get all recommendations for a hosting environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param hosting_environment_name: Name of the app. + :type hosting_environment_name: str + :param featured: Specify :code:`true` to return only the most critical + recommendations. The default is :code:`false`, which returns all recommendations. + :type featured: bool + :param filter: Return only channels specified in the filter. Filter is specified by using OData + syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_recommended_rules_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if featured is not None: + query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_recommended_rules_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations'} # type: ignore + + async def disable_all_for_hosting_environment( + self, + resource_group_name: str, + environment_name: str, + hosting_environment_name: str, + **kwargs + ) -> None: + """Disable all recommendations for an app. + + Description for Disable all recommendations for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param environment_name: Name of the app. + :type environment_name: str + :param hosting_environment_name: + :type hosting_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.disable_all_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['environmentName'] = self._serialize.query("environment_name", environment_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_all_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/disable'} # type: ignore + + async def reset_all_filters_for_hosting_environment( + self, + resource_group_name: str, + environment_name: str, + hosting_environment_name: str, + **kwargs + ) -> None: + """Reset all recommendation opt-out settings for an app. + + Description for Reset all recommendation opt-out settings for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param environment_name: Name of the app. + :type environment_name: str + :param hosting_environment_name: + :type hosting_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.reset_all_filters_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['environmentName'] = self._serialize.query("environment_name", environment_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_all_filters_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/reset'} # type: ignore + + async def get_rule_details_by_hosting_environment( + self, + resource_group_name: str, + hosting_environment_name: str, + name: str, + update_seen: Optional[bool] = None, + recommendation_id: Optional[str] = None, + **kwargs + ) -> "_models.RecommendationRule": + """Get a recommendation rule for an app. + + Description for Get a recommendation rule for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param hosting_environment_name: Name of the hosting environment. + :type hosting_environment_name: str + :param name: Name of the recommendation. + :type name: str + :param update_seen: Specify :code:`true` to update the last-seen timestamp of the + recommendation object. + :type update_seen: bool + :param recommendation_id: The GUID of the recommendation object if you query an expired one. + You don't need to specify it to query an active entry. + :type recommendation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RecommendationRule, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RecommendationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_rule_details_by_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if update_seen is not None: + query_parameters['updateSeen'] = self._serialize.query("update_seen", update_seen, 'bool') + if recommendation_id is not None: + query_parameters['recommendationId'] = self._serialize.query("recommendation_id", recommendation_id, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RecommendationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_rule_details_by_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}'} # type: ignore + + async def disable_recommendation_for_hosting_environment( + self, + resource_group_name: str, + environment_name: str, + name: str, + hosting_environment_name: str, + **kwargs + ) -> None: + """Disables the specific rule for a web site permanently. + + Description for Disables the specific rule for a web site permanently. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param environment_name: Site name. + :type environment_name: str + :param name: Rule name. + :type name: str + :param hosting_environment_name: + :type hosting_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.disable_recommendation_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['environmentName'] = self._serialize.query("environment_name", environment_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_recommendation_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}/disable'} # type: ignore + + def list_history_for_web_app( + self, + resource_group_name: str, + site_name: str, + expired_only: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.RecommendationCollection"]: + """Get past recommendations for an app, optionally specified by the time range. + + Description for Get past recommendations for an app, optionally specified by the time range. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :param expired_only: Specify :code:`false` to return all recommendations. The + default is :code:`true`, which returns only expired recommendations. + :type expired_only: bool + :param filter: Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or + channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq + 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_history_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expired_only is not None: + query_parameters['expiredOnly'] = self._serialize.query("expired_only", expired_only, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_history_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendationHistory'} # type: ignore + + def list_recommended_rules_for_web_app( + self, + resource_group_name: str, + site_name: str, + featured: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.RecommendationCollection"]: + """Get all recommendations for an app. + + Description for Get all recommendations for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :param featured: Specify :code:`true` to return only the most critical + recommendations. The default is :code:`false`, which returns all recommendations. + :type featured: bool + :param filter: Return only channels specified in the filter. Filter is specified by using OData + syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_recommended_rules_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if featured is not None: + query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_recommended_rules_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations'} # type: ignore + + async def disable_all_for_web_app( + self, + resource_group_name: str, + site_name: str, + **kwargs + ) -> None: + """Disable all recommendations for an app. + + Description for Disable all recommendations for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.disable_all_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_all_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/disable'} # type: ignore + + async def reset_all_filters_for_web_app( + self, + resource_group_name: str, + site_name: str, + **kwargs + ) -> None: + """Reset all recommendation opt-out settings for an app. + + Description for Reset all recommendation opt-out settings for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.reset_all_filters_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_all_filters_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/reset'} # type: ignore + + async def get_rule_details_by_web_app( + self, + resource_group_name: str, + site_name: str, + name: str, + update_seen: Optional[bool] = None, + recommendation_id: Optional[str] = None, + **kwargs + ) -> "_models.RecommendationRule": + """Get a recommendation rule for an app. + + Description for Get a recommendation rule for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :param name: Name of the recommendation. + :type name: str + :param update_seen: Specify :code:`true` to update the last-seen timestamp of the + recommendation object. + :type update_seen: bool + :param recommendation_id: The GUID of the recommendation object if you query an expired one. + You don't need to specify it to query an active entry. + :type recommendation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RecommendationRule, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RecommendationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_rule_details_by_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if update_seen is not None: + query_parameters['updateSeen'] = self._serialize.query("update_seen", update_seen, 'bool') + if recommendation_id is not None: + query_parameters['recommendationId'] = self._serialize.query("recommendation_id", recommendation_id, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RecommendationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_rule_details_by_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}'} # type: ignore + + async def disable_recommendation_for_site( + self, + resource_group_name: str, + site_name: str, + name: str, + **kwargs + ) -> None: + """Disables the specific rule for a web site permanently. + + Description for Disables the specific rule for a web site permanently. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site name. + :type site_name: str + :param name: Rule name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.disable_recommendation_for_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_recommendation_for_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}/disable'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_resource_health_metadata_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_resource_health_metadata_operations.py new file mode 100644 index 000000000000..dfea6e1d22b0 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_resource_health_metadata_operations.py @@ -0,0 +1,471 @@ +# 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, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ResourceHealthMetadataOperations: + """ResourceHealthMetadataOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.ResourceHealthMetadataCollection"]: + """List all ResourceHealthMetadata for all sites in the subscription. + + Description for List all ResourceHealthMetadata for all sites in the subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/resourceHealthMetadata'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.ResourceHealthMetadataCollection"]: + """List all ResourceHealthMetadata for all sites in the resource group in the subscription. + + Description for List all ResourceHealthMetadata for all sites in the resource group in the + subscription. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.Web/resourceHealthMetadata'} # type: ignore + + def list_by_site( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.ResourceHealthMetadataCollection"]: + """Gets the category of ResourceHealthMetadata to use for the given site as a collection. + + Description for Gets the category of ResourceHealthMetadata to use for the given site as a + collection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata'} # type: ignore + + async def get_by_site( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.ResourceHealthMetadata": + """Gets the category of ResourceHealthMetadata to use for the given site. + + Description for Gets the category of ResourceHealthMetadata to use for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceHealthMetadata, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ResourceHealthMetadata + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadata"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_by_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceHealthMetadata', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata/default'} # type: ignore + + def list_by_site_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.ResourceHealthMetadataCollection"]: + """Gets the category of ResourceHealthMetadata to use for the given site as a collection. + + Description for Gets the category of ResourceHealthMetadata to use for the given site as a + collection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_site_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_site_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata'} # type: ignore + + async def get_by_site_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.ResourceHealthMetadata": + """Gets the category of ResourceHealthMetadata to use for the given site. + + Description for Gets the category of ResourceHealthMetadata to use for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceHealthMetadata, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ResourceHealthMetadata + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadata"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_by_site_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceHealthMetadata', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_site_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata/default'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_static_sites_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_static_sites_operations.py new file mode 100644 index 000000000000..4a6fccf9f856 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_static_sites_operations.py @@ -0,0 +1,1913 @@ +# 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, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class StaticSitesOperations: + """StaticSitesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def preview_workflow( + self, + location: str, + static_sites_workflow_preview_request: "_models.StaticSitesWorkflowPreviewRequest", + **kwargs + ) -> "_models.StaticSitesWorkflowPreview": + """Generates a preview workflow file for the static site. + + Description for Generates a preview workflow file for the static site. + + :param location: Location where you plan to create the static site. + :type location: str + :param static_sites_workflow_preview_request: A JSON representation of the + StaticSitesWorkflowPreviewRequest properties. See example. + :type static_sites_workflow_preview_request: ~azure.mgmt.web.v2020_09_01.models.StaticSitesWorkflowPreviewRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSitesWorkflowPreview, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StaticSitesWorkflowPreview + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSitesWorkflowPreview"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.preview_workflow.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_sites_workflow_preview_request, 'StaticSitesWorkflowPreviewRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSitesWorkflowPreview', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + preview_workflow.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/previewStaticSiteWorkflowFile'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.StaticSiteCollection"]: + """Get all Static Sites for a subscription. + + Description for Get all Static Sites for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.StaticSiteCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/staticSites'} # type: ignore + + def get_static_sites_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.StaticSiteCollection"]: + """Gets all static sites in the specified resource group. + + Description for Gets all static sites in the specified resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 StaticSiteCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.StaticSiteCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_static_sites_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_static_sites_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites'} # type: ignore + + async def get_static_site( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.StaticSiteARMResource": + """Gets the details of a static site. + + Description for Gets the details of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StaticSiteARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + async def create_or_update_static_site( + self, + resource_group_name: str, + name: str, + static_site_envelope: "_models.StaticSiteARMResource", + **kwargs + ) -> "_models.StaticSiteARMResource": + """Creates a new static site in an existing resource group, or updates an existing static site. + + Description for Creates a new static site in an existing resource group, or updates an existing + static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to create or update. + :type name: str + :param static_site_envelope: A JSON representation of the staticsite properties. See example. + :type static_site_envelope: ~azure.mgmt.web.v2020_09_01.models.StaticSiteARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StaticSiteARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_envelope, 'StaticSiteARMResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + async def delete_static_site( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Deletes a static site. + + Description for Deletes a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to delete. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + async def update_static_site( + self, + resource_group_name: str, + name: str, + static_site_envelope: "_models.StaticSitePatchResource", + **kwargs + ) -> "_models.StaticSiteARMResource": + """Creates a new static site in an existing resource group, or updates an existing static site. + + Description for Creates a new static site in an existing resource group, or updates an existing + static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to create or update. + :type name: str + :param static_site_envelope: A JSON representation of the staticsite properties. See example. + :type static_site_envelope: ~azure.mgmt.web.v2020_09_01.models.StaticSitePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StaticSiteARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_envelope, 'StaticSitePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + def list_static_site_users( + self, + resource_group_name: str, + name: str, + authprovider: str, + **kwargs + ) -> AsyncIterable["_models.StaticSiteUserCollection"]: + """Gets the list of users of a static site. + + Description for Gets the list of users of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param authprovider: The auth provider for the users. + :type authprovider: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteUserCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.StaticSiteUserCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_users.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'authprovider': self._serialize.url("authprovider", authprovider, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteUserCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_static_site_users.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/listUsers'} # type: ignore + + async def delete_static_site_user( + self, + resource_group_name: str, + name: str, + authprovider: str, + userid: str, + **kwargs + ) -> None: + """Deletes the user entry from the static site. + + Description for Deletes the user entry from the static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the staticsite. + :type name: str + :param authprovider: The auth provider for this user. + :type authprovider: str + :param userid: The user id of the user. + :type userid: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_static_site_user.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'authprovider': self._serialize.url("authprovider", authprovider, 'str'), + 'userid': self._serialize.url("userid", userid, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_static_site_user.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}'} # type: ignore + + async def update_static_site_user( + self, + resource_group_name: str, + name: str, + authprovider: str, + userid: str, + static_site_user_envelope: "_models.StaticSiteUserARMResource", + **kwargs + ) -> "_models.StaticSiteUserARMResource": + """Updates a user entry with the listed roles. + + Description for Updates a user entry with the listed roles. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param authprovider: The auth provider for this user. + :type authprovider: str + :param userid: The user id of the user. + :type userid: str + :param static_site_user_envelope: A JSON representation of the StaticSiteUser properties. See + example. + :type static_site_user_envelope: ~azure.mgmt.web.v2020_09_01.models.StaticSiteUserARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteUserARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StaticSiteUserARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_static_site_user.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'authprovider': self._serialize.url("authprovider", authprovider, 'str'), + 'userid': self._serialize.url("userid", userid, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_user_envelope, 'StaticSiteUserARMResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteUserARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_static_site_user.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}'} # type: ignore + + def get_static_site_builds( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.StaticSiteBuildCollection"]: + """Gets all static site builds for a particular static site. + + Description for Gets all static site builds for a particular static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteBuildCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.StaticSiteBuildCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteBuildCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_static_site_builds.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteBuildCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_static_site_builds.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds'} # type: ignore + + async def get_static_site_build( + self, + resource_group_name: str, + name: str, + pr_id: str, + **kwargs + ) -> "_models.StaticSiteBuildARMResource": + """Gets the details of a static site build. + + Description for Gets the details of a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteBuildARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StaticSiteBuildARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteBuildARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_static_site_build.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteBuildARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}'} # type: ignore + + async def delete_static_site_build( + self, + resource_group_name: str, + name: str, + pr_id: str, + **kwargs + ) -> None: + """Deletes a static site build. + + Description for Deletes a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_static_site_build.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}'} # type: ignore + + async def create_or_update_static_site_build_function_app_settings( + self, + resource_group_name: str, + name: str, + pr_id: str, + app_settings: "_models.StringDictionary", + **kwargs + ) -> "_models.StringDictionary": + """Creates or updates the function app settings of a static site build. + + Description for Creates or updates the function app settings of a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_id: str + :param app_settings: + :type app_settings: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site_build_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site_build_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/config/functionappsettings'} # type: ignore + + def list_static_site_build_functions( + self, + resource_group_name: str, + name: str, + pr_id: str, + **kwargs + ) -> AsyncIterable["_models.StaticSiteFunctionOverviewCollection"]: + """Gets the functions of a particular static site build. + + Description for Gets the functions of a particular static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteFunctionOverviewCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.StaticSiteFunctionOverviewCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteFunctionOverviewCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_build_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteFunctionOverviewCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_static_site_build_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/functions'} # type: ignore + + async def list_static_site_build_function_app_settings( + self, + resource_group_name: str, + name: str, + pr_id: str, + **kwargs + ) -> "_models.StringDictionary": + """Gets the application settings of a static site. + + Description for Gets the application settings of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_build_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_build_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/listFunctionAppSettings'} # type: ignore + + async def create_or_update_static_site_function_app_settings( + self, + resource_group_name: str, + name: str, + app_settings: "_models.StringDictionary", + **kwargs + ) -> "_models.StringDictionary": + """Creates or updates the function app settings of a static site. + + Description for Creates or updates the function app settings of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param app_settings: + :type app_settings: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/functionappsettings'} # type: ignore + + async def create_user_roles_invitation_link( + self, + resource_group_name: str, + name: str, + static_site_user_roles_invitation_envelope: "_models.StaticSiteUserInvitationRequestResource", + **kwargs + ) -> "_models.StaticSiteUserInvitationResponseResource": + """Creates an invitation link for a user with the role. + + Description for Creates an invitation link for a user with the role. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param static_site_user_roles_invitation_envelope: + :type static_site_user_roles_invitation_envelope: ~azure.mgmt.web.v2020_09_01.models.StaticSiteUserInvitationRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteUserInvitationResponseResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StaticSiteUserInvitationResponseResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserInvitationResponseResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_user_roles_invitation_link.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_user_roles_invitation_envelope, 'StaticSiteUserInvitationRequestResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteUserInvitationResponseResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_user_roles_invitation_link.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/createUserInvitation'} # type: ignore + + def list_static_site_custom_domains( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.StaticSiteCustomDomainOverviewCollection"]: + """Gets all static site custom domains for a particular static site. + + Description for Gets all static site custom domains for a particular static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site resource to search in. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteCustomDomainOverviewCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.StaticSiteCustomDomainOverviewCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCustomDomainOverviewCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_custom_domains.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteCustomDomainOverviewCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_static_site_custom_domains.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains'} # type: ignore + + async def create_or_update_static_site_custom_domain( + self, + resource_group_name: str, + name: str, + domain_name: str, + **kwargs + ) -> "_models.StaticSiteCustomDomainOverviewARMResource": + """Creates a new static site custom domain in an existing resource group and static site. + + Description for Creates a new static site custom domain in an existing resource group and + static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param domain_name: The custom domain to create. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteCustomDomainOverviewARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StaticSiteCustomDomainOverviewARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCustomDomainOverviewARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site_custom_domain.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteCustomDomainOverviewARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteCustomDomainOverviewARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site_custom_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}'} # type: ignore + + async def delete_static_site_custom_domain( + self, + resource_group_name: str, + name: str, + domain_name: str, + **kwargs + ) -> None: + """Deletes a custom domain. + + Description for Deletes a custom domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param domain_name: The custom domain to delete. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_static_site_custom_domain.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_static_site_custom_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}'} # type: ignore + + async def validate_custom_domain_can_be_added_to_static_site( + self, + resource_group_name: str, + name: str, + domain_name: str, + **kwargs + ) -> None: + """Validates a particular custom domain can be added to a static site. + + Description for Validates a particular custom domain can be added to a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param domain_name: The custom domain to validate. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.validate_custom_domain_can_be_added_to_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + validate_custom_domain_can_be_added_to_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}/validate'} # type: ignore + + async def detach_static_site( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Detaches a static site. + + Description for Detaches a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to detach. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.detach_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + detach_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/detach'} # type: ignore + + def list_static_site_functions( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.StaticSiteFunctionOverviewCollection"]: + """Gets the functions of a static site. + + Description for Gets the functions of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteFunctionOverviewCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.StaticSiteFunctionOverviewCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteFunctionOverviewCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteFunctionOverviewCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_static_site_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/functions'} # type: ignore + + async def list_static_site_function_app_settings( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.StringDictionary": + """Gets the application settings of a static site. + + Description for Gets the application settings of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listFunctionAppSettings'} # type: ignore + + async def list_static_site_secrets( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.StringDictionary": + """Lists the secrets for an existing static site. + + Description for Lists the secrets for an existing static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listSecrets'} # type: ignore + + async def reset_static_site_api_key( + self, + resource_group_name: str, + name: str, + reset_properties_envelope: "_models.StaticSiteResetPropertiesARMResource", + **kwargs + ) -> None: + """Resets the api key for an existing static site. + + Description for Resets the api key for an existing static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param reset_properties_envelope: + :type reset_properties_envelope: ~azure.mgmt.web.v2020_09_01.models.StaticSiteResetPropertiesARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.reset_static_site_api_key.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(reset_properties_envelope, 'StaticSiteResetPropertiesARMResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_static_site_api_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/resetapikey'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_top_level_domains_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_top_level_domains_operations.py new file mode 100644 index 000000000000..94e084ef3912 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_top_level_domains_operations.py @@ -0,0 +1,252 @@ +# 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, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class TopLevelDomainsOperations: + """TopLevelDomainsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.TopLevelDomainCollection"]: + """Get all top-level domains supported for registration. + + Description for Get all top-level domains supported for registration. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TopLevelDomainCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.TopLevelDomainCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TopLevelDomainCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TopLevelDomainCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains'} # type: ignore + + async def get( + self, + name: str, + **kwargs + ) -> "_models.TopLevelDomain": + """Get details of a top-level domain. + + Description for Get details of a top-level domain. + + :param name: Name of the top-level domain. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TopLevelDomain, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.TopLevelDomain + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TopLevelDomain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TopLevelDomain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}'} # type: ignore + + def list_agreements( + self, + name: str, + agreement_option: "_models.TopLevelDomainAgreementOption", + **kwargs + ) -> AsyncIterable["_models.TldLegalAgreementCollection"]: + """Gets all legal agreements that user needs to accept before purchasing a domain. + + Description for Gets all legal agreements that user needs to accept before purchasing a domain. + + :param name: Name of the top-level domain. + :type name: str + :param agreement_option: Domain agreement options. + :type agreement_option: ~azure.mgmt.web.v2020_09_01.models.TopLevelDomainAgreementOption + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TldLegalAgreementCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.TldLegalAgreementCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TldLegalAgreementCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_agreements.metadata['url'] # type: ignore + path_format_arguments = { + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(agreement_option, 'TopLevelDomainAgreementOption') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(agreement_option, 'TopLevelDomainAgreementOption') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TldLegalAgreementCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_agreements.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}/listAgreements'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_web_apps_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_web_apps_operations.py new file mode 100644 index 000000000000..fda74b1b16cc --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_web_apps_operations.py @@ -0,0 +1,28546 @@ +# 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, Generic, IO, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WebAppsOperations: + """WebAppsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.WebAppCollection"]: + """Get all apps for a subscription. + + Description for Get all apps for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/sites'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + include_slots: Optional[bool] = None, + **kwargs + ) -> AsyncIterable["_models.WebAppCollection"]: + """Gets all web, mobile, and API apps in the specified resource group. + + Description for Gets all web, mobile, and API apps in the specified resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param include_slots: Specify :code:`true` to include deployment slots in + results. The default is false, which only gives you the production slot of all apps. + :type include_slots: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if include_slots is not None: + query_parameters['includeSlots'] = self._serialize.query("include_slots", include_slots, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.Web/sites'} # type: ignore + + async def get( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> Optional["_models.Site"]: + """Gets the details of a web, mobile, or API app. + + Description for Gets the details of a web, mobile, or API app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Site or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Site"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + name: str, + site_envelope: "_models.Site", + **kwargs + ) -> "_models.Site": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'Site') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + name: str, + site_envelope: "_models.Site", + **kwargs + ) -> AsyncLROPoller["_models.Site"]: + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2020_09_01.models.Site + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 Site or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + site_envelope=site_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + name: str, + delete_metrics: Optional[bool] = None, + delete_empty_server_farm: Optional[bool] = None, + **kwargs + ) -> None: + """Deletes a web, mobile, or API app, or one of the deployment slots. + + Description for Deletes a web, mobile, or API app, or one of the deployment slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app to delete. + :type name: str + :param delete_metrics: If true, web app metrics are also deleted. + :type delete_metrics: bool + :param delete_empty_server_farm: Specify false if you want to keep empty App Service plan. By + default, empty App Service plan is deleted. + :type delete_empty_server_farm: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if delete_metrics is not None: + query_parameters['deleteMetrics'] = self._serialize.query("delete_metrics", delete_metrics, 'bool') + if delete_empty_server_farm is not None: + query_parameters['deleteEmptyServerFarm'] = self._serialize.query("delete_empty_server_farm", delete_empty_server_farm, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + async def update( + self, + resource_group_name: str, + name: str, + site_envelope: "_models.SitePatchResource", + **kwargs + ) -> "_models.Site": + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2020_09_01.models.SitePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Site + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'SitePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + async def analyze_custom_hostname( + self, + resource_group_name: str, + name: str, + host_name: Optional[str] = None, + **kwargs + ) -> "_models.CustomHostnameAnalysisResult": + """Analyze a custom hostname. + + Description for Analyze a custom hostname. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param host_name: Custom hostname. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CustomHostnameAnalysisResult, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.CustomHostnameAnalysisResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomHostnameAnalysisResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.analyze_custom_hostname.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if host_name is not None: + query_parameters['hostName'] = self._serialize.query("host_name", host_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CustomHostnameAnalysisResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + analyze_custom_hostname.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/analyzeCustomHostname'} # type: ignore + + async def apply_slot_config_to_production( + self, + resource_group_name: str, + name: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs + ) -> None: + """Applies the configuration settings from the target slot onto the current slot. + + Description for Applies the configuration settings from the target slot onto the current slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_09_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.apply_slot_config_to_production.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + apply_slot_config_to_production.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/applySlotConfig'} # type: ignore + + async def backup( + self, + resource_group_name: str, + name: str, + request: "_models.BackupRequest", + **kwargs + ) -> "_models.BackupItem": + """Creates a backup of an app. + + Description for Creates a backup of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: Backup configuration. You can use the JSON response from the POST action as + input here. + :type request: ~azure.mgmt.web.v2020_09_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.backup.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backup'} # type: ignore + + def list_backups( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.BackupItemCollection"]: + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_backups.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_backups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups'} # type: ignore + + async def get_backup_status( + self, + resource_group_name: str, + name: str, + backup_id: str, + **kwargs + ) -> "_models.BackupItem": + """Gets a backup of an app by its ID. + + Description for Gets a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}'} # type: ignore + + async def delete_backup( + self, + resource_group_name: str, + name: str, + backup_id: str, + **kwargs + ) -> None: + """Deletes a backup of an app by its ID. + + Description for Deletes a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}'} # type: ignore + + async def list_backup_status_secrets( + self, + resource_group_name: str, + name: str, + backup_id: str, + request: "_models.BackupRequest", + **kwargs + ) -> "_models.BackupItem": + """Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + + Description for Gets status of a web app backup that may be in progress, including secrets + associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the + SAS URL for the backup if a new URL is passed in the request body. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param backup_id: ID of backup. + :type backup_id: str + :param request: Information on backup request. + :type request: ~azure.mgmt.web.v2020_09_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_backup_status_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_backup_status_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/list'} # type: ignore + + async def _restore_initial( + self, + resource_group_name: str, + name: str, + backup_id: str, + request: "_models.RestoreRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore'} # type: ignore + + async def begin_restore( + self, + resource_group_name: str, + name: str, + backup_id: str, + request: "_models.RestoreRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Restores a specific backup to another app (or deployment slot, if specified). + + Description for Restores a specific backup to another app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2020_09_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_initial( + resource_group_name=resource_group_name, + name=name, + backup_id=backup_id, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore'} # type: ignore + + async def get_basic_publishing_credentials_policies( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.CsmPublishingCredentialsPoliciesCollection": + """Returns whether Scm basic auth is allowed and whether Ftp is allowed for a given site. + + Description for Returns whether Scm basic auth is allowed and whether Ftp is allowed for a + given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesCollection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingCredentialsPoliciesCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_basic_publishing_credentials_policies.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_basic_publishing_credentials_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies'} # type: ignore + + async def get_ftp_allowed( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.CsmPublishingCredentialsPoliciesEntity": + """Returns whether FTP is allowed on the site or not. + + Description for Returns whether FTP is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_ftp_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ftp_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/ftp'} # type: ignore + + async def update_ftp_allowed( + self, + resource_group_name: str, + name: str, + csm_publishing_access_policies_entity: "_models.CsmPublishingCredentialsPoliciesEntity", + **kwargs + ) -> "_models.CsmPublishingCredentialsPoliciesEntity": + """Updates whether FTP is allowed on the site or not. + + Description for Updates whether FTP is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param csm_publishing_access_policies_entity: + :type csm_publishing_access_policies_entity: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingCredentialsPoliciesEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_ftp_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(csm_publishing_access_policies_entity, 'CsmPublishingCredentialsPoliciesEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_ftp_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/ftp'} # type: ignore + + async def get_scm_allowed( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.CsmPublishingCredentialsPoliciesEntity": + """Returns whether Scm basic auth is allowed on the site or not. + + Description for Returns whether Scm basic auth is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_scm_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_scm_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/scm'} # type: ignore + + async def update_scm_allowed( + self, + resource_group_name: str, + name: str, + csm_publishing_access_policies_entity: "_models.CsmPublishingCredentialsPoliciesEntity", + **kwargs + ) -> "_models.CsmPublishingCredentialsPoliciesEntity": + """Updates whether user publishing credentials are allowed on the site or not. + + Description for Updates whether user publishing credentials are allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param csm_publishing_access_policies_entity: + :type csm_publishing_access_policies_entity: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingCredentialsPoliciesEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_scm_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(csm_publishing_access_policies_entity, 'CsmPublishingCredentialsPoliciesEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_scm_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/scm'} # type: ignore + + def list_configurations( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.SiteConfigResourceCollection"]: + """List the configurations of an app. + + Description for List the configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigResourceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.SiteConfigResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configurations.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_configurations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config'} # type: ignore + + async def update_application_settings( + self, + resource_group_name: str, + name: str, + app_settings: "_models.StringDictionary", + **kwargs + ) -> "_models.StringDictionary": + """Replaces the application settings of an app. + + Description for Replaces the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param app_settings: Application settings of the app. + :type app_settings: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_application_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_application_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings'} # type: ignore + + async def list_application_settings( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.StringDictionary": + """Gets the application settings of an app. + + Description for Gets the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_application_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_application_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings/list'} # type: ignore + + async def update_auth_settings( + self, + resource_group_name: str, + name: str, + site_auth_settings: "_models.SiteAuthSettings", + **kwargs + ) -> "_models.SiteAuthSettings": + """Updates the Authentication / Authorization settings associated with web app. + + Description for Updates the Authentication / Authorization settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param site_auth_settings: Auth settings associated with web app. + :type site_auth_settings: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings, 'SiteAuthSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings'} # type: ignore + + async def get_auth_settings( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.SiteAuthSettings": + """Gets the Authentication/Authorization settings of an app. + + Description for Gets the Authentication/Authorization settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings/list'} # type: ignore + + async def update_auth_settings_v2( + self, + resource_group_name: str, + name: str, + site_auth_settings_v2: "_models.SiteAuthSettingsV2", + **kwargs + ) -> "_models.SiteAuthSettingsV2": + """Updates site's Authentication / Authorization settings for apps via the V2 format. + + Description for Updates site's Authentication / Authorization settings for apps via the V2 + format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param site_auth_settings_v2: Auth settings associated with web app. + :type site_auth_settings_v2: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettingsV2 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings_v2, 'SiteAuthSettingsV2') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2'} # type: ignore + + async def get_auth_settings_v2( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.SiteAuthSettingsV2": + """Gets site's Authentication / Authorization settings for apps via the V2 format. + + Description for Gets site's Authentication / Authorization settings for apps via the V2 format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2/list'} # type: ignore + + async def update_azure_storage_accounts( + self, + resource_group_name: str, + name: str, + azure_storage_accounts: "_models.AzureStoragePropertyDictionaryResource", + **kwargs + ) -> "_models.AzureStoragePropertyDictionaryResource": + """Updates the Azure storage account configurations of an app. + + Description for Updates the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param azure_storage_accounts: Azure storage accounts of the app. + :type azure_storage_accounts: ~azure.mgmt.web.v2020_09_01.models.AzureStoragePropertyDictionaryResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_azure_storage_accounts.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(azure_storage_accounts, 'AzureStoragePropertyDictionaryResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_azure_storage_accounts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts'} # type: ignore + + async def list_azure_storage_accounts( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.AzureStoragePropertyDictionaryResource": + """Gets the Azure storage account configurations of an app. + + Description for Gets the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_azure_storage_accounts.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_azure_storage_accounts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts/list'} # type: ignore + + async def update_backup_configuration( + self, + resource_group_name: str, + name: str, + request: "_models.BackupRequest", + **kwargs + ) -> "_models.BackupRequest": + """Updates the backup configuration of an app. + + Description for Updates the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: Edited backup configuration. + :type request: ~azure.mgmt.web.v2020_09_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_backup_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_backup_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup'} # type: ignore + + async def delete_backup_configuration( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Deletes the backup configuration of an app. + + Description for Deletes the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup'} # type: ignore + + async def get_backup_configuration( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.BackupRequest": + """Gets the backup configuration of an app. + + Description for Gets the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup/list'} # type: ignore + + async def update_connection_strings( + self, + resource_group_name: str, + name: str, + connection_strings: "_models.ConnectionStringDictionary", + **kwargs + ) -> "_models.ConnectionStringDictionary": + """Replaces the connection strings of an app. + + Description for Replaces the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_strings: Connection strings of the app or deployment slot. See example. + :type connection_strings: ~azure.mgmt.web.v2020_09_01.models.ConnectionStringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_connection_strings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_strings, 'ConnectionStringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_connection_strings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings'} # type: ignore + + async def list_connection_strings( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.ConnectionStringDictionary": + """Gets the connection strings of an app. + + Description for Gets the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_connection_strings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_connection_strings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings/list'} # type: ignore + + async def get_diagnostic_logs_configuration( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.SiteLogsConfig": + """Gets the logging configuration of an app. + + Description for Gets the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostic_logs_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostic_logs_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs'} # type: ignore + + async def update_diagnostic_logs_config( + self, + resource_group_name: str, + name: str, + site_logs_config: "_models.SiteLogsConfig", + **kwargs + ) -> "_models.SiteLogsConfig": + """Updates the logging configuration of an app. + + Description for Updates the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_logs_config: A SiteLogsConfig JSON object that contains the logging configuration + to change in the "properties" property. + :type site_logs_config: ~azure.mgmt.web.v2020_09_01.models.SiteLogsConfig + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_diagnostic_logs_config.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_logs_config, 'SiteLogsConfig') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_diagnostic_logs_config.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs'} # type: ignore + + async def update_metadata( + self, + resource_group_name: str, + name: str, + metadata: "_models.StringDictionary", + **kwargs + ) -> "_models.StringDictionary": + """Replaces the metadata of an app. + + Description for Replaces the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param metadata: Edited metadata of the app or deployment slot. See example. + :type metadata: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_metadata.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(metadata, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_metadata.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata'} # type: ignore + + async def list_metadata( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.StringDictionary": + """Gets the metadata of an app. + + Description for Gets the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_metadata.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_metadata.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata/list'} # type: ignore + + async def _list_publishing_credentials_initial( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.User": + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._list_publishing_credentials_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_publishing_credentials_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list'} # type: ignore + + async def begin_list_publishing_credentials( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncLROPoller["_models.User"]: + """Gets the Git/FTP publishing credentials of an app. + + Description for Gets the Git/FTP publishing credentials of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type 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: True for ARMPolling, False for no polling, or a + polling object for 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 User or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._list_publishing_credentials_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_publishing_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list'} # type: ignore + + async def update_site_push_settings( + self, + resource_group_name: str, + name: str, + push_settings: "_models.PushSettings", + **kwargs + ) -> "_models.PushSettings": + """Updates the Push settings associated with web app. + + Description for Updates the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param push_settings: Push settings associated with web app. + :type push_settings: ~azure.mgmt.web.v2020_09_01.models.PushSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_site_push_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(push_settings, 'PushSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_site_push_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings'} # type: ignore + + async def list_site_push_settings( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.PushSettings": + """Gets the Push settings associated with web app. + + Description for Gets the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_site_push_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_site_push_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings/list'} # type: ignore + + async def list_slot_configuration_names( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.SlotConfigNamesResource": + """Gets the names of app settings and connection strings that stick to the slot (not swapped). + + Description for Gets the names of app settings and connection strings that stick to the slot + (not swapped). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SlotConfigNamesResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SlotConfigNamesResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotConfigNamesResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_slot_configuration_names.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SlotConfigNamesResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_slot_configuration_names.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames'} # type: ignore + + async def update_slot_configuration_names( + self, + resource_group_name: str, + name: str, + slot_config_names: "_models.SlotConfigNamesResource", + **kwargs + ) -> "_models.SlotConfigNamesResource": + """Updates the names of application settings and connection string that remain with the slot during swap operation. + + Description for Updates the names of application settings and connection string that remain + with the slot during swap operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_config_names: Names of application settings and connection strings. See example. + :type slot_config_names: ~azure.mgmt.web.v2020_09_01.models.SlotConfigNamesResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SlotConfigNamesResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SlotConfigNamesResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotConfigNamesResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_slot_configuration_names.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_config_names, 'SlotConfigNamesResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SlotConfigNamesResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_slot_configuration_names.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames'} # type: ignore + + async def get_configuration( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.SiteConfigResource": + """Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, Always On, etc. + + Description for Gets the configuration of an app, such as platform version and bitness, default + documents, virtual applications, Always On, etc. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} # type: ignore + + async def create_or_update_configuration( + self, + resource_group_name: str, + name: str, + site_config: "_models.SiteConfigResource", + **kwargs + ) -> "_models.SiteConfigResource": + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} # type: ignore + + async def update_configuration( + self, + resource_group_name: str, + name: str, + site_config: "_models.SiteConfigResource", + **kwargs + ) -> "_models.SiteConfigResource": + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} # type: ignore + + def list_configuration_snapshot_info( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.SiteConfigurationSnapshotInfoCollection"]: + """Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. + + Description for Gets a list of web app configuration snapshots identifiers. Each element of the + list contains a timestamp and the ID of the snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigurationSnapshotInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.SiteConfigurationSnapshotInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigurationSnapshotInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configuration_snapshot_info.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigurationSnapshotInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_configuration_snapshot_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots'} # type: ignore + + async def get_configuration_snapshot( + self, + resource_group_name: str, + name: str, + snapshot_id: str, + **kwargs + ) -> "_models.SiteConfigResource": + """Gets a snapshot of the configuration of an app at a previous point in time. + + Description for Gets a snapshot of the configuration of an app at a previous point in time. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration_snapshot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}'} # type: ignore + + async def recover_site_configuration_snapshot( + self, + resource_group_name: str, + name: str, + snapshot_id: str, + **kwargs + ) -> None: + """Reverts the configuration of an app to a previous snapshot. + + Description for Reverts the configuration of an app to a previous snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.recover_site_configuration_snapshot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + recover_site_configuration_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}/recover'} # type: ignore + + async def get_web_site_container_logs( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> Optional[IO]: + """Gets the last lines of docker logs for the given site. + + Description for Gets the last lines of docker logs for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/octet-stream" + + # Construct URL + url = self.get_web_site_container_logs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_site_container_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs'} # type: ignore + + async def get_container_logs_zip( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> Optional[IO]: + """Gets the ZIP archived docker log files for the given site. + + Description for Gets the ZIP archived docker log files for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/zip" + + # Construct URL + url = self.get_container_logs_zip.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_container_logs_zip.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download'} # type: ignore + + def list_continuous_web_jobs( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.ContinuousWebJobCollection"]: + """List continuous web jobs for an app, or a deployment slot. + + Description for List continuous web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ContinuousWebJobCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ContinuousWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContinuousWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_continuous_web_jobs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ContinuousWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_continuous_web_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs'} # type: ignore + + async def get_continuous_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs + ) -> Optional["_models.ContinuousWebJob"]: + """Gets a continuous web job by its ID for an app, or a deployment slot. + + Description for Gets a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ContinuousWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ContinuousWebJob or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ContinuousWebJob"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ContinuousWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'} # type: ignore + + async def delete_continuous_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs + ) -> None: + """Delete a continuous web job by its ID for an app, or a deployment slot. + + Description for Delete a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'} # type: ignore + + async def start_continuous_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs + ) -> None: + """Start a continuous web job for an app, or a deployment slot. + + Description for Start a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.start_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start'} # type: ignore + + async def stop_continuous_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs + ) -> None: + """Stop a continuous web job for an app, or a deployment slot. + + Description for Stop a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.stop_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop'} # type: ignore + + def list_deployments( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.DeploymentCollection"]: + """List deployments for an app, or a deployment slot. + + Description for List deployments for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeploymentCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.DeploymentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_deployments.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DeploymentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_deployments.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments'} # type: ignore + + async def get_deployment( + self, + resource_group_name: str, + name: str, + id: str, + **kwargs + ) -> "_models.Deployment": + """Get a deployment by its ID for an app, or a deployment slot. + + Description for Get a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_deployment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} # type: ignore + + async def create_deployment( + self, + resource_group_name: str, + name: str, + id: str, + deployment: "_models.Deployment", + **kwargs + ) -> "_models.Deployment": + """Create a deployment for an app, or a deployment slot. + + Description for Create a deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: ID of an existing deployment. + :type id: str + :param deployment: Deployment details. + :type deployment: ~azure.mgmt.web.v2020_09_01.models.Deployment + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_deployment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(deployment, 'Deployment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} # type: ignore + + async def delete_deployment( + self, + resource_group_name: str, + name: str, + id: str, + **kwargs + ) -> None: + """Delete a deployment by its ID for an app, or a deployment slot. + + Description for Delete a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_deployment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} # type: ignore + + async def list_deployment_log( + self, + resource_group_name: str, + name: str, + id: str, + **kwargs + ) -> "_models.Deployment": + """List deployment log for specific deployment for an app, or a deployment slot. + + Description for List deployment log for specific deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: The ID of a specific deployment. This is the value of the name property in the JSON + response from "GET /api/sites/{siteName}/deployments". + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_deployment_log.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_deployment_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log'} # type: ignore + + async def discover_backup( + self, + resource_group_name: str, + name: str, + request: "_models.RestoreRequest", + **kwargs + ) -> "_models.RestoreRequest": + """Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information about the databases stored in a backup. + + Description for Discovers an existing app backup that can be restored from a blob in Azure + storage. Use this to get information about the databases stored in a backup. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: A RestoreRequest object that includes Azure storage URL and blog name for + discovery of backup. + :type request: ~azure.mgmt.web.v2020_09_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RestoreRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RestoreRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestoreRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.discover_backup.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RestoreRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + discover_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup'} # type: ignore + + def list_domain_ownership_identifiers( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.IdentifierCollection"]: + """Lists ownership identifiers for domain associated with web app. + + Description for Lists ownership identifiers for domain associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IdentifierCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.IdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_domain_ownership_identifiers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_domain_ownership_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers'} # type: ignore + + async def get_domain_ownership_identifier( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + **kwargs + ) -> "_models.Identifier": + """Get domain ownership identifier for web app. + + Description for Get domain ownership identifier for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def create_or_update_domain_ownership_identifier( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + domain_ownership_identifier: "_models.Identifier", + **kwargs + ) -> "_models.Identifier": + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_09_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def delete_domain_ownership_identifier( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + **kwargs + ) -> None: + """Deletes a domain ownership identifier for a web app. + + Description for Deletes a domain ownership identifier for a web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def update_domain_ownership_identifier( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + domain_ownership_identifier: "_models.Identifier", + **kwargs + ) -> "_models.Identifier": + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_09_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def get_ms_deploy_status( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.MSDeployStatus": + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} # type: ignore + + async def _create_ms_deploy_operation_initial( + self, + resource_group_name: str, + name: str, + ms_deploy: "_models.MSDeploy", + **kwargs + ) -> Optional["_models.MSDeployStatus"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployStatus"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_ms_deploy_operation_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201, 409]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_ms_deploy_operation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} # type: ignore + + async def begin_create_ms_deploy_operation( + self, + resource_group_name: str, + name: str, + ms_deploy: "_models.MSDeploy", + **kwargs + ) -> AsyncLROPoller["_models.MSDeployStatus"]: + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2020_09_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_ms_deploy_operation_initial( + resource_group_name=resource_group_name, + name=name, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_ms_deploy_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} # type: ignore + + async def get_ms_deploy_log( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> Optional["_models.MSDeployLog"]: + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.MSDeployLog or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployLog"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_log.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log'} # type: ignore + + def list_functions( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.FunctionEnvelopeCollection"]: + """List the functions for a web site, or a deployment slot. + + Description for List the functions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FunctionEnvelopeCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.FunctionEnvelopeCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelopeCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('FunctionEnvelopeCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions'} # type: ignore + + async def get_functions_admin_token( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> str: + """Fetch a short lived token that can be exchanged for a master key. + + Description for Fetch a short lived token that can be exchanged for a master key. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_functions_admin_token.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_functions_admin_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token'} # type: ignore + + async def get_function( + self, + resource_group_name: str, + name: str, + function_name: str, + **kwargs + ) -> Optional["_models.FunctionEnvelope"]: + """Get function information by its ID for web site, or a deployment slot. + + Description for Get function information by its ID for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionEnvelope, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.FunctionEnvelope or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FunctionEnvelope"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_function.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + async def _create_function_initial( + self, + resource_group_name: str, + name: str, + function_name: str, + function_envelope: "_models.FunctionEnvelope", + **kwargs + ) -> "_models.FunctionEnvelope": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_function_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(function_envelope, 'FunctionEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_function_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + async def begin_create_function( + self, + resource_group_name: str, + name: str, + function_name: str, + function_envelope: "_models.FunctionEnvelope", + **kwargs + ) -> AsyncLROPoller["_models.FunctionEnvelope"]: + """Create function for web site, or a deployment slot. + + Description for Create function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param function_envelope: Function details. + :type function_envelope: ~azure.mgmt.web.v2020_09_01.models.FunctionEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 FunctionEnvelope or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.FunctionEnvelope] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_function_initial( + resource_group_name=resource_group_name, + name=name, + function_name=function_name, + function_envelope=function_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + async def delete_function( + self, + resource_group_name: str, + name: str, + function_name: str, + **kwargs + ) -> None: + """Delete a function for web site, or a deployment slot. + + Description for Delete a function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_function.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + async def create_or_update_function_secret( + self, + resource_group_name: str, + name: str, + function_name: str, + key_name: str, + key: "_models.KeyInfo", + **kwargs + ) -> "_models.KeyInfo": + """Add or update a function secret. + + Description for Add or update a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2020_09_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_function_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_function_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}'} # type: ignore + + async def delete_function_secret( + self, + resource_group_name: str, + name: str, + function_name: str, + key_name: str, + **kwargs + ) -> None: + """Delete a function secret. + + Description for Delete a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_function_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_function_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}'} # type: ignore + + async def list_function_keys( + self, + resource_group_name: str, + name: str, + function_name: str, + **kwargs + ) -> "_models.StringDictionary": + """Get function keys for a function in a web site, or a deployment slot. + + Description for Get function keys for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_function_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listkeys'} # type: ignore + + async def list_function_secrets( + self, + resource_group_name: str, + name: str, + function_name: str, + **kwargs + ) -> "_models.FunctionSecrets": + """Get function secrets for a function in a web site, or a deployment slot. + + Description for Get function secrets for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_function_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets'} # type: ignore + + async def list_host_keys( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.HostKeys": + """Get host secrets for a function app. + + Description for Get host secrets for a function app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostKeys, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HostKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_host_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_host_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listkeys'} # type: ignore + + async def list_sync_status( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + list_sync_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listsyncstatus'} # type: ignore + + async def sync_functions( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.sync_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/sync'} # type: ignore + + async def create_or_update_host_secret( + self, + resource_group_name: str, + name: str, + key_type: str, + key_name: str, + key: "_models.KeyInfo", + **kwargs + ) -> "_models.KeyInfo": + """Add or update a host level secret. + + Description for Add or update a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2020_09_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}'} # type: ignore + + async def delete_host_secret( + self, + resource_group_name: str, + name: str, + key_type: str, + key_name: str, + **kwargs + ) -> None: + """Delete a host level secret. + + Description for Delete a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}'} # type: ignore + + def list_host_name_bindings( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.HostNameBindingCollection"]: + """Get hostname bindings for an app or a deployment slot. + + Description for Get hostname bindings for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HostNameBindingCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.HostNameBindingCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBindingCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_host_name_bindings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('HostNameBindingCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_host_name_bindings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings'} # type: ignore + + async def get_host_name_binding( + self, + resource_group_name: str, + name: str, + host_name: str, + **kwargs + ) -> "_models.HostNameBinding": + """Get the named hostname binding for an app (or deployment slot, if specified). + + Description for Get the named hostname binding for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_host_name_binding.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} # type: ignore + + async def create_or_update_host_name_binding( + self, + resource_group_name: str, + name: str, + host_name: str, + host_name_binding: "_models.HostNameBinding", + **kwargs + ) -> "_models.HostNameBinding": + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :param host_name_binding: Binding details. This is the JSON representation of a HostNameBinding + object. + :type host_name_binding: ~azure.mgmt.web.v2020_09_01.models.HostNameBinding + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_name_binding.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(host_name_binding, 'HostNameBinding') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} # type: ignore + + async def delete_host_name_binding( + self, + resource_group_name: str, + name: str, + host_name: str, + **kwargs + ) -> None: + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_name_binding.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} # type: ignore + + async def get_hybrid_connection( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + **kwargs + ) -> "_models.HybridConnection": + """Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def create_or_update_hybrid_connection( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + connection_envelope: "_models.HybridConnection", + **kwargs + ) -> "_models.HybridConnection": + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def delete_hybrid_connection( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + **kwargs + ) -> None: + """Removes a Hybrid Connection from this site. + + Description for Removes a Hybrid Connection from this site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def update_hybrid_connection( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + connection_envelope: "_models.HybridConnection", + **kwargs + ) -> "_models.HybridConnection": + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def list_hybrid_connections( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.HybridConnection": + """Retrieves all Service Bus Hybrid Connections used by this Web App. + + Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_hybrid_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_hybrid_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays'} # type: ignore + + async def list_relay_service_connections( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.RelayServiceConnectionEntity": + """Gets hybrid connections configured for an app (or deployment slot, if specified). + + Description for Gets hybrid connections configured for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_relay_service_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_relay_service_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection'} # type: ignore + + async def get_relay_service_connection( + self, + resource_group_name: str, + name: str, + entity_name: str, + **kwargs + ) -> "_models.RelayServiceConnectionEntity": + """Gets a hybrid connection configuration by its name. + + Description for Gets a hybrid connection configuration by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection. + :type entity_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + async def create_or_update_relay_service_connection( + self, + resource_group_name: str, + name: str, + entity_name: str, + connection_envelope: "_models.RelayServiceConnectionEntity", + **kwargs + ) -> "_models.RelayServiceConnectionEntity": + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + async def delete_relay_service_connection( + self, + resource_group_name: str, + name: str, + entity_name: str, + **kwargs + ) -> None: + """Deletes a relay service connection by its name. + + Description for Deletes a relay service connection by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + async def update_relay_service_connection( + self, + resource_group_name: str, + name: str, + entity_name: str, + connection_envelope: "_models.RelayServiceConnectionEntity", + **kwargs + ) -> "_models.RelayServiceConnectionEntity": + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + def list_instance_identifiers( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.WebAppInstanceStatusCollection"]: + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppInstanceStatusCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.WebAppInstanceStatusCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppInstanceStatusCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_identifiers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppInstanceStatusCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances'} # type: ignore + + async def get_instance_info( + self, + resource_group_name: str, + name: str, + instance_id: str, + **kwargs + ) -> "_models.WebSiteInstanceStatus": + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param instance_id: + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebSiteInstanceStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.WebSiteInstanceStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebSiteInstanceStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_info.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebSiteInstanceStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}'} # type: ignore + + async def get_instance_ms_deploy_status( + self, + resource_group_name: str, + name: str, + instance_id: str, + **kwargs + ) -> "_models.MSDeployStatus": + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + async def _create_instance_ms_deploy_operation_initial( + self, + resource_group_name: str, + name: str, + instance_id: str, + ms_deploy: "_models.MSDeploy", + **kwargs + ) -> Optional["_models.MSDeployStatus"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployStatus"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_instance_ms_deploy_operation_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201, 409]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_instance_ms_deploy_operation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + async def begin_create_instance_ms_deploy_operation( + self, + resource_group_name: str, + name: str, + instance_id: str, + ms_deploy: "_models.MSDeploy", + **kwargs + ) -> AsyncLROPoller["_models.MSDeployStatus"]: + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param instance_id: ID of web app instance. + :type instance_id: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2020_09_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_instance_ms_deploy_operation_initial( + resource_group_name=resource_group_name, + name=name, + instance_id=instance_id, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_instance_ms_deploy_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + async def get_instance_ms_deploy_log( + self, + resource_group_name: str, + name: str, + instance_id: str, + **kwargs + ) -> Optional["_models.MSDeployLog"]: + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.MSDeployLog or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployLog"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_log.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log'} # type: ignore + + def list_instance_processes( + self, + resource_group_name: str, + name: str, + instance_id: str, + **kwargs + ) -> AsyncIterable["_models.ProcessInfoCollection"]: + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_processes.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_processes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes'} # type: ignore + + async def get_instance_process( + self, + resource_group_name: str, + name: str, + process_id: str, + instance_id: str, + **kwargs + ) -> Optional["_models.ProcessInfo"]: + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ProcessInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'} # type: ignore + + async def delete_instance_process( + self, + resource_group_name: str, + name: str, + process_id: str, + instance_id: str, + **kwargs + ) -> None: + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_instance_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_instance_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'} # type: ignore + + async def get_instance_process_dump( + self, + resource_group_name: str, + name: str, + process_id: str, + instance_id: str, + **kwargs + ) -> Optional[IO]: + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_dump.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_dump.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump'} # type: ignore + + def list_instance_process_modules( + self, + resource_group_name: str, + name: str, + process_id: str, + instance_id: str, + **kwargs + ) -> AsyncIterable["_models.ProcessModuleInfoCollection"]: + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessModuleInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_modules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_process_modules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules'} # type: ignore + + async def get_instance_process_module( + self, + resource_group_name: str, + name: str, + process_id: str, + base_address: str, + instance_id: str, + **kwargs + ) -> Optional["_models.ProcessModuleInfo"]: + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ProcessModuleInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessModuleInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_module.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_module.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_instance_process_threads( + self, + resource_group_name: str, + name: str, + process_id: str, + instance_id: str, + **kwargs + ) -> AsyncIterable["_models.ProcessThreadInfoCollection"]: + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessThreadInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_threads.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_process_threads.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads'} # type: ignore + + async def is_cloneable( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.SiteCloneability": + """Shows whether an app can be cloned to another resource group or subscription. + + Description for Shows whether an app can be cloned to another resource group or subscription. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteCloneability, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteCloneability + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteCloneability"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.is_cloneable.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteCloneability', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + is_cloneable.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable'} # type: ignore + + def list_site_backups( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.BackupItemCollection"]: + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_backups.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_backups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listbackups'} # type: ignore + + async def list_sync_function_triggers( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.FunctionSecrets": + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_function_triggers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_sync_function_triggers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus'} # type: ignore + + async def _migrate_storage_initial( + self, + subscription_name: str, + resource_group_name: str, + name: str, + migration_options: "_models.StorageMigrationOptions", + **kwargs + ) -> "_models.StorageMigrationResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageMigrationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._migrate_storage_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['subscriptionName'] = self._serialize.query("subscription_name", subscription_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(migration_options, 'StorageMigrationOptions') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageMigrationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _migrate_storage_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate'} # type: ignore + + async def begin_migrate_storage( + self, + subscription_name: str, + resource_group_name: str, + name: str, + migration_options: "_models.StorageMigrationOptions", + **kwargs + ) -> AsyncLROPoller["_models.StorageMigrationResponse"]: + """Restores a web app. + + Description for Restores a web app. + + :param subscription_name: Azure subscription. + :type subscription_name: str + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param migration_options: Migration migrationOptions. + :type migration_options: ~azure.mgmt.web.v2020_09_01.models.StorageMigrationOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 StorageMigrationResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.StorageMigrationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageMigrationResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._migrate_storage_initial( + subscription_name=subscription_name, + resource_group_name=resource_group_name, + name=name, + migration_options=migration_options, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageMigrationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_migrate_storage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate'} # type: ignore + + async def _migrate_my_sql_initial( + self, + resource_group_name: str, + name: str, + migration_request_envelope: "_models.MigrateMySqlRequest", + **kwargs + ) -> "_models.Operation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Operation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._migrate_my_sql_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(migration_request_envelope, 'MigrateMySqlRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Operation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _migrate_my_sql_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql'} # type: ignore + + async def begin_migrate_my_sql( + self, + resource_group_name: str, + name: str, + migration_request_envelope: "_models.MigrateMySqlRequest", + **kwargs + ) -> AsyncLROPoller["_models.Operation"]: + """Migrates a local (in-app) MySql database to a remote MySql database. + + Description for Migrates a local (in-app) MySql database to a remote MySql database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param migration_request_envelope: MySql migration options. + :type migration_request_envelope: ~azure.mgmt.web.v2020_09_01.models.MigrateMySqlRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 Operation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Operation"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._migrate_my_sql_initial( + resource_group_name=resource_group_name, + name=name, + migration_request_envelope=migration_request_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Operation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_migrate_my_sql.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql'} # type: ignore + + async def get_migrate_my_sql_status( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.MigrateMySqlStatus": + """Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. + + Description for Returns the status of MySql in app migration, if one is active, and whether or + not MySql in app is enabled. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MigrateMySqlStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.MigrateMySqlStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrateMySqlStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_migrate_my_sql_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MigrateMySqlStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_migrate_my_sql_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status'} # type: ignore + + async def get_swift_virtual_network_connection( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.SwiftVirtualNetwork": + """Gets a Swift Virtual Network connection. + + Description for Gets a Swift Virtual Network connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_swift_virtual_network_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + async def create_or_update_swift_virtual_network_connection( + self, + resource_group_name: str, + name: str, + connection_envelope: "_models.SwiftVirtualNetwork", + **kwargs + ) -> "_models.SwiftVirtualNetwork": + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_swift_virtual_network_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + async def delete_swift_virtual_network( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Deletes a Swift Virtual Network connection from an app (or deployment slot). + + Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_swift_virtual_network.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_swift_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + async def update_swift_virtual_network_connection( + self, + resource_group_name: str, + name: str, + connection_envelope: "_models.SwiftVirtualNetwork", + **kwargs + ) -> "_models.SwiftVirtualNetwork": + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_swift_virtual_network_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + async def list_network_features( + self, + resource_group_name: str, + name: str, + view: str, + **kwargs + ) -> Optional["_models.NetworkFeatures"]: + """Gets all network features used by the app (or deployment slot, if specified). + + Description for Gets all network features used by the app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param view: The type of view. This can either be "summary" or "detailed". + :type view: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFeatures, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.NetworkFeatures or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NetworkFeatures"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_network_features.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'view': self._serialize.url("view", view, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('NetworkFeatures', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_network_features.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}'} # type: ignore + + async def get_network_trace_operation( + self, + resource_group_name: str, + name: str, + operation_id: str, + **kwargs + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}'} # type: ignore + + async def start_web_site_network_trace( + self, + resource_group_name: str, + name: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs + ) -> str: + """Start capturing network packets for the site (To be deprecated). + + Description for Start capturing network packets for the site (To be deprecated). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.start_web_site_network_trace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + start_web_site_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start'} # type: ignore + + async def _start_web_site_network_trace_operation_initial( + self, + resource_group_name: str, + name: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs + ) -> List["_models.NetworkTrace"]: + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._start_web_site_network_trace_operation_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_web_site_network_trace_operation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation'} # type: ignore + + async def begin_start_web_site_network_trace_operation( + self, + resource_group_name: str, + name: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller[List["_models.NetworkTrace"]]: + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_web_site_network_trace_operation_initial( + resource_group_name=resource_group_name, + name=name, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_web_site_network_trace_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation'} # type: ignore + + async def stop_web_site_network_trace( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.stop_web_site_network_trace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_web_site_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop'} # type: ignore + + async def get_network_traces( + self, + resource_group_name: str, + name: str, + operation_id: str, + **kwargs + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}'} # type: ignore + + async def get_network_trace_operation_v2( + self, + resource_group_name: str, + name: str, + operation_id: str, + **kwargs + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}'} # type: ignore + + async def get_network_traces_v2( + self, + resource_group_name: str, + name: str, + operation_id: str, + **kwargs + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}'} # type: ignore + + async def generate_new_site_publishing_password( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Generates a new publishing password for an app (or deployment slot, if specified). + + Description for Generates a new publishing password for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.generate_new_site_publishing_password.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + generate_new_site_publishing_password.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword'} # type: ignore + + def list_perf_mon_counters( + self, + resource_group_name: str, + name: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.PerfMonCounterCollection"]: + """Gets perfmon counters for web app. + + Description for Gets perfmon counters for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z + and timeGrain eq duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PerfMonCounterCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.PerfMonCounterCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PerfMonCounterCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_perf_mon_counters.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PerfMonCounterCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_perf_mon_counters.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters'} # type: ignore + + async def get_site_php_error_log_flag( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.SitePhpErrorLogFlag": + """Gets web app's event logs. + + Description for Gets web app's event logs. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SitePhpErrorLogFlag, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SitePhpErrorLogFlag + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SitePhpErrorLogFlag"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_php_error_log_flag.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SitePhpErrorLogFlag', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_php_error_log_flag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging'} # type: ignore + + async def list_premier_add_ons( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.PremierAddOn": + """Gets the premier add-ons of an app. + + Description for Gets the premier add-ons of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_premier_add_ons.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_premier_add_ons.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons'} # type: ignore + + async def get_premier_add_on( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + **kwargs + ) -> "_models.PremierAddOn": + """Gets a named add-on of an app. + + Description for Gets a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + async def add_premier_add_on( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + premier_add_on: "_models.PremierAddOn", + **kwargs + ) -> "_models.PremierAddOn": + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2020_09_01.models.PremierAddOn + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.add_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOn') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + add_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + async def delete_premier_add_on( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + **kwargs + ) -> None: + """Delete a premier add-on from an app. + + Description for Delete a premier add-on from an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + async def update_premier_add_on( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + premier_add_on: "_models.PremierAddOnPatchResource", + **kwargs + ) -> "_models.PremierAddOn": + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2020_09_01.models.PremierAddOnPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOnPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + async def get_private_access( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.PrivateAccess": + """Gets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Gets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_private_access.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'} # type: ignore + + async def put_private_access_vnet( + self, + resource_group_name: str, + name: str, + access: "_models.PrivateAccess", + **kwargs + ) -> "_models.PrivateAccess": + """Sets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Sets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param access: The information for the private access. + :type access: ~azure.mgmt.web.v2020_09_01.models.PrivateAccess + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put_private_access_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(access, 'PrivateAccess') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_private_access_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'} # type: ignore + + def list_processes( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.ProcessInfoCollection"]: + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_processes.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_processes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes'} # type: ignore + + async def get_process( + self, + resource_group_name: str, + name: str, + process_id: str, + **kwargs + ) -> Optional["_models.ProcessInfo"]: + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ProcessInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'} # type: ignore + + async def delete_process( + self, + resource_group_name: str, + name: str, + process_id: str, + **kwargs + ) -> None: + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'} # type: ignore + + async def get_process_dump( + self, + resource_group_name: str, + name: str, + process_id: str, + **kwargs + ) -> Optional[IO]: + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_process_dump.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_dump.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump'} # type: ignore + + def list_process_modules( + self, + resource_group_name: str, + name: str, + process_id: str, + **kwargs + ) -> AsyncIterable["_models.ProcessModuleInfoCollection"]: + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessModuleInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_modules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_process_modules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules'} # type: ignore + + async def get_process_module( + self, + resource_group_name: str, + name: str, + process_id: str, + base_address: str, + **kwargs + ) -> Optional["_models.ProcessModuleInfo"]: + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ProcessModuleInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessModuleInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_process_module.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_module.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_process_threads( + self, + resource_group_name: str, + name: str, + process_id: str, + **kwargs + ) -> AsyncIterable["_models.ProcessThreadInfoCollection"]: + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessThreadInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_threads.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_process_threads.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads'} # type: ignore + + def list_public_certificates( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.PublicCertificateCollection"]: + """Get public certificates for an app or a deployment slot. + + Description for Get public certificates for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicCertificateCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.PublicCertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_public_certificates.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PublicCertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_public_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates'} # type: ignore + + async def get_public_certificate( + self, + resource_group_name: str, + name: str, + public_certificate_name: str, + **kwargs + ) -> "_models.PublicCertificate": + """Get the named public certificate for an app (or deployment slot, if specified). + + Description for Get the named public certificate for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_public_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} # type: ignore + + async def create_or_update_public_certificate( + self, + resource_group_name: str, + name: str, + public_certificate_name: str, + public_certificate: "_models.PublicCertificate", + **kwargs + ) -> "_models.PublicCertificate": + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :param public_certificate: Public certificate details. This is the JSON representation of a + PublicCertificate object. + :type public_certificate: ~azure.mgmt.web.v2020_09_01.models.PublicCertificate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_public_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(public_certificate, 'PublicCertificate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} # type: ignore + + async def delete_public_certificate( + self, + resource_group_name: str, + name: str, + public_certificate_name: str, + **kwargs + ) -> None: + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_public_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} # type: ignore + + async def list_publishing_profile_xml_with_secrets( + self, + resource_group_name: str, + name: str, + publishing_profile_options: "_models.CsmPublishingProfileOptions", + **kwargs + ) -> IO: + """Gets the publishing profile for an app (or deployment slot, if specified). + + Description for Gets the publishing profile for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param publishing_profile_options: Specifies publishingProfileOptions for publishing profile. + For example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + :type publishing_profile_options: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingProfileOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/xml" + + # Construct URL + url = self.list_publishing_profile_xml_with_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(publishing_profile_options, 'CsmPublishingProfileOptions') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_publishing_profile_xml_with_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml'} # type: ignore + + async def reset_production_slot_config( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Resets the configuration settings of the current slot if they were previously modified by calling the API with POST. + + Description for Resets the configuration settings of the current slot if they were previously + modified by calling the API with POST. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.reset_production_slot_config.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_production_slot_config.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig'} # type: ignore + + async def restart( + self, + resource_group_name: str, + name: str, + soft_restart: Optional[bool] = None, + synchronous: Optional[bool] = None, + **kwargs + ) -> None: + """Restarts an app (or deployment slot, if specified). + + Description for Restarts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param soft_restart: Specify true to apply the configuration settings and restarts the app only + if necessary. By default, the API always restarts and reprovisions the app. + :type soft_restart: bool + :param synchronous: Specify true to block until the app is restarted. By default, it is set to + false, and the API responds immediately (asynchronous). + :type synchronous: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.restart.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if soft_restart is not None: + query_parameters['softRestart'] = self._serialize.query("soft_restart", soft_restart, 'bool') + if synchronous is not None: + query_parameters['synchronous'] = self._serialize.query("synchronous", synchronous, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart'} # type: ignore + + async def _restore_from_backup_blob_initial( + self, + resource_group_name: str, + name: str, + request: "_models.RestoreRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_backup_blob_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_backup_blob_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob'} # type: ignore + + async def begin_restore_from_backup_blob( + self, + resource_group_name: str, + name: str, + request: "_models.RestoreRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Restores an app from a backup blob in Azure Storage. + + Description for Restores an app from a backup blob in Azure Storage. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2020_09_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_from_backup_blob_initial( + resource_group_name=resource_group_name, + name=name, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_backup_blob.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob'} # type: ignore + + async def _restore_from_deleted_app_initial( + self, + resource_group_name: str, + name: str, + restore_request: "_models.DeletedAppRestoreRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_deleted_app_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'DeletedAppRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_deleted_app_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp'} # type: ignore + + async def begin_restore_from_deleted_app( + self, + resource_group_name: str, + name: str, + restore_request: "_models.DeletedAppRestoreRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Restores a deleted web app to this web app. + + Description for Restores a deleted web app to this web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param restore_request: Deleted web app restore information. + :type restore_request: ~azure.mgmt.web.v2020_09_01.models.DeletedAppRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_from_deleted_app_initial( + resource_group_name=resource_group_name, + name=name, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_deleted_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp'} # type: ignore + + async def _restore_snapshot_initial( + self, + resource_group_name: str, + name: str, + restore_request: "_models.SnapshotRestoreRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_snapshot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'SnapshotRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_snapshot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot'} # type: ignore + + async def begin_restore_snapshot( + self, + resource_group_name: str, + name: str, + restore_request: "_models.SnapshotRestoreRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Restores a web app from a snapshot. + + Description for Restores a web app from a snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param restore_request: Snapshot restore settings. Snapshot information can be obtained by + calling GetDeletedSites or GetSiteSnapshots API. + :type restore_request: ~azure.mgmt.web.v2020_09_01.models.SnapshotRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_snapshot_initial( + resource_group_name=resource_group_name, + name=name, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot'} # type: ignore + + def list_site_extensions( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.SiteExtensionInfoCollection"]: + """Get list of siteextensions for a web site, or a deployment slot. + + Description for Get list of siteextensions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteExtensionInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.SiteExtensionInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_extensions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_extensions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions'} # type: ignore + + async def get_site_extension( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + **kwargs + ) -> Optional["_models.SiteExtensionInfo"]: + """Get site extension information by its ID for a web site, or a deployment slot. + + Description for Get site extension information by its ID for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteExtensionInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteExtensionInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SiteExtensionInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_extension.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + async def _install_site_extension_initial( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + **kwargs + ) -> Optional["_models.SiteExtensionInfo"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SiteExtensionInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._install_site_extension_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 429]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _install_site_extension_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + async def begin_install_site_extension( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + **kwargs + ) -> AsyncLROPoller["_models.SiteExtensionInfo"]: + """Install site extension on a web site, or a deployment slot. + + Description for Install site extension on a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 SiteExtensionInfo or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.SiteExtensionInfo] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfo"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._install_site_extension_initial( + resource_group_name=resource_group_name, + name=name, + site_extension_id=site_extension_id, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + async def delete_site_extension( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + **kwargs + ) -> None: + """Remove a site extension from a web site, or a deployment slot. + + Description for Remove a site extension from a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_site_extension.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + async def _copy_production_slot_initial( + self, + resource_group_name: str, + name: str, + copy_slot_entity: "_models.CsmCopySlotEntity", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._copy_production_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(copy_slot_entity, 'CsmCopySlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _copy_production_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotcopy'} # type: ignore + + async def begin_copy_production_slot( + self, + resource_group_name: str, + name: str, + copy_slot_entity: "_models.CsmCopySlotEntity", + **kwargs + ) -> AsyncLROPoller[None]: + """Copies a deployment slot to another deployment slot of an app. + + Description for Copies a deployment slot to another deployment slot of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param copy_slot_entity: JSON object that contains the target slot name and site config + properties to override the source slot config. See example. + :type copy_slot_entity: ~azure.mgmt.web.v2020_09_01.models.CsmCopySlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._copy_production_slot_initial( + resource_group_name=resource_group_name, + name=name, + copy_slot_entity=copy_slot_entity, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_copy_production_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotcopy'} # type: ignore + + def list_slots( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.WebAppCollection"]: + """Gets an app's deployment slots. + + Description for Gets an app's deployment slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_slots.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_slots.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots'} # type: ignore + + async def get_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> Optional["_models.Site"]: + """Gets the details of a web, mobile, or API app. + + Description for Gets the details of a web, mobile, or API app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. By default, this API returns the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Site or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Site"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + async def _create_or_update_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + site_envelope: "_models.Site", + **kwargs + ) -> "_models.Site": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'Site') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + async def begin_create_or_update_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_envelope: "_models.Site", + **kwargs + ) -> AsyncLROPoller["_models.Site"]: + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param slot: Name of the deployment slot to create or update. By default, this API attempts to + create or modify the production slot. + :type slot: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2020_09_01.models.Site + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 Site or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + site_envelope=site_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + async def delete_slot( + self, + resource_group_name: str, + name: str, + slot: str, + delete_metrics: Optional[bool] = None, + delete_empty_server_farm: Optional[bool] = None, + **kwargs + ) -> None: + """Deletes a web, mobile, or API app, or one of the deployment slots. + + Description for Deletes a web, mobile, or API app, or one of the deployment slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app to delete. + :type name: str + :param slot: Name of the deployment slot to delete. By default, the API deletes the production + slot. + :type slot: str + :param delete_metrics: If true, web app metrics are also deleted. + :type delete_metrics: bool + :param delete_empty_server_farm: Specify true if the App Service plan will be empty after app + deletion and you want to delete the empty App Service plan. By default, the empty App Service + plan is not deleted. + :type delete_empty_server_farm: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if delete_metrics is not None: + query_parameters['deleteMetrics'] = self._serialize.query("delete_metrics", delete_metrics, 'bool') + if delete_empty_server_farm is not None: + query_parameters['deleteEmptyServerFarm'] = self._serialize.query("delete_empty_server_farm", delete_empty_server_farm, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + async def update_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_envelope: "_models.SitePatchResource", + **kwargs + ) -> "_models.Site": + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param slot: Name of the deployment slot to create or update. By default, this API attempts to + create or modify the production slot. + :type slot: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2020_09_01.models.SitePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Site + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'SitePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + async def analyze_custom_hostname_slot( + self, + resource_group_name: str, + name: str, + slot: str, + host_name: Optional[str] = None, + **kwargs + ) -> "_models.CustomHostnameAnalysisResult": + """Analyze a custom hostname. + + Description for Analyze a custom hostname. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param host_name: Custom hostname. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CustomHostnameAnalysisResult, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.CustomHostnameAnalysisResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomHostnameAnalysisResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.analyze_custom_hostname_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if host_name is not None: + query_parameters['hostName'] = self._serialize.query("host_name", host_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CustomHostnameAnalysisResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + analyze_custom_hostname_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/analyzeCustomHostname'} # type: ignore + + async def apply_slot_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs + ) -> None: + """Applies the configuration settings from the target slot onto the current slot. + + Description for Applies the configuration settings from the target slot onto the current slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_09_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.apply_slot_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + apply_slot_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig'} # type: ignore + + async def backup_slot( + self, + resource_group_name: str, + name: str, + slot: str, + request: "_models.BackupRequest", + **kwargs + ) -> "_models.BackupItem": + """Creates a backup of an app. + + Description for Creates a backup of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create a + backup for the production slot. + :type slot: str + :param request: Backup configuration. You can use the JSON response from the POST action as + input here. + :type request: ~azure.mgmt.web.v2020_09_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.backup_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup'} # type: ignore + + def list_backups_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.BackupItemCollection"]: + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get backups + of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_backups_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_backups_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups'} # type: ignore + + async def get_backup_status_slot( + self, + resource_group_name: str, + name: str, + backup_id: str, + slot: str, + **kwargs + ) -> "_models.BackupItem": + """Gets a backup of an app by its ID. + + Description for Gets a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a backup + of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}'} # type: ignore + + async def delete_backup_slot( + self, + resource_group_name: str, + name: str, + backup_id: str, + slot: str, + **kwargs + ) -> None: + """Deletes a backup of an app by its ID. + + Description for Deletes a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete a + backup of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}'} # type: ignore + + async def list_backup_status_secrets_slot( + self, + resource_group_name: str, + name: str, + backup_id: str, + slot: str, + request: "_models.BackupRequest", + **kwargs + ) -> "_models.BackupItem": + """Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + + Description for Gets status of a web app backup that may be in progress, including secrets + associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the + SAS URL for the backup if a new URL is passed in the request body. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param backup_id: ID of backup. + :type backup_id: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param request: Information on backup request. + :type request: ~azure.mgmt.web.v2020_09_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_backup_status_secrets_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_backup_status_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list'} # type: ignore + + async def _restore_slot_initial( + self, + resource_group_name: str, + name: str, + backup_id: str, + slot: str, + request: "_models.RestoreRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore'} # type: ignore + + async def begin_restore_slot( + self, + resource_group_name: str, + name: str, + backup_id: str, + slot: str, + request: "_models.RestoreRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Restores a specific backup to another app (or deployment slot, if specified). + + Description for Restores a specific backup to another app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will restore a + backup of the production slot. + :type slot: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2020_09_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_slot_initial( + resource_group_name=resource_group_name, + name=name, + backup_id=backup_id, + slot=slot, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore'} # type: ignore + + def list_configurations_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.SiteConfigResourceCollection"]: + """List the configurations of an app. + + Description for List the configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigResourceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.SiteConfigResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configurations_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_configurations_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config'} # type: ignore + + async def update_application_settings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + app_settings: "_models.StringDictionary", + **kwargs + ) -> "_models.StringDictionary": + """Replaces the application settings of an app. + + Description for Replaces the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + application settings for the production slot. + :type slot: str + :param app_settings: Application settings of the app. + :type app_settings: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_application_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_application_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings'} # type: ignore + + async def list_application_settings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.StringDictionary": + """Gets the application settings of an app. + + Description for Gets the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + application settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_application_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_application_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list'} # type: ignore + + async def update_auth_settings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_auth_settings: "_models.SiteAuthSettings", + **kwargs + ) -> "_models.SiteAuthSettings": + """Updates the Authentication / Authorization settings associated with web app. + + Description for Updates the Authentication / Authorization settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param site_auth_settings: Auth settings associated with web app. + :type site_auth_settings: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings, 'SiteAuthSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings'} # type: ignore + + async def get_auth_settings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.SiteAuthSettings": + """Gets the Authentication/Authorization settings of an app. + + Description for Gets the Authentication/Authorization settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list'} # type: ignore + + async def update_auth_settings_v2_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_auth_settings_v2: "_models.SiteAuthSettingsV2", + **kwargs + ) -> "_models.SiteAuthSettingsV2": + """Updates site's Authentication / Authorization settings for apps via the V2 format. + + Description for Updates site's Authentication / Authorization settings for apps via the V2 + format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param site_auth_settings_v2: Auth settings associated with web app. + :type site_auth_settings_v2: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettingsV2 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings_v2_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings_v2, 'SiteAuthSettingsV2') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings_v2_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2'} # type: ignore + + async def get_auth_settings_v2_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.SiteAuthSettingsV2": + """Gets site's Authentication / Authorization settings for apps via the V2 format. + + Description for Gets site's Authentication / Authorization settings for apps via the V2 format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings_v2_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings_v2_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2/list'} # type: ignore + + async def update_azure_storage_accounts_slot( + self, + resource_group_name: str, + name: str, + slot: str, + azure_storage_accounts: "_models.AzureStoragePropertyDictionaryResource", + **kwargs + ) -> "_models.AzureStoragePropertyDictionaryResource": + """Updates the Azure storage account configurations of an app. + + Description for Updates the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + Azure storage account configurations for the production slot. + :type slot: str + :param azure_storage_accounts: Azure storage accounts of the app. + :type azure_storage_accounts: ~azure.mgmt.web.v2020_09_01.models.AzureStoragePropertyDictionaryResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_azure_storage_accounts_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(azure_storage_accounts, 'AzureStoragePropertyDictionaryResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_azure_storage_accounts_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts'} # type: ignore + + async def list_azure_storage_accounts_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.AzureStoragePropertyDictionaryResource": + """Gets the Azure storage account configurations of an app. + + Description for Gets the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + Azure storage account configurations for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_azure_storage_accounts_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_azure_storage_accounts_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts/list'} # type: ignore + + async def update_backup_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + request: "_models.BackupRequest", + **kwargs + ) -> "_models.BackupRequest": + """Updates the backup configuration of an app. + + Description for Updates the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + backup configuration for the production slot. + :type slot: str + :param request: Edited backup configuration. + :type request: ~azure.mgmt.web.v2020_09_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_backup_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup'} # type: ignore + + async def delete_backup_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Deletes the backup configuration of an app. + + Description for Deletes the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + backup configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup'} # type: ignore + + async def get_backup_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.BackupRequest": + """Gets the backup configuration of an app. + + Description for Gets the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + backup configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list'} # type: ignore + + async def update_connection_strings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + connection_strings: "_models.ConnectionStringDictionary", + **kwargs + ) -> "_models.ConnectionStringDictionary": + """Replaces the connection strings of an app. + + Description for Replaces the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + connection settings for the production slot. + :type slot: str + :param connection_strings: Connection strings of the app or deployment slot. See example. + :type connection_strings: ~azure.mgmt.web.v2020_09_01.models.ConnectionStringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_connection_strings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_strings, 'ConnectionStringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_connection_strings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings'} # type: ignore + + async def list_connection_strings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.ConnectionStringDictionary": + """Gets the connection strings of an app. + + Description for Gets the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + connection settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_connection_strings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_connection_strings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list'} # type: ignore + + async def get_diagnostic_logs_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.SiteLogsConfig": + """Gets the logging configuration of an app. + + Description for Gets the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + logging configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostic_logs_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostic_logs_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs'} # type: ignore + + async def update_diagnostic_logs_config_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_logs_config: "_models.SiteLogsConfig", + **kwargs + ) -> "_models.SiteLogsConfig": + """Updates the logging configuration of an app. + + Description for Updates the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + logging configuration for the production slot. + :type slot: str + :param site_logs_config: A SiteLogsConfig JSON object that contains the logging configuration + to change in the "properties" property. + :type site_logs_config: ~azure.mgmt.web.v2020_09_01.models.SiteLogsConfig + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_diagnostic_logs_config_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_logs_config, 'SiteLogsConfig') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_diagnostic_logs_config_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs'} # type: ignore + + async def update_metadata_slot( + self, + resource_group_name: str, + name: str, + slot: str, + metadata: "_models.StringDictionary", + **kwargs + ) -> "_models.StringDictionary": + """Replaces the metadata of an app. + + Description for Replaces the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + metadata for the production slot. + :type slot: str + :param metadata: Edited metadata of the app or deployment slot. See example. + :type metadata: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_metadata_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(metadata, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_metadata_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata'} # type: ignore + + async def list_metadata_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.StringDictionary": + """Gets the metadata of an app. + + Description for Gets the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + metadata for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_metadata_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_metadata_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list'} # type: ignore + + async def _list_publishing_credentials_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.User": + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._list_publishing_credentials_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_publishing_credentials_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list'} # type: ignore + + async def begin_list_publishing_credentials_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncLROPoller["_models.User"]: + """Gets the Git/FTP publishing credentials of an app. + + Description for Gets the Git/FTP publishing credentials of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + publishing credentials for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 User or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._list_publishing_credentials_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_publishing_credentials_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list'} # type: ignore + + async def update_site_push_settings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + push_settings: "_models.PushSettings", + **kwargs + ) -> "_models.PushSettings": + """Updates the Push settings associated with web app. + + Description for Updates the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param push_settings: Push settings associated with web app. + :type push_settings: ~azure.mgmt.web.v2020_09_01.models.PushSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_site_push_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(push_settings, 'PushSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_site_push_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings'} # type: ignore + + async def list_site_push_settings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.PushSettings": + """Gets the Push settings associated with web app. + + Description for Gets the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_site_push_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_site_push_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings/list'} # type: ignore + + async def get_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.SiteConfigResource": + """Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, Always On, etc. + + Description for Gets the configuration of an app, such as platform version and bitness, default + documents, virtual applications, Always On, etc. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} # type: ignore + + async def create_or_update_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_config: "_models.SiteConfigResource", + **kwargs + ) -> "_models.SiteConfigResource": + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update + configuration for the production slot. + :type slot: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} # type: ignore + + async def update_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_config: "_models.SiteConfigResource", + **kwargs + ) -> "_models.SiteConfigResource": + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update + configuration for the production slot. + :type slot: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} # type: ignore + + def list_configuration_snapshot_info_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.SiteConfigurationSnapshotInfoCollection"]: + """Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. + + Description for Gets a list of web app configuration snapshots identifiers. Each element of the + list contains a timestamp and the ID of the snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigurationSnapshotInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.SiteConfigurationSnapshotInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigurationSnapshotInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configuration_snapshot_info_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigurationSnapshotInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_configuration_snapshot_info_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots'} # type: ignore + + async def get_configuration_snapshot_slot( + self, + resource_group_name: str, + name: str, + snapshot_id: str, + slot: str, + **kwargs + ) -> "_models.SiteConfigResource": + """Gets a snapshot of the configuration of an app at a previous point in time. + + Description for Gets a snapshot of the configuration of an app at a previous point in time. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration_snapshot_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}'} # type: ignore + + async def recover_site_configuration_snapshot_slot( + self, + resource_group_name: str, + name: str, + snapshot_id: str, + slot: str, + **kwargs + ) -> None: + """Reverts the configuration of an app to a previous snapshot. + + Description for Reverts the configuration of an app to a previous snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.recover_site_configuration_snapshot_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + recover_site_configuration_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}/recover'} # type: ignore + + async def get_web_site_container_logs_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> Optional[IO]: + """Gets the last lines of docker logs for the given site. + + Description for Gets the last lines of docker logs for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/octet-stream" + + # Construct URL + url = self.get_web_site_container_logs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_site_container_logs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs'} # type: ignore + + async def get_container_logs_zip_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> Optional[IO]: + """Gets the ZIP archived docker log files for the given site. + + Description for Gets the ZIP archived docker log files for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/zip" + + # Construct URL + url = self.get_container_logs_zip_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_container_logs_zip_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download'} # type: ignore + + def list_continuous_web_jobs_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.ContinuousWebJobCollection"]: + """List continuous web jobs for an app, or a deployment slot. + + Description for List continuous web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ContinuousWebJobCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ContinuousWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContinuousWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_continuous_web_jobs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ContinuousWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_continuous_web_jobs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs'} # type: ignore + + async def get_continuous_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs + ) -> Optional["_models.ContinuousWebJob"]: + """Gets a continuous web job by its ID for an app, or a deployment slot. + + Description for Gets a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ContinuousWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ContinuousWebJob or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ContinuousWebJob"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ContinuousWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}'} # type: ignore + + async def delete_continuous_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs + ) -> None: + """Delete a continuous web job by its ID for an app, or a deployment slot. + + Description for Delete a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}'} # type: ignore + + async def start_continuous_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs + ) -> None: + """Start a continuous web job for an app, or a deployment slot. + + Description for Start a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.start_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/start'} # type: ignore + + async def stop_continuous_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs + ) -> None: + """Stop a continuous web job for an app, or a deployment slot. + + Description for Stop a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.stop_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/stop'} # type: ignore + + def list_deployments_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.DeploymentCollection"]: + """List deployments for an app, or a deployment slot. + + Description for List deployments for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeploymentCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.DeploymentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_deployments_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DeploymentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_deployments_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments'} # type: ignore + + async def get_deployment_slot( + self, + resource_group_name: str, + name: str, + id: str, + slot: str, + **kwargs + ) -> "_models.Deployment": + """Get a deployment by its ID for an app, or a deployment slot. + + Description for Get a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets a deployment + for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_deployment_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} # type: ignore + + async def create_deployment_slot( + self, + resource_group_name: str, + name: str, + id: str, + slot: str, + deployment: "_models.Deployment", + **kwargs + ) -> "_models.Deployment": + """Create a deployment for an app, or a deployment slot. + + Description for Create a deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: ID of an existing deployment. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API creates a + deployment for the production slot. + :type slot: str + :param deployment: Deployment details. + :type deployment: ~azure.mgmt.web.v2020_09_01.models.Deployment + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_deployment_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(deployment, 'Deployment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} # type: ignore + + async def delete_deployment_slot( + self, + resource_group_name: str, + name: str, + id: str, + slot: str, + **kwargs + ) -> None: + """Delete a deployment by its ID for an app, or a deployment slot. + + Description for Delete a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_deployment_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} # type: ignore + + async def list_deployment_log_slot( + self, + resource_group_name: str, + name: str, + id: str, + slot: str, + **kwargs + ) -> "_models.Deployment": + """List deployment log for specific deployment for an app, or a deployment slot. + + Description for List deployment log for specific deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: The ID of a specific deployment. This is the value of the name property in the JSON + response from "GET /api/sites/{siteName}/deployments". + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_deployment_log_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_deployment_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log'} # type: ignore + + async def discover_backup_slot( + self, + resource_group_name: str, + name: str, + slot: str, + request: "_models.RestoreRequest", + **kwargs + ) -> "_models.RestoreRequest": + """Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information about the databases stored in a backup. + + Description for Discovers an existing app backup that can be restored from a blob in Azure + storage. Use this to get information about the databases stored in a backup. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will perform + discovery for the production slot. + :type slot: str + :param request: A RestoreRequest object that includes Azure storage URL and blog name for + discovery of backup. + :type request: ~azure.mgmt.web.v2020_09_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RestoreRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RestoreRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestoreRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.discover_backup_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RestoreRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + discover_backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/discoverbackup'} # type: ignore + + def list_domain_ownership_identifiers_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.IdentifierCollection"]: + """Lists ownership identifiers for domain associated with web app. + + Description for Lists ownership identifiers for domain associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IdentifierCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.IdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_domain_ownership_identifiers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_domain_ownership_identifiers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers'} # type: ignore + + async def get_domain_ownership_identifier_slot( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + slot: str, + **kwargs + ) -> "_models.Identifier": + """Get domain ownership identifier for web app. + + Description for Get domain ownership identifier for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def create_or_update_domain_ownership_identifier_slot( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + slot: str, + domain_ownership_identifier: "_models.Identifier", + **kwargs + ) -> "_models.Identifier": + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_09_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def delete_domain_ownership_identifier_slot( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + slot: str, + **kwargs + ) -> None: + """Deletes a domain ownership identifier for a web app. + + Description for Deletes a domain ownership identifier for a web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def update_domain_ownership_identifier_slot( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + slot: str, + domain_ownership_identifier: "_models.Identifier", + **kwargs + ) -> "_models.Identifier": + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_09_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def get_ms_deploy_status_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.MSDeployStatus": + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} # type: ignore + + async def _create_ms_deploy_operation_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + ms_deploy: "_models.MSDeploy", + **kwargs + ) -> Optional["_models.MSDeployStatus"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployStatus"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_ms_deploy_operation_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201, 409]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_ms_deploy_operation_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} # type: ignore + + async def begin_create_ms_deploy_operation_slot( + self, + resource_group_name: str, + name: str, + slot: str, + ms_deploy: "_models.MSDeploy", + **kwargs + ) -> AsyncLROPoller["_models.MSDeployStatus"]: + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2020_09_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_ms_deploy_operation_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_ms_deploy_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} # type: ignore + + async def get_ms_deploy_log_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> Optional["_models.MSDeployLog"]: + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.MSDeployLog or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployLog"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_log_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log'} # type: ignore + + def list_instance_functions_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.FunctionEnvelopeCollection"]: + """List the functions for a web site, or a deployment slot. + + Description for List the functions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FunctionEnvelopeCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.FunctionEnvelopeCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelopeCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_functions_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('FunctionEnvelopeCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_functions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions'} # type: ignore + + async def get_functions_admin_token_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> str: + """Fetch a short lived token that can be exchanged for a master key. + + Description for Fetch a short lived token that can be exchanged for a master key. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_functions_admin_token_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_functions_admin_token_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/admin/token'} # type: ignore + + async def get_instance_function_slot( + self, + resource_group_name: str, + name: str, + function_name: str, + slot: str, + **kwargs + ) -> Optional["_models.FunctionEnvelope"]: + """Get function information by its ID for web site, or a deployment slot. + + Description for Get function information by its ID for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionEnvelope, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.FunctionEnvelope or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FunctionEnvelope"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_function_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + async def _create_instance_function_slot_initial( + self, + resource_group_name: str, + name: str, + function_name: str, + slot: str, + function_envelope: "_models.FunctionEnvelope", + **kwargs + ) -> "_models.FunctionEnvelope": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_instance_function_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(function_envelope, 'FunctionEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_instance_function_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + async def begin_create_instance_function_slot( + self, + resource_group_name: str, + name: str, + function_name: str, + slot: str, + function_envelope: "_models.FunctionEnvelope", + **kwargs + ) -> AsyncLROPoller["_models.FunctionEnvelope"]: + """Create function for web site, or a deployment slot. + + Description for Create function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :param function_envelope: Function details. + :type function_envelope: ~azure.mgmt.web.v2020_09_01.models.FunctionEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 FunctionEnvelope or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.FunctionEnvelope] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_instance_function_slot_initial( + resource_group_name=resource_group_name, + name=name, + function_name=function_name, + slot=slot, + function_envelope=function_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + async def delete_instance_function_slot( + self, + resource_group_name: str, + name: str, + function_name: str, + slot: str, + **kwargs + ) -> None: + """Delete a function for web site, or a deployment slot. + + Description for Delete a function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_instance_function_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + async def create_or_update_function_secret_slot( + self, + resource_group_name: str, + name: str, + function_name: str, + key_name: str, + slot: str, + key: "_models.KeyInfo", + **kwargs + ) -> "_models.KeyInfo": + """Add or update a function secret. + + Description for Add or update a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2020_09_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_function_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_function_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}'} # type: ignore + + async def delete_function_secret_slot( + self, + resource_group_name: str, + name: str, + function_name: str, + key_name: str, + slot: str, + **kwargs + ) -> None: + """Delete a function secret. + + Description for Delete a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_function_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_function_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}'} # type: ignore + + async def list_function_keys_slot( + self, + resource_group_name: str, + name: str, + function_name: str, + slot: str, + **kwargs + ) -> "_models.StringDictionary": + """Get function keys for a function in a web site, or a deployment slot. + + Description for Get function keys for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_function_keys_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_keys_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listkeys'} # type: ignore + + async def list_function_secrets_slot( + self, + resource_group_name: str, + name: str, + function_name: str, + slot: str, + **kwargs + ) -> "_models.FunctionSecrets": + """Get function secrets for a function in a web site, or a deployment slot. + + Description for Get function secrets for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_function_secrets_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets'} # type: ignore + + async def list_host_keys_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.HostKeys": + """Get host secrets for a function app. + + Description for Get host secrets for a function app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostKeys, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HostKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_host_keys_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_host_keys_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listkeys'} # type: ignore + + async def list_sync_status_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + list_sync_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listsyncstatus'} # type: ignore + + async def sync_functions_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.sync_functions_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_functions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/sync'} # type: ignore + + async def create_or_update_host_secret_slot( + self, + resource_group_name: str, + name: str, + key_type: str, + key_name: str, + slot: str, + key: "_models.KeyInfo", + **kwargs + ) -> "_models.KeyInfo": + """Add or update a host level secret. + + Description for Add or update a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2020_09_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}'} # type: ignore + + async def delete_host_secret_slot( + self, + resource_group_name: str, + name: str, + key_type: str, + key_name: str, + slot: str, + **kwargs + ) -> None: + """Delete a host level secret. + + Description for Delete a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}'} # type: ignore + + def list_host_name_bindings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.HostNameBindingCollection"]: + """Get hostname bindings for an app or a deployment slot. + + Description for Get hostname bindings for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets hostname + bindings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HostNameBindingCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.HostNameBindingCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBindingCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_host_name_bindings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('HostNameBindingCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_host_name_bindings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings'} # type: ignore + + async def get_host_name_binding_slot( + self, + resource_group_name: str, + name: str, + slot: str, + host_name: str, + **kwargs + ) -> "_models.HostNameBinding": + """Get the named hostname binding for an app (or deployment slot, if specified). + + Description for Get the named hostname binding for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API the named binding + for the production slot. + :type slot: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_host_name_binding_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} # type: ignore + + async def create_or_update_host_name_binding_slot( + self, + resource_group_name: str, + name: str, + host_name: str, + slot: str, + host_name_binding: "_models.HostNameBinding", + **kwargs + ) -> "_models.HostNameBinding": + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create a + binding for the production slot. + :type slot: str + :param host_name_binding: Binding details. This is the JSON representation of a HostNameBinding + object. + :type host_name_binding: ~azure.mgmt.web.v2020_09_01.models.HostNameBinding + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_name_binding_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(host_name_binding, 'HostNameBinding') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} # type: ignore + + async def delete_host_name_binding_slot( + self, + resource_group_name: str, + name: str, + slot: str, + host_name: str, + **kwargs + ) -> None: + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_name_binding_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} # type: ignore + + async def get_hybrid_connection_slot( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + slot: str, + **kwargs + ) -> "_models.HybridConnection": + """Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def create_or_update_hybrid_connection_slot( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + slot: str, + connection_envelope: "_models.HybridConnection", + **kwargs + ) -> "_models.HybridConnection": + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def delete_hybrid_connection_slot( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + slot: str, + **kwargs + ) -> None: + """Removes a Hybrid Connection from this site. + + Description for Removes a Hybrid Connection from this site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def update_hybrid_connection_slot( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + slot: str, + connection_envelope: "_models.HybridConnection", + **kwargs + ) -> "_models.HybridConnection": + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def list_hybrid_connections_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.HybridConnection": + """Retrieves all Service Bus Hybrid Connections used by this Web App. + + Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_hybrid_connections_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_hybrid_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays'} # type: ignore + + async def list_relay_service_connections_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.RelayServiceConnectionEntity": + """Gets hybrid connections configured for an app (or deployment slot, if specified). + + Description for Gets hybrid connections configured for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get hybrid + connections for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_relay_service_connections_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_relay_service_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection'} # type: ignore + + async def get_relay_service_connection_slot( + self, + resource_group_name: str, + name: str, + entity_name: str, + slot: str, + **kwargs + ) -> "_models.RelayServiceConnectionEntity": + """Gets a hybrid connection configuration by its name. + + Description for Gets a hybrid connection configuration by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a hybrid + connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + async def create_or_update_relay_service_connection_slot( + self, + resource_group_name: str, + name: str, + entity_name: str, + slot: str, + connection_envelope: "_models.RelayServiceConnectionEntity", + **kwargs + ) -> "_models.RelayServiceConnectionEntity": + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create or + update a hybrid connection for the production slot. + :type slot: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + async def delete_relay_service_connection_slot( + self, + resource_group_name: str, + name: str, + entity_name: str, + slot: str, + **kwargs + ) -> None: + """Deletes a relay service connection by its name. + + Description for Deletes a relay service connection by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete a + hybrid connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + async def update_relay_service_connection_slot( + self, + resource_group_name: str, + name: str, + entity_name: str, + slot: str, + connection_envelope: "_models.RelayServiceConnectionEntity", + **kwargs + ) -> "_models.RelayServiceConnectionEntity": + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create or + update a hybrid connection for the production slot. + :type slot: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + def list_instance_identifiers_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.WebAppInstanceStatusCollection"]: + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets the + production slot instances. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppInstanceStatusCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.WebAppInstanceStatusCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppInstanceStatusCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_identifiers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppInstanceStatusCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_identifiers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances'} # type: ignore + + async def get_instance_info_slot( + self, + resource_group_name: str, + name: str, + instance_id: str, + slot: str, + **kwargs + ) -> "_models.WebSiteInstanceStatus": + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param instance_id: + :type instance_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets the + production slot instances. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebSiteInstanceStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.WebSiteInstanceStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebSiteInstanceStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_info_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebSiteInstanceStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_info_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}'} # type: ignore + + async def get_instance_ms_deploy_status_slot( + self, + resource_group_name: str, + name: str, + slot: str, + instance_id: str, + **kwargs + ) -> "_models.MSDeployStatus": + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + async def _create_instance_ms_deploy_operation_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + instance_id: str, + ms_deploy: "_models.MSDeploy", + **kwargs + ) -> Optional["_models.MSDeployStatus"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployStatus"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_instance_ms_deploy_operation_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201, 409]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_instance_ms_deploy_operation_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + async def begin_create_instance_ms_deploy_operation_slot( + self, + resource_group_name: str, + name: str, + slot: str, + instance_id: str, + ms_deploy: "_models.MSDeploy", + **kwargs + ) -> AsyncLROPoller["_models.MSDeployStatus"]: + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param instance_id: ID of web app instance. + :type instance_id: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2020_09_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_instance_ms_deploy_operation_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + instance_id=instance_id, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_instance_ms_deploy_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + async def get_instance_ms_deploy_log_slot( + self, + resource_group_name: str, + name: str, + slot: str, + instance_id: str, + **kwargs + ) -> Optional["_models.MSDeployLog"]: + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.MSDeployLog or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployLog"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_log_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log'} # type: ignore + + def list_instance_processes_slot( + self, + resource_group_name: str, + name: str, + slot: str, + instance_id: str, + **kwargs + ) -> AsyncIterable["_models.ProcessInfoCollection"]: + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_processes_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_processes_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes'} # type: ignore + + async def get_instance_process_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + instance_id: str, + **kwargs + ) -> Optional["_models.ProcessInfo"]: + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ProcessInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'} # type: ignore + + async def delete_instance_process_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + instance_id: str, + **kwargs + ) -> None: + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_instance_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_instance_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'} # type: ignore + + async def get_instance_process_dump_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + instance_id: str, + **kwargs + ) -> Optional[IO]: + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_dump_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_dump_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump'} # type: ignore + + def list_instance_process_modules_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + instance_id: str, + **kwargs + ) -> AsyncIterable["_models.ProcessModuleInfoCollection"]: + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessModuleInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_modules_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_process_modules_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules'} # type: ignore + + async def get_instance_process_module_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + base_address: str, + slot: str, + instance_id: str, + **kwargs + ) -> Optional["_models.ProcessModuleInfo"]: + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ProcessModuleInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessModuleInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_module_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_module_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_instance_process_threads_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + instance_id: str, + **kwargs + ) -> AsyncIterable["_models.ProcessThreadInfoCollection"]: + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessThreadInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_threads_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_process_threads_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads'} # type: ignore + + async def is_cloneable_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.SiteCloneability": + """Shows whether an app can be cloned to another resource group or subscription. + + Description for Shows whether an app can be cloned to another resource group or subscription. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. By default, this API returns information on the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteCloneability, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteCloneability + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteCloneability"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.is_cloneable_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteCloneability', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + is_cloneable_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable'} # type: ignore + + def list_site_backups_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.BackupItemCollection"]: + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get backups + of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_backups_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_backups_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listbackups'} # type: ignore + + async def list_sync_function_triggers_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.FunctionSecrets": + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_function_triggers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_sync_function_triggers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus'} # type: ignore + + async def get_migrate_my_sql_status_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.MigrateMySqlStatus": + """Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. + + Description for Returns the status of MySql in app migration, if one is active, and whether or + not MySql in app is enabled. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MigrateMySqlStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.MigrateMySqlStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrateMySqlStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_migrate_my_sql_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MigrateMySqlStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_migrate_my_sql_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status'} # type: ignore + + async def get_swift_virtual_network_connection_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.SwiftVirtualNetwork": + """Gets a Swift Virtual Network connection. + + Description for Gets a Swift Virtual Network connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a + gateway for the production slot's Virtual Network. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_swift_virtual_network_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_swift_virtual_network_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + async def create_or_update_swift_virtual_network_connection_slot( + self, + resource_group_name: str, + name: str, + slot: str, + connection_envelope: "_models.SwiftVirtualNetwork", + **kwargs + ) -> "_models.SwiftVirtualNetwork": + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_swift_virtual_network_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_swift_virtual_network_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + async def delete_swift_virtual_network_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Deletes a Swift Virtual Network connection from an app (or deployment slot). + + Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_swift_virtual_network_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_swift_virtual_network_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + async def update_swift_virtual_network_connection_slot( + self, + resource_group_name: str, + name: str, + slot: str, + connection_envelope: "_models.SwiftVirtualNetwork", + **kwargs + ) -> "_models.SwiftVirtualNetwork": + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_swift_virtual_network_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_swift_virtual_network_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + async def list_network_features_slot( + self, + resource_group_name: str, + name: str, + view: str, + slot: str, + **kwargs + ) -> Optional["_models.NetworkFeatures"]: + """Gets all network features used by the app (or deployment slot, if specified). + + Description for Gets all network features used by the app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param view: The type of view. This can either be "summary" or "detailed". + :type view: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get network + features for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFeatures, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.NetworkFeatures or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NetworkFeatures"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_network_features_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'view': self._serialize.url("view", view, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('NetworkFeatures', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_network_features_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkFeatures/{view}'} # type: ignore + + async def get_network_trace_operation_slot( + self, + resource_group_name: str, + name: str, + operation_id: str, + slot: str, + **kwargs + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/operationresults/{operationId}'} # type: ignore + + async def start_web_site_network_trace_slot( + self, + resource_group_name: str, + name: str, + slot: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs + ) -> str: + """Start capturing network packets for the site (To be deprecated). + + Description for Start capturing network packets for the site (To be deprecated). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.start_web_site_network_trace_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + start_web_site_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/start'} # type: ignore + + async def _start_web_site_network_trace_operation_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs + ) -> List["_models.NetworkTrace"]: + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._start_web_site_network_trace_operation_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_web_site_network_trace_operation_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation'} # type: ignore + + async def begin_start_web_site_network_trace_operation_slot( + self, + resource_group_name: str, + name: str, + slot: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller[List["_models.NetworkTrace"]]: + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_web_site_network_trace_operation_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_web_site_network_trace_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation'} # type: ignore + + async def stop_web_site_network_trace_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.stop_web_site_network_trace_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_web_site_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/stop'} # type: ignore + + async def get_network_traces_slot( + self, + resource_group_name: str, + name: str, + operation_id: str, + slot: str, + **kwargs + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/{operationId}'} # type: ignore + + async def get_network_trace_operation_slot_v2( + self, + resource_group_name: str, + name: str, + operation_id: str, + slot: str, + **kwargs + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation_slot_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation_slot_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/current/operationresults/{operationId}'} # type: ignore + + async def get_network_traces_slot_v2( + self, + resource_group_name: str, + name: str, + operation_id: str, + slot: str, + **kwargs + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces_slot_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces_slot_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/{operationId}'} # type: ignore + + async def generate_new_site_publishing_password_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Generates a new publishing password for an app (or deployment slot, if specified). + + Description for Generates a new publishing password for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API generate a new + publishing password for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.generate_new_site_publishing_password_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + generate_new_site_publishing_password_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword'} # type: ignore + + def list_perf_mon_counters_slot( + self, + resource_group_name: str, + name: str, + slot: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.PerfMonCounterCollection"]: + """Gets perfmon counters for web app. + + Description for Gets perfmon counters for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z + and timeGrain eq duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PerfMonCounterCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.PerfMonCounterCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PerfMonCounterCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_perf_mon_counters_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PerfMonCounterCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_perf_mon_counters_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/perfcounters'} # type: ignore + + async def get_site_php_error_log_flag_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.SitePhpErrorLogFlag": + """Gets web app's event logs. + + Description for Gets web app's event logs. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SitePhpErrorLogFlag, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SitePhpErrorLogFlag + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SitePhpErrorLogFlag"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_php_error_log_flag_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SitePhpErrorLogFlag', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_php_error_log_flag_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging'} # type: ignore + + async def list_premier_add_ons_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.PremierAddOn": + """Gets the premier add-ons of an app. + + Description for Gets the premier add-ons of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + premier add-ons for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_premier_add_ons_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_premier_add_ons_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons'} # type: ignore + + async def get_premier_add_on_slot( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + slot: str, + **kwargs + ) -> "_models.PremierAddOn": + """Gets a named add-on of an app. + + Description for Gets a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + named add-on for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + async def add_premier_add_on_slot( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + slot: str, + premier_add_on: "_models.PremierAddOn", + **kwargs + ) -> "_models.PremierAddOn": + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + named add-on for the production slot. + :type slot: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2020_09_01.models.PremierAddOn + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.add_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOn') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + add_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + async def delete_premier_add_on_slot( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + slot: str, + **kwargs + ) -> None: + """Delete a premier add-on from an app. + + Description for Delete a premier add-on from an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + named add-on for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + async def update_premier_add_on_slot( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + slot: str, + premier_add_on: "_models.PremierAddOnPatchResource", + **kwargs + ) -> "_models.PremierAddOn": + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + named add-on for the production slot. + :type slot: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2020_09_01.models.PremierAddOnPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOnPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + async def get_private_access_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.PrivateAccess": + """Gets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Gets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_private_access_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_access_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks'} # type: ignore + + async def put_private_access_vnet_slot( + self, + resource_group_name: str, + name: str, + slot: str, + access: "_models.PrivateAccess", + **kwargs + ) -> "_models.PrivateAccess": + """Sets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Sets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for the web app. + :type slot: str + :param access: The information for the private access. + :type access: ~azure.mgmt.web.v2020_09_01.models.PrivateAccess + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put_private_access_vnet_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(access, 'PrivateAccess') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_private_access_vnet_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks'} # type: ignore + + async def get_private_endpoint_connection( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> "_models.PrivateEndpointConnectionResource": + """Gets a private endpoint connection. + + Description for Gets a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PrivateEndpointConnectionResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_private_endpoint_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _approve_or_reject_private_endpoint_connection_initial( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + private_endpoint_wrapper: "_models.PrivateLinkConnectionApprovalRequestResource", + **kwargs + ) -> "_models.PrivateEndpointConnectionResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._approve_or_reject_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_wrapper, 'PrivateLinkConnectionApprovalRequestResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _approve_or_reject_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_approve_or_reject_private_endpoint_connection( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + private_endpoint_wrapper: "_models.PrivateLinkConnectionApprovalRequestResource", + **kwargs + ) -> AsyncLROPoller["_models.PrivateEndpointConnectionResource"]: + """Approves or rejects a private endpoint connection. + + Description for Approves or rejects a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :param private_endpoint_wrapper: + :type private_endpoint_wrapper: ~azure.mgmt.web.v2020_09_01.models.PrivateLinkConnectionApprovalRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 PrivateEndpointConnectionResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.PrivateEndpointConnectionResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._approve_or_reject_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + private_endpoint_wrapper=private_endpoint_wrapper, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_approve_or_reject_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _delete_private_endpoint_connection_initial( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> object: + cls = kwargs.pop('cls', None) # type: ClsType[object] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 204: + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_delete_private_endpoint_connection( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> AsyncLROPoller[object]: + """Deletes a private endpoint connection. + + Description for Deletes a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_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: True for ARMPolling, False for no polling, or a + polling object for 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 object or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[object] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[object] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def get_private_link_resources( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.PrivateLinkResourcesWrapper": + """Gets the private link resources. + + Description for Gets the private link resources. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesWrapper, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PrivateLinkResourcesWrapper + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourcesWrapper"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_private_link_resources.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourcesWrapper', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_link_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateLinkResources'} # type: ignore + + def list_processes_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.ProcessInfoCollection"]: + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_processes_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_processes_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes'} # type: ignore + + async def get_process_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + **kwargs + ) -> Optional["_models.ProcessInfo"]: + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ProcessInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}'} # type: ignore + + async def delete_process_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + **kwargs + ) -> None: + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}'} # type: ignore + + async def get_process_dump_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + **kwargs + ) -> Optional[IO]: + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_process_dump_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_dump_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/dump'} # type: ignore + + def list_process_modules_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.ProcessModuleInfoCollection"]: + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessModuleInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_modules_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_process_modules_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules'} # type: ignore + + async def get_process_module_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + base_address: str, + slot: str, + **kwargs + ) -> Optional["_models.ProcessModuleInfo"]: + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ProcessModuleInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessModuleInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_process_module_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_module_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_process_threads_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.ProcessThreadInfoCollection"]: + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessThreadInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_threads_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_process_threads_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads'} # type: ignore + + def list_public_certificates_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.PublicCertificateCollection"]: + """Get public certificates for an app or a deployment slot. + + Description for Get public certificates for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets hostname + bindings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicCertificateCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.PublicCertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_public_certificates_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PublicCertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_public_certificates_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates'} # type: ignore + + async def get_public_certificate_slot( + self, + resource_group_name: str, + name: str, + slot: str, + public_certificate_name: str, + **kwargs + ) -> "_models.PublicCertificate": + """Get the named public certificate for an app (or deployment slot, if specified). + + Description for Get the named public certificate for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API the named binding + for the production slot. + :type slot: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_public_certificate_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_public_certificate_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'} # type: ignore + + async def create_or_update_public_certificate_slot( + self, + resource_group_name: str, + name: str, + public_certificate_name: str, + slot: str, + public_certificate: "_models.PublicCertificate", + **kwargs + ) -> "_models.PublicCertificate": + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create a + binding for the production slot. + :type slot: str + :param public_certificate: Public certificate details. This is the JSON representation of a + PublicCertificate object. + :type public_certificate: ~azure.mgmt.web.v2020_09_01.models.PublicCertificate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_public_certificate_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(public_certificate, 'PublicCertificate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_public_certificate_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'} # type: ignore + + async def delete_public_certificate_slot( + self, + resource_group_name: str, + name: str, + slot: str, + public_certificate_name: str, + **kwargs + ) -> None: + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_public_certificate_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_public_certificate_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'} # type: ignore + + async def list_publishing_profile_xml_with_secrets_slot( + self, + resource_group_name: str, + name: str, + slot: str, + publishing_profile_options: "_models.CsmPublishingProfileOptions", + **kwargs + ) -> IO: + """Gets the publishing profile for an app (or deployment slot, if specified). + + Description for Gets the publishing profile for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + publishing profile for the production slot. + :type slot: str + :param publishing_profile_options: Specifies publishingProfileOptions for publishing profile. + For example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + :type publishing_profile_options: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingProfileOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/xml" + + # Construct URL + url = self.list_publishing_profile_xml_with_secrets_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(publishing_profile_options, 'CsmPublishingProfileOptions') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_publishing_profile_xml_with_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml'} # type: ignore + + async def reset_slot_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Resets the configuration settings of the current slot if they were previously modified by calling the API with POST. + + Description for Resets the configuration settings of the current slot if they were previously + modified by calling the API with POST. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API resets + configuration settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.reset_slot_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_slot_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig'} # type: ignore + + async def restart_slot( + self, + resource_group_name: str, + name: str, + slot: str, + soft_restart: Optional[bool] = None, + synchronous: Optional[bool] = None, + **kwargs + ) -> None: + """Restarts an app (or deployment slot, if specified). + + Description for Restarts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will restart the + production slot. + :type slot: str + :param soft_restart: Specify true to apply the configuration settings and restarts the app only + if necessary. By default, the API always restarts and reprovisions the app. + :type soft_restart: bool + :param synchronous: Specify true to block until the app is restarted. By default, it is set to + false, and the API responds immediately (asynchronous). + :type synchronous: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.restart_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if soft_restart is not None: + query_parameters['softRestart'] = self._serialize.query("soft_restart", soft_restart, 'bool') + if synchronous is not None: + query_parameters['synchronous'] = self._serialize.query("synchronous", synchronous, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restart_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restart'} # type: ignore + + async def _restore_from_backup_blob_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + request: "_models.RestoreRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_backup_blob_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_backup_blob_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob'} # type: ignore + + async def begin_restore_from_backup_blob_slot( + self, + resource_group_name: str, + name: str, + slot: str, + request: "_models.RestoreRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Restores an app from a backup blob in Azure Storage. + + Description for Restores an app from a backup blob in Azure Storage. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will restore a + backup of the production slot. + :type slot: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2020_09_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_from_backup_blob_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_backup_blob_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob'} # type: ignore + + async def _restore_from_deleted_app_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + restore_request: "_models.DeletedAppRestoreRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_deleted_app_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'DeletedAppRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_deleted_app_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp'} # type: ignore + + async def begin_restore_from_deleted_app_slot( + self, + resource_group_name: str, + name: str, + slot: str, + restore_request: "_models.DeletedAppRestoreRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Restores a deleted web app to this web app. + + Description for Restores a deleted web app to this web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param restore_request: Deleted web app restore information. + :type restore_request: ~azure.mgmt.web.v2020_09_01.models.DeletedAppRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_from_deleted_app_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_deleted_app_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp'} # type: ignore + + async def _restore_snapshot_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + restore_request: "_models.SnapshotRestoreRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_snapshot_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'SnapshotRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_snapshot_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot'} # type: ignore + + async def begin_restore_snapshot_slot( + self, + resource_group_name: str, + name: str, + slot: str, + restore_request: "_models.SnapshotRestoreRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Restores a web app from a snapshot. + + Description for Restores a web app from a snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param restore_request: Snapshot restore settings. Snapshot information can be obtained by + calling GetDeletedSites or GetSiteSnapshots API. + :type restore_request: ~azure.mgmt.web.v2020_09_01.models.SnapshotRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_snapshot_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot'} # type: ignore + + def list_site_extensions_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.SiteExtensionInfoCollection"]: + """Get list of siteextensions for a web site, or a deployment slot. + + Description for Get list of siteextensions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteExtensionInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.SiteExtensionInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_extensions_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_extensions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions'} # type: ignore + + async def get_site_extension_slot( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + slot: str, + **kwargs + ) -> Optional["_models.SiteExtensionInfo"]: + """Get site extension information by its ID for a web site, or a deployment slot. + + Description for Get site extension information by its ID for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteExtensionInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteExtensionInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SiteExtensionInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_extension_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_extension_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + async def _install_site_extension_slot_initial( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + slot: str, + **kwargs + ) -> Optional["_models.SiteExtensionInfo"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SiteExtensionInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._install_site_extension_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 429]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _install_site_extension_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + async def begin_install_site_extension_slot( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + slot: str, + **kwargs + ) -> AsyncLROPoller["_models.SiteExtensionInfo"]: + """Install site extension on a web site, or a deployment slot. + + Description for Install site extension on a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 SiteExtensionInfo or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.SiteExtensionInfo] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfo"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._install_site_extension_slot_initial( + resource_group_name=resource_group_name, + name=name, + site_extension_id=site_extension_id, + slot=slot, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_site_extension_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + async def delete_site_extension_slot( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + slot: str, + **kwargs + ) -> None: + """Remove a site extension from a web site, or a deployment slot. + + Description for Remove a site extension from a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_site_extension_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_site_extension_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + async def _copy_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + copy_slot_entity: "_models.CsmCopySlotEntity", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._copy_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(copy_slot_entity, 'CsmCopySlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _copy_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotcopy'} # type: ignore + + async def begin_copy_slot( + self, + resource_group_name: str, + name: str, + slot: str, + copy_slot_entity: "_models.CsmCopySlotEntity", + **kwargs + ) -> AsyncLROPoller[None]: + """Copies a deployment slot to another deployment slot of an app. + + Description for Copies a deployment slot to another deployment slot of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param copy_slot_entity: JSON object that contains the target slot name and site config + properties to override the source slot config. See example. + :type copy_slot_entity: ~azure.mgmt.web.v2020_09_01.models.CsmCopySlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._copy_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + copy_slot_entity=copy_slot_entity, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_copy_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotcopy'} # type: ignore + + def list_slot_differences_slot( + self, + resource_group_name: str, + name: str, + slot: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs + ) -> AsyncIterable["_models.SlotDifferenceCollection"]: + """Get the difference in configuration settings between two web app slots. + + Description for Get the difference in configuration settings between two web app slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_09_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SlotDifferenceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.SlotDifferenceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotDifferenceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_slot_differences_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SlotDifferenceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_slot_differences_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs'} # type: ignore + + async def _swap_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._swap_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _swap_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap'} # type: ignore + + async def begin_swap_slot( + self, + resource_group_name: str, + name: str, + slot: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs + ) -> AsyncLROPoller[None]: + """Swaps two deployment slots of an app. + + Description for Swaps two deployment slots of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_09_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._swap_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + slot_swap_entity=slot_swap_entity, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_swap_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap'} # type: ignore + + def list_snapshots_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.SnapshotCollection"]: + """Returns all Snapshots to the user. + + Description for Returns all Snapshots to the user. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :param slot: Website Slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_snapshots_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots'} # type: ignore + + def list_snapshots_from_dr_secondary_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.SnapshotCollection"]: + """Returns all Snapshots to the user from DRSecondary endpoint. + + Description for Returns all Snapshots to the user from DRSecondary endpoint. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :param slot: Website Slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots_from_dr_secondary_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_snapshots_from_dr_secondary_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshotsdr'} # type: ignore + + async def get_source_control_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> "_models.SiteSourceControl": + """Gets the source control configuration of an app. + + Description for Gets the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + source control configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_source_control_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + async def _create_or_update_source_control_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + site_source_control: "_models.SiteSourceControl", + **kwargs + ) -> "_models.SiteSourceControl": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_source_control_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_source_control_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + async def begin_create_or_update_source_control_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_source_control: "_models.SiteSourceControl", + **kwargs + ) -> AsyncLROPoller["_models.SiteSourceControl"]: + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + source control configuration for the production slot. + :type slot: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2020_09_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 SiteSourceControl or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.SiteSourceControl] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_source_control_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + site_source_control=site_source_control, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + async def delete_source_control_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Deletes the source control configuration of an app. + + Description for Deletes the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + source control configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_source_control_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + async def update_source_control_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_source_control: "_models.SiteSourceControl", + **kwargs + ) -> "_models.SiteSourceControl": + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + source control configuration for the production slot. + :type slot: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2020_09_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_source_control_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + async def start_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Starts an app (or deployment slot, if specified). + + Description for Starts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will start the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.start_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start'} # type: ignore + + async def _start_network_trace_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs + ) -> List["_models.NetworkTrace"]: + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._start_network_trace_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_network_trace_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace'} # type: ignore + + async def begin_start_network_trace_slot( + self, + resource_group_name: str, + name: str, + slot: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller[List["_models.NetworkTrace"]]: + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_network_trace_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace'} # type: ignore + + async def stop_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Stops an app (or deployment slot, if specified). + + Description for Stops an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will stop the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.stop_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop'} # type: ignore + + async def stop_network_trace_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.stop_network_trace_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stopNetworkTrace'} # type: ignore + + async def sync_repository_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Sync web app repository. + + Description for Sync web app repository. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.sync_repository_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_repository_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync'} # type: ignore + + async def sync_function_triggers_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> None: + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.sync_function_triggers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_function_triggers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/syncfunctiontriggers'} # type: ignore + + def list_triggered_web_jobs_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.TriggeredWebJobCollection"]: + """List triggered web jobs for an app, or a deployment slot. + + Description for List triggered web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredWebJobCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.TriggeredWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_jobs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_triggered_web_jobs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs'} # type: ignore + + async def get_triggered_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs + ) -> Optional["_models.TriggeredWebJob"]: + """Gets a triggered web job by its ID for an app, or a deployment slot. + + Description for Gets a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.TriggeredWebJob or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.TriggeredWebJob"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TriggeredWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}'} # type: ignore + + async def delete_triggered_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs + ) -> None: + """Delete a triggered web job by its ID for an app, or a deployment slot. + + Description for Delete a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes web job + for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_triggered_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_triggered_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}'} # type: ignore + + def list_triggered_web_job_history_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.TriggeredJobHistoryCollection"]: + """List a triggered web job's history for an app, or a deployment slot. + + Description for List a triggered web job's history for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredJobHistoryCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.TriggeredJobHistoryCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredJobHistoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_job_history_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredJobHistoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_triggered_web_job_history_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history'} # type: ignore + + async def get_triggered_web_job_history_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + id: str, + slot: str, + **kwargs + ) -> Optional["_models.TriggeredJobHistory"]: + """Gets a triggered web job's history by its ID for an app, , or a deployment slot. + + Description for Gets a triggered web job's history by its ID for an app, , or a deployment + slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param id: History ID. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredJobHistory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.TriggeredJobHistory or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.TriggeredJobHistory"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job_history_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TriggeredJobHistory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job_history_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}'} # type: ignore + + async def run_triggered_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs + ) -> None: + """Run a triggered web job for an app, or a deployment slot. + + Description for Run a triggered web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.run_triggered_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + run_triggered_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/run'} # type: ignore + + def list_usages_slot( + self, + resource_group_name: str, + name: str, + slot: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.CsmUsageQuotaCollection"]: + """Gets the quota usage information of an app (or deployment slot, if specified). + + Description for Gets the quota usage information of an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get quota + information of the production slot. + :type slot: str + :param filter: Return only information specified in the filter (using OData syntax). For + example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq + 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_usages_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages'} # type: ignore + + async def list_vnet_connections_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> List["_models.VnetInfo"]: + """Gets the virtual networks the app (or deployment slot) is connected to. + + Description for Gets the virtual networks the app (or deployment slot) is connected to. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get virtual + network connections for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetInfo, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.VnetInfo] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_vnet_connections_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetInfo]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_vnet_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections'} # type: ignore + + async def get_vnet_connection_slot( + self, + resource_group_name: str, + name: str, + vnet_name: str, + slot: str, + **kwargs + ) -> "_models.VnetInfo": + """Gets a virtual network the app (or deployment slot) is connected to by name. + + Description for Gets a virtual network the app (or deployment slot) is connected to by name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + named virtual network for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def create_or_update_vnet_connection_slot( + self, + resource_group_name: str, + name: str, + vnet_name: str, + slot: str, + connection_envelope: "_models.VnetInfo", + **kwargs + ) -> "_models.VnetInfo": + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def delete_vnet_connection_slot( + self, + resource_group_name: str, + name: str, + vnet_name: str, + slot: str, + **kwargs + ) -> None: + """Deletes a connection from an app (or deployment slot to a named virtual network. + + Description for Deletes a connection from an app (or deployment slot to a named virtual + network. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def update_vnet_connection_slot( + self, + resource_group_name: str, + name: str, + vnet_name: str, + slot: str, + connection_envelope: "_models.VnetInfo", + **kwargs + ) -> "_models.VnetInfo": + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfo') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def get_vnet_connection_gateway_slot( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + slot: str, + **kwargs + ) -> Optional["_models.VnetGateway"]: + """Gets an app's Virtual Network gateway. + + Description for Gets an app's Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a + gateway for the production slot's Virtual Network. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetGateway or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VnetGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection_gateway_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection_gateway_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + async def create_or_update_vnet_connection_gateway_slot( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + slot: str, + connection_envelope: "_models.VnetGateway", + **kwargs + ) -> "_models.VnetGateway": + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update a gateway for the production slot's Virtual Network. + :type slot: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection_gateway_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection_gateway_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + async def update_vnet_connection_gateway_slot( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + slot: str, + connection_envelope: "_models.VnetGateway", + **kwargs + ) -> "_models.VnetGateway": + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update a gateway for the production slot's Virtual Network. + :type slot: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection_gateway_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection_gateway_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def list_web_jobs_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs + ) -> AsyncIterable["_models.WebJobCollection"]: + """List webjobs for an app, or a deployment slot. + + Description for List webjobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebJobCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.WebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_jobs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_web_jobs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs'} # type: ignore + + async def get_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs + ) -> "_models.WebJob": + """Get webjob information for an app, or a deployment slot. + + Description for Get webjob information for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of the web job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.WebJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs/{webJobName}'} # type: ignore + + def list_slot_differences_from_production( + self, + resource_group_name: str, + name: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs + ) -> AsyncIterable["_models.SlotDifferenceCollection"]: + """Get the difference in configuration settings between two web app slots. + + Description for Get the difference in configuration settings between two web app slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_09_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SlotDifferenceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.SlotDifferenceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotDifferenceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_slot_differences_from_production.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SlotDifferenceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_slot_differences_from_production.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs'} # type: ignore + + async def _swap_slot_with_production_initial( + self, + resource_group_name: str, + name: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._swap_slot_with_production_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _swap_slot_with_production_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap'} # type: ignore + + async def begin_swap_slot_with_production( + self, + resource_group_name: str, + name: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs + ) -> AsyncLROPoller[None]: + """Swaps two deployment slots of an app. + + Description for Swaps two deployment slots of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_09_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._swap_slot_with_production_initial( + resource_group_name=resource_group_name, + name=name, + slot_swap_entity=slot_swap_entity, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_swap_slot_with_production.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap'} # type: ignore + + def list_snapshots( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.SnapshotCollection"]: + """Returns all Snapshots to the user. + + Description for Returns all Snapshots to the user. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_snapshots.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots'} # type: ignore + + def list_snapshots_from_dr_secondary( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.SnapshotCollection"]: + """Returns all Snapshots to the user from DRSecondary endpoint. + + Description for Returns all Snapshots to the user from DRSecondary endpoint. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots_from_dr_secondary.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_snapshots_from_dr_secondary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshotsdr'} # type: ignore + + async def get_source_control( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> "_models.SiteSourceControl": + """Gets the source control configuration of an app. + + Description for Gets the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + async def _create_or_update_source_control_initial( + self, + resource_group_name: str, + name: str, + site_source_control: "_models.SiteSourceControl", + **kwargs + ) -> "_models.SiteSourceControl": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_source_control_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_source_control_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + async def begin_create_or_update_source_control( + self, + resource_group_name: str, + name: str, + site_source_control: "_models.SiteSourceControl", + **kwargs + ) -> AsyncLROPoller["_models.SiteSourceControl"]: + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2020_09_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 SiteSourceControl or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2020_09_01.models.SiteSourceControl] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_source_control_initial( + resource_group_name=resource_group_name, + name=name, + site_source_control=site_source_control, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + async def delete_source_control( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Deletes the source control configuration of an app. + + Description for Deletes the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + async def update_source_control( + self, + resource_group_name: str, + name: str, + site_source_control: "_models.SiteSourceControl", + **kwargs + ) -> "_models.SiteSourceControl": + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2020_09_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + async def start( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Starts an app (or deployment slot, if specified). + + Description for Starts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.start.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/start'} # type: ignore + + async def _start_network_trace_initial( + self, + resource_group_name: str, + name: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs + ) -> List["_models.NetworkTrace"]: + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._start_network_trace_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_network_trace_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace'} # type: ignore + + async def begin_start_network_trace( + self, + resource_group_name: str, + name: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller[List["_models.NetworkTrace"]]: + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_network_trace_initial( + resource_group_name=resource_group_name, + name=name, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace'} # type: ignore + + async def stop( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Stops an app (or deployment slot, if specified). + + Description for Stops an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.stop.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stop'} # type: ignore + + async def stop_network_trace( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.stop_network_trace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stopNetworkTrace'} # type: ignore + + async def sync_repository( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Sync web app repository. + + Description for Sync web app repository. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.sync_repository.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_repository.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sync'} # type: ignore + + async def sync_function_triggers( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.sync_function_triggers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_function_triggers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/syncfunctiontriggers'} # type: ignore + + def list_triggered_web_jobs( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.TriggeredWebJobCollection"]: + """List triggered web jobs for an app, or a deployment slot. + + Description for List triggered web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredWebJobCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.TriggeredWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_jobs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_triggered_web_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs'} # type: ignore + + async def get_triggered_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs + ) -> Optional["_models.TriggeredWebJob"]: + """Gets a triggered web job by its ID for an app, or a deployment slot. + + Description for Gets a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.TriggeredWebJob or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.TriggeredWebJob"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TriggeredWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}'} # type: ignore + + async def delete_triggered_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs + ) -> None: + """Delete a triggered web job by its ID for an app, or a deployment slot. + + Description for Delete a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_triggered_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_triggered_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}'} # type: ignore + + def list_triggered_web_job_history( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs + ) -> AsyncIterable["_models.TriggeredJobHistoryCollection"]: + """List a triggered web job's history for an app, or a deployment slot. + + Description for List a triggered web job's history for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredJobHistoryCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.TriggeredJobHistoryCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredJobHistoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_job_history.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredJobHistoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_triggered_web_job_history.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history'} # type: ignore + + async def get_triggered_web_job_history( + self, + resource_group_name: str, + name: str, + web_job_name: str, + id: str, + **kwargs + ) -> Optional["_models.TriggeredJobHistory"]: + """Gets a triggered web job's history by its ID for an app, , or a deployment slot. + + Description for Gets a triggered web job's history by its ID for an app, , or a deployment + slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param id: History ID. + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredJobHistory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.TriggeredJobHistory or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.TriggeredJobHistory"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job_history.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TriggeredJobHistory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job_history.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history/{id}'} # type: ignore + + async def run_triggered_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs + ) -> None: + """Run a triggered web job for an app, or a deployment slot. + + Description for Run a triggered web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.run_triggered_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + run_triggered_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/run'} # type: ignore + + def list_usages( + self, + resource_group_name: str, + name: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.CsmUsageQuotaCollection"]: + """Gets the quota usage information of an app (or deployment slot, if specified). + + Description for Gets the quota usage information of an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param filter: Return only information specified in the filter (using OData syntax). For + example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq + 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/usages'} # type: ignore + + async def list_vnet_connections( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> List["_models.VnetInfo"]: + """Gets the virtual networks the app (or deployment slot) is connected to. + + Description for Gets the virtual networks the app (or deployment slot) is connected to. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetInfo, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.VnetInfo] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_vnet_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetInfo]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_vnet_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections'} # type: ignore + + async def get_vnet_connection( + self, + resource_group_name: str, + name: str, + vnet_name: str, + **kwargs + ) -> "_models.VnetInfo": + """Gets a virtual network the app (or deployment slot) is connected to by name. + + Description for Gets a virtual network the app (or deployment slot) is connected to by name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def create_or_update_vnet_connection( + self, + resource_group_name: str, + name: str, + vnet_name: str, + connection_envelope: "_models.VnetInfo", + **kwargs + ) -> "_models.VnetInfo": + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def delete_vnet_connection( + self, + resource_group_name: str, + name: str, + vnet_name: str, + **kwargs + ) -> None: + """Deletes a connection from an app (or deployment slot to a named virtual network. + + Description for Deletes a connection from an app (or deployment slot to a named virtual + network. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def update_vnet_connection( + self, + resource_group_name: str, + name: str, + vnet_name: str, + connection_envelope: "_models.VnetInfo", + **kwargs + ) -> "_models.VnetInfo": + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfo') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def get_vnet_connection_gateway( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + **kwargs + ) -> Optional["_models.VnetGateway"]: + """Gets an app's Virtual Network gateway. + + Description for Gets an app's Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetGateway or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VnetGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + async def create_or_update_vnet_connection_gateway( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + connection_envelope: "_models.VnetGateway", + **kwargs + ) -> "_models.VnetGateway": + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + async def update_vnet_connection_gateway( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + connection_envelope: "_models.VnetGateway", + **kwargs + ) -> "_models.VnetGateway": + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def list_web_jobs( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> AsyncIterable["_models.WebJobCollection"]: + """List webjobs for an app, or a deployment slot. + + Description for List webjobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebJobCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.WebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_jobs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_web_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs'} # type: ignore + + async def get_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs + ) -> "_models.WebJob": + """Get webjob information for an app, or a deployment slot. + + Description for Get webjob information for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of the web job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.WebJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs/{webJobName}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_web_site_management_client_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_web_site_management_client_operations.py new file mode 100644 index 000000000000..5a1f074debd8 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/operations/_web_site_management_client_operations.py @@ -0,0 +1,1121 @@ +# 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, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WebSiteManagementClientOperationsMixin: + + async def generate_github_access_token_for_appservice_cli_async( + self, + code: str, + state: str, + **kwargs + ) -> "_models.AppserviceGithubToken": + """Exchange code for GitHub access token for AppService CLI. + + Description for Exchange code for GitHub access token for AppService CLI. + + :param code: Code string to exchange for Github Access token. + :type code: str + :param state: State string used for verification. + :type state: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppserviceGithubToken, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AppserviceGithubToken + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppserviceGithubToken"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _request = _models.AppserviceGithubTokenRequest(code=code, state=state) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.generate_github_access_token_for_appservice_cli_async.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_request, 'AppserviceGithubTokenRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppserviceGithubToken', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_github_access_token_for_appservice_cli_async.metadata = {'url': '/providers/Microsoft.Web/generateGithubAccessTokenForAppserviceCLI'} # type: ignore + + async def get_publishing_user( + self, + **kwargs + ) -> "_models.User": + """Gets publishing user. + + Description for Gets publishing user. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: User, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.User + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_publishing_user.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_publishing_user.metadata = {'url': '/providers/Microsoft.Web/publishingUsers/web'} # type: ignore + + async def update_publishing_user( + self, + user_details: "_models.User", + **kwargs + ) -> "_models.User": + """Updates publishing user. + + Description for Updates publishing user. + + :param user_details: Details of publishing user. + :type user_details: ~azure.mgmt.web.v2020_09_01.models.User + :keyword callable cls: A custom type or function that will be passed the direct response + :return: User, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.User + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_publishing_user.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(user_details, 'User') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_publishing_user.metadata = {'url': '/providers/Microsoft.Web/publishingUsers/web'} # type: ignore + + def list_source_controls( + self, + **kwargs + ) -> AsyncIterable["_models.SourceControlCollection"]: + """Gets the source controls available for Azure websites. + + Description for Gets the source controls available for Azure websites. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SourceControlCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.SourceControlCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_source_controls.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SourceControlCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_source_controls.metadata = {'url': '/providers/Microsoft.Web/sourcecontrols'} # type: ignore + + async def get_source_control( + self, + source_control_type: str, + **kwargs + ) -> "_models.SourceControl": + """Gets source control token. + + Description for Gets source control token. + + :param source_control_type: Type of source control. + :type source_control_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'sourceControlType': self._serialize.url("source_control_type", source_control_type, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_source_control.metadata = {'url': '/providers/Microsoft.Web/sourcecontrols/{sourceControlType}'} # type: ignore + + async def update_source_control( + self, + source_control_type: str, + request_message: "_models.SourceControl", + **kwargs + ) -> "_models.SourceControl": + """Updates source control token. + + Description for Updates source control token. + + :param source_control_type: Type of source control. + :type source_control_type: str + :param request_message: Source control token information. + :type request_message: ~azure.mgmt.web.v2020_09_01.models.SourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'sourceControlType': self._serialize.url("source_control_type", source_control_type, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request_message, 'SourceControl') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_source_control.metadata = {'url': '/providers/Microsoft.Web/sourcecontrols/{sourceControlType}'} # type: ignore + + def list_billing_meters( + self, + billing_location: Optional[str] = None, + os_type: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.BillingMeterCollection"]: + """Gets a list of meters for a given location. + + Description for Gets a list of meters for a given location. + + :param billing_location: Azure Location of billable resource. + :type billing_location: str + :param os_type: App Service OS type meters used for. + :type os_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BillingMeterCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.BillingMeterCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BillingMeterCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_billing_meters.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if billing_location is not None: + query_parameters['billingLocation'] = self._serialize.query("billing_location", billing_location, 'str') + if os_type is not None: + query_parameters['osType'] = self._serialize.query("os_type", os_type, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BillingMeterCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_billing_meters.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters'} # type: ignore + + async def check_name_availability( + self, + name: str, + type: Union[str, "_models.CheckNameResourceTypes"], + is_fqdn: Optional[bool] = None, + **kwargs + ) -> "_models.ResourceNameAvailability": + """Check if a resource name is available. + + Description for Check if a resource name is available. + + :param name: Resource name to verify. + :type name: str + :param type: Resource type used for verification. + :type type: str or ~azure.mgmt.web.v2020_09_01.models.CheckNameResourceTypes + :param is_fqdn: Is fully qualified domain name. + :type is_fqdn: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceNameAvailability, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ResourceNameAvailability + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNameAvailability"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _request = _models.ResourceNameAvailabilityRequest(name=name, type=type, is_fqdn=is_fqdn) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_request, 'ResourceNameAvailabilityRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceNameAvailability', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability'} # type: ignore + + async def get_subscription_deployment_locations( + self, + **kwargs + ) -> "_models.DeploymentLocations": + """Gets list of available geo regions plus ministamps. + + Description for Gets list of available geo regions plus ministamps. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeploymentLocations, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DeploymentLocations + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLocations"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_subscription_deployment_locations.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeploymentLocations', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_subscription_deployment_locations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/deploymentLocations'} # type: ignore + + def list_geo_regions( + self, + sku: Optional[Union[str, "_models.SkuName"]] = None, + linux_workers_enabled: Optional[bool] = None, + xenon_workers_enabled: Optional[bool] = None, + linux_dynamic_workers_enabled: Optional[bool] = None, + **kwargs + ) -> AsyncIterable["_models.GeoRegionCollection"]: + """Get a list of available geographical regions. + + Description for Get a list of available geographical regions. + + :param sku: Name of SKU used to filter the regions. + :type sku: str or ~azure.mgmt.web.v2020_09_01.models.SkuName + :param linux_workers_enabled: Specify :code:`true` if you want to filter to only + regions that support Linux workers. + :type linux_workers_enabled: bool + :param xenon_workers_enabled: Specify :code:`true` if you want to filter to only + regions that support Xenon workers. + :type xenon_workers_enabled: bool + :param linux_dynamic_workers_enabled: Specify :code:`true` if you want to filter + to only regions that support Linux Consumption Workers. + :type linux_dynamic_workers_enabled: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GeoRegionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.GeoRegionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GeoRegionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_geo_regions.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if sku is not None: + query_parameters['sku'] = self._serialize.query("sku", sku, 'str') + if linux_workers_enabled is not None: + query_parameters['linuxWorkersEnabled'] = self._serialize.query("linux_workers_enabled", linux_workers_enabled, 'bool') + if xenon_workers_enabled is not None: + query_parameters['xenonWorkersEnabled'] = self._serialize.query("xenon_workers_enabled", xenon_workers_enabled, 'bool') + if linux_dynamic_workers_enabled is not None: + query_parameters['linuxDynamicWorkersEnabled'] = self._serialize.query("linux_dynamic_workers_enabled", linux_dynamic_workers_enabled, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('GeoRegionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_geo_regions.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/geoRegions'} # type: ignore + + def list_site_identifiers_assigned_to_host_name( + self, + name_identifier: "_models.NameIdentifier", + **kwargs + ) -> AsyncIterable["_models.IdentifierCollection"]: + """List all apps that are assigned to a hostname. + + Description for List all apps that are assigned to a hostname. + + :param name_identifier: Hostname information. + :type name_identifier: ~azure.mgmt.web.v2020_09_01.models.NameIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IdentifierCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.IdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_identifiers_assigned_to_host_name.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(name_identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(name_identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_identifiers_assigned_to_host_name.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/listSitesAssignedToHostName'} # type: ignore + + def list_premier_add_on_offers( + self, + **kwargs + ) -> AsyncIterable["_models.PremierAddOnOfferCollection"]: + """List all premier add-on offers. + + Description for List all premier add-on offers. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PremierAddOnOfferCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2020_09_01.models.PremierAddOnOfferCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOnOfferCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_premier_add_on_offers.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PremierAddOnOfferCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_premier_add_on_offers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/premieraddonoffers'} # type: ignore + + async def list_skus( + self, + **kwargs + ) -> "_models.SkuInfos": + """List all SKUs. + + Description for List all SKUs. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuInfos, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SkuInfos + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInfos"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuInfos', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/skus'} # type: ignore + + async def verify_hosting_environment_vnet( + self, + parameters: "_models.VnetParameters", + **kwargs + ) -> "_models.VnetValidationFailureDetails": + """Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules. + + Description for Verifies if this VNET is compatible with an App Service Environment by + analyzing the Network Security Group rules. + + :param parameters: VNET information. + :type parameters: ~azure.mgmt.web.v2020_09_01.models.VnetParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetValidationFailureDetails, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetValidationFailureDetails + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetValidationFailureDetails"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.verify_hosting_environment_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VnetParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetValidationFailureDetails', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + verify_hosting_environment_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/verifyHostingEnvironmentVnet'} # type: ignore + + async def move( + self, + resource_group_name: str, + move_resource_envelope: "_models.CsmMoveResourceEnvelope", + **kwargs + ) -> None: + """Move resources between resource groups. + + Description for Move resources between resource groups. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param move_resource_envelope: Object that represents the resource to move. + :type move_resource_envelope: ~azure.mgmt.web.v2020_09_01.models.CsmMoveResourceEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.move.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(move_resource_envelope, 'CsmMoveResourceEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources'} # type: ignore + + async def validate( + self, + resource_group_name: str, + validate_request: "_models.ValidateRequest", + **kwargs + ) -> "_models.ValidateResponse": + """Validate if a resource can be created. + + Description for Validate if a resource can be created. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param validate_request: Request with the resources to validate. + :type validate_request: ~azure.mgmt.web.v2020_09_01.models.ValidateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidateResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ValidateResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(validate_request, 'ValidateRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ValidateResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validate'} # type: ignore + + async def validate_move( + self, + resource_group_name: str, + move_resource_envelope: "_models.CsmMoveResourceEnvelope", + **kwargs + ) -> None: + """Validate whether a resource can be moved. + + Description for Validate whether a resource can be moved. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param move_resource_envelope: Object that represents the resource to move. + :type move_resource_envelope: ~azure.mgmt.web.v2020_09_01.models.CsmMoveResourceEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_move.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(move_resource_envelope, 'CsmMoveResourceEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + validate_move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/validateMoveResources'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/models/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/models/__init__.py new file mode 100644 index 000000000000..0bb56e63d805 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/models/__init__.py @@ -0,0 +1,1210 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AbnormalTimePeriod + from ._models_py3 import Address + from ._models_py3 import AddressResponse + from ._models_py3 import AllowedAudiencesValidation + from ._models_py3 import AnalysisData + from ._models_py3 import AnalysisDefinition + from ._models_py3 import ApiDefinitionInfo + from ._models_py3 import ApiManagementConfig + from ._models_py3 import AppRegistration + from ._models_py3 import AppServiceCertificate + from ._models_py3 import AppServiceCertificateCollection + from ._models_py3 import AppServiceCertificateOrder + from ._models_py3 import AppServiceCertificateOrderCollection + from ._models_py3 import AppServiceCertificateOrderPatchResource + from ._models_py3 import AppServiceCertificatePatchResource + from ._models_py3 import AppServiceCertificateResource + from ._models_py3 import AppServiceEnvironment + from ._models_py3 import AppServiceEnvironmentCollection + from ._models_py3 import AppServiceEnvironmentPatchResource + from ._models_py3 import AppServiceEnvironmentResource + from ._models_py3 import AppServicePlan + from ._models_py3 import AppServicePlanCollection + from ._models_py3 import AppServicePlanPatchResource + from ._models_py3 import ApplicationLogsConfig + from ._models_py3 import ApplicationStack + from ._models_py3 import ApplicationStackCollection + from ._models_py3 import ApplicationStackResource + from ._models_py3 import AppserviceGithubToken + from ._models_py3 import AppserviceGithubTokenRequest + from ._models_py3 import ArmIdWrapper + from ._models_py3 import AuthPlatform + from ._models_py3 import AutoHealActions + from ._models_py3 import AutoHealCustomAction + from ._models_py3 import AutoHealRules + from ._models_py3 import AutoHealTriggers + from ._models_py3 import AzureActiveDirectory + from ._models_py3 import AzureActiveDirectoryLogin + from ._models_py3 import AzureActiveDirectoryRegistration + from ._models_py3 import AzureActiveDirectoryValidation + from ._models_py3 import AzureBlobStorageApplicationLogsConfig + from ._models_py3 import AzureBlobStorageHttpLogsConfig + from ._models_py3 import AzureStorageInfoValue + from ._models_py3 import AzureStoragePropertyDictionaryResource + from ._models_py3 import AzureTableStorageApplicationLogsConfig + from ._models_py3 import BackupItem + from ._models_py3 import BackupItemCollection + from ._models_py3 import BackupRequest + from ._models_py3 import BackupSchedule + from ._models_py3 import BillingMeter + from ._models_py3 import BillingMeterCollection + from ._models_py3 import BlobStorageTokenStore + from ._models_py3 import Capability + from ._models_py3 import Certificate + from ._models_py3 import CertificateCollection + from ._models_py3 import CertificateDetails + from ._models_py3 import CertificateEmail + from ._models_py3 import CertificateOrderAction + from ._models_py3 import CertificatePatchResource + from ._models_py3 import ClientRegistration + from ._models_py3 import CloningInfo + from ._models_py3 import Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties + from ._models_py3 import ConnStringInfo + from ._models_py3 import ConnStringValueTypePair + from ._models_py3 import ConnectionStringDictionary + from ._models_py3 import Contact + from ._models_py3 import ContainerCpuStatistics + from ._models_py3 import ContainerCpuUsage + from ._models_py3 import ContainerInfo + from ._models_py3 import ContainerMemoryStatistics + from ._models_py3 import ContainerNetworkInterfaceStatistics + from ._models_py3 import ContainerThrottlingData + from ._models_py3 import ContinuousWebJob + from ._models_py3 import ContinuousWebJobCollection + from ._models_py3 import CookieExpiration + from ._models_py3 import CorsSettings + from ._models_py3 import CsmCopySlotEntity + from ._models_py3 import CsmMoveResourceEnvelope + from ._models_py3 import CsmOperationCollection + from ._models_py3 import CsmOperationDescription + from ._models_py3 import CsmOperationDescriptionProperties + from ._models_py3 import CsmOperationDisplay + from ._models_py3 import CsmPublishingCredentialsPoliciesCollection + from ._models_py3 import CsmPublishingCredentialsPoliciesEntity + from ._models_py3 import CsmPublishingProfileOptions + from ._models_py3 import CsmSlotEntity + from ._models_py3 import CsmUsageQuota + from ._models_py3 import CsmUsageQuotaCollection + from ._models_py3 import CustomHostnameAnalysisResult + from ._models_py3 import CustomOpenIdConnectProvider + from ._models_py3 import DataSource + from ._models_py3 import DataTableResponseColumn + from ._models_py3 import DataTableResponseObject + from ._models_py3 import DatabaseBackupSetting + from ._models_py3 import DefaultErrorResponse + from ._models_py3 import DefaultErrorResponseError + from ._models_py3 import DefaultErrorResponseErrorDetailsItem + from ._models_py3 import DeletedAppRestoreRequest + from ._models_py3 import DeletedSite + from ._models_py3 import DeletedWebAppCollection + from ._models_py3 import Deployment + from ._models_py3 import DeploymentCollection + from ._models_py3 import DeploymentLocations + from ._models_py3 import DetectorAbnormalTimePeriod + from ._models_py3 import DetectorDefinition + from ._models_py3 import DetectorInfo + from ._models_py3 import DetectorResponse + from ._models_py3 import DetectorResponseCollection + from ._models_py3 import DiagnosticAnalysis + from ._models_py3 import DiagnosticAnalysisCollection + from ._models_py3 import DiagnosticCategory + from ._models_py3 import DiagnosticCategoryCollection + from ._models_py3 import DiagnosticData + from ._models_py3 import DiagnosticDetectorCollection + from ._models_py3 import DiagnosticDetectorResponse + from ._models_py3 import DiagnosticMetricSample + from ._models_py3 import DiagnosticMetricSet + from ._models_py3 import Dimension + from ._models_py3 import Domain + from ._models_py3 import DomainAvailabilityCheckResult + from ._models_py3 import DomainCollection + from ._models_py3 import DomainControlCenterSsoRequest + from ._models_py3 import DomainOwnershipIdentifier + from ._models_py3 import DomainOwnershipIdentifierCollection + from ._models_py3 import DomainPatchResource + from ._models_py3 import DomainPurchaseConsent + from ._models_py3 import DomainRecommendationSearchParameters + from ._models_py3 import EnabledConfig + from ._models_py3 import EndpointDependency + from ._models_py3 import EndpointDetail + from ._models_py3 import ErrorEntity + from ._models_py3 import Experiments + from ._models_py3 import Facebook + from ._models_py3 import FileSystemApplicationLogsConfig + from ._models_py3 import FileSystemHttpLogsConfig + from ._models_py3 import FileSystemTokenStore + from ._models_py3 import ForwardProxy + from ._models_py3 import FunctionEnvelope + from ._models_py3 import FunctionEnvelopeCollection + from ._models_py3 import FunctionSecrets + from ._models_py3 import GeoRegion + from ._models_py3 import GeoRegionCollection + from ._models_py3 import GitHub + from ._models_py3 import GlobalCsmSkuDescription + from ._models_py3 import GlobalValidation + from ._models_py3 import Google + from ._models_py3 import HandlerMapping + from ._models_py3 import HostKeys + from ._models_py3 import HostName + from ._models_py3 import HostNameBinding + from ._models_py3 import HostNameBindingCollection + from ._models_py3 import HostNameSslState + from ._models_py3 import HostingEnvironmentDeploymentInfo + from ._models_py3 import HostingEnvironmentDiagnostics + from ._models_py3 import HostingEnvironmentProfile + from ._models_py3 import HttpLogsConfig + from ._models_py3 import HttpSettings + from ._models_py3 import HttpSettingsRoutes + from ._models_py3 import HybridConnection + from ._models_py3 import HybridConnectionCollection + from ._models_py3 import HybridConnectionKey + from ._models_py3 import HybridConnectionLimits + from ._models_py3 import Identifier + from ._models_py3 import IdentifierCollection + from ._models_py3 import IdentityProviders + from ._models_py3 import InboundEnvironmentEndpoint + from ._models_py3 import InboundEnvironmentEndpointCollection + from ._models_py3 import IpSecurityRestriction + from ._models_py3 import JwtClaimChecks + from ._models_py3 import KeyInfo + from ._models_py3 import LocalizableString + from ._models_py3 import LogSpecification + from ._models_py3 import Login + from ._models_py3 import LoginRoutes + from ._models_py3 import LoginScopes + from ._models_py3 import MSDeploy + from ._models_py3 import MSDeployLog + from ._models_py3 import MSDeployLogEntry + from ._models_py3 import MSDeployStatus + from ._models_py3 import ManagedServiceIdentity + from ._models_py3 import MetricAvailability + from ._models_py3 import MetricSpecification + from ._models_py3 import MigrateMySqlRequest + from ._models_py3 import MigrateMySqlStatus + from ._models_py3 import NameIdentifier + from ._models_py3 import NameIdentifierCollection + from ._models_py3 import NameValuePair + from ._models_py3 import NetworkAccessControlEntry + from ._models_py3 import NetworkFeatures + from ._models_py3 import NetworkTrace + from ._models_py3 import Nonce + from ._models_py3 import OpenIdConnectClientCredential + from ._models_py3 import OpenIdConnectConfig + from ._models_py3 import OpenIdConnectLogin + from ._models_py3 import OpenIdConnectRegistration + from ._models_py3 import Operation + from ._models_py3 import OutboundEnvironmentEndpoint + from ._models_py3 import OutboundEnvironmentEndpointCollection + from ._models_py3 import PerfMonCounterCollection + from ._models_py3 import PerfMonResponse + from ._models_py3 import PerfMonSample + from ._models_py3 import PerfMonSet + from ._models_py3 import PremierAddOn + from ._models_py3 import PremierAddOnOffer + from ._models_py3 import PremierAddOnOfferCollection + from ._models_py3 import PremierAddOnPatchResource + from ._models_py3 import PrivateAccess + from ._models_py3 import PrivateAccessSubnet + from ._models_py3 import PrivateAccessVirtualNetwork + from ._models_py3 import PrivateEndpointConnectionResource + from ._models_py3 import PrivateLinkConnectionApprovalRequestResource + from ._models_py3 import PrivateLinkConnectionState + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourceProperties + from ._models_py3 import PrivateLinkResourcesWrapper + from ._models_py3 import ProcessInfo + from ._models_py3 import ProcessInfoCollection + from ._models_py3 import ProcessModuleInfo + from ._models_py3 import ProcessModuleInfoCollection + from ._models_py3 import ProcessThreadInfo + from ._models_py3 import ProcessThreadInfoCollection + from ._models_py3 import ProxyOnlyResource + from ._models_py3 import PublicCertificate + from ._models_py3 import PublicCertificateCollection + from ._models_py3 import PushSettings + from ._models_py3 import RampUpRule + from ._models_py3 import Recommendation + from ._models_py3 import RecommendationCollection + from ._models_py3 import RecommendationRule + from ._models_py3 import ReissueCertificateOrderRequest + from ._models_py3 import RelayServiceConnectionEntity + from ._models_py3 import Rendering + from ._models_py3 import RenewCertificateOrderRequest + from ._models_py3 import RequestsBasedTrigger + from ._models_py3 import Resource + from ._models_py3 import ResourceCollection + from ._models_py3 import ResourceHealthMetadata + from ._models_py3 import ResourceHealthMetadataCollection + from ._models_py3 import ResourceMetricAvailability + from ._models_py3 import ResourceMetricDefinition + from ._models_py3 import ResourceMetricDefinitionCollection + from ._models_py3 import ResourceNameAvailability + from ._models_py3 import ResourceNameAvailabilityRequest + from ._models_py3 import ResponseMetaData + from ._models_py3 import RestoreRequest + from ._models_py3 import ServiceSpecification + from ._models_py3 import Site + from ._models_py3 import SiteAuthSettings + from ._models_py3 import SiteAuthSettingsV2 + from ._models_py3 import SiteCloneability + from ._models_py3 import SiteCloneabilityCriterion + from ._models_py3 import SiteConfig + from ._models_py3 import SiteConfigResource + from ._models_py3 import SiteConfigResourceCollection + from ._models_py3 import SiteConfigurationSnapshotInfo + from ._models_py3 import SiteConfigurationSnapshotInfoCollection + from ._models_py3 import SiteExtensionInfo + from ._models_py3 import SiteExtensionInfoCollection + from ._models_py3 import SiteLimits + from ._models_py3 import SiteLogsConfig + from ._models_py3 import SiteMachineKey + from ._models_py3 import SitePatchResource + from ._models_py3 import SitePhpErrorLogFlag + from ._models_py3 import SiteSeal + from ._models_py3 import SiteSealRequest + from ._models_py3 import SiteSourceControl + from ._models_py3 import SkuCapacity + from ._models_py3 import SkuDescription + from ._models_py3 import SkuInfo + from ._models_py3 import SkuInfoCollection + from ._models_py3 import SkuInfos + from ._models_py3 import SlotConfigNamesResource + from ._models_py3 import SlotDifference + from ._models_py3 import SlotDifferenceCollection + from ._models_py3 import SlotSwapStatus + from ._models_py3 import SlowRequestsBasedTrigger + from ._models_py3 import Snapshot + from ._models_py3 import SnapshotCollection + from ._models_py3 import SnapshotRecoverySource + from ._models_py3 import SnapshotRestoreRequest + from ._models_py3 import Solution + from ._models_py3 import SourceControl + from ._models_py3 import SourceControlCollection + from ._models_py3 import StackMajorVersion + from ._models_py3 import StackMinorVersion + from ._models_py3 import StampCapacity + from ._models_py3 import StampCapacityCollection + from ._models_py3 import StaticSiteARMResource + from ._models_py3 import StaticSiteBuildARMResource + from ._models_py3 import StaticSiteBuildCollection + from ._models_py3 import StaticSiteBuildProperties + from ._models_py3 import StaticSiteCollection + from ._models_py3 import StaticSiteCustomDomainOverviewARMResource + from ._models_py3 import StaticSiteCustomDomainOverviewCollection + from ._models_py3 import StaticSiteFunctionOverviewARMResource + from ._models_py3 import StaticSiteFunctionOverviewCollection + from ._models_py3 import StaticSitePatchResource + from ._models_py3 import StaticSiteResetPropertiesARMResource + from ._models_py3 import StaticSiteUserARMResource + from ._models_py3 import StaticSiteUserCollection + from ._models_py3 import StaticSiteUserInvitationRequestResource + from ._models_py3 import StaticSiteUserInvitationResponseResource + from ._models_py3 import StaticSitesWorkflowPreview + from ._models_py3 import StaticSitesWorkflowPreviewRequest + from ._models_py3 import StatusCodesBasedTrigger + from ._models_py3 import StorageMigrationOptions + from ._models_py3 import StorageMigrationResponse + from ._models_py3 import StringDictionary + from ._models_py3 import SwiftVirtualNetwork + from ._models_py3 import SystemData + from ._models_py3 import TldLegalAgreement + from ._models_py3 import TldLegalAgreementCollection + from ._models_py3 import TokenStore + from ._models_py3 import TopLevelDomain + from ._models_py3 import TopLevelDomainAgreementOption + from ._models_py3 import TopLevelDomainCollection + from ._models_py3 import TriggeredJobHistory + from ._models_py3 import TriggeredJobHistoryCollection + from ._models_py3 import TriggeredJobRun + from ._models_py3 import TriggeredWebJob + from ._models_py3 import TriggeredWebJobCollection + from ._models_py3 import Twitter + from ._models_py3 import TwitterRegistration + from ._models_py3 import Usage + from ._models_py3 import UsageCollection + from ._models_py3 import User + from ._models_py3 import ValidateRequest + from ._models_py3 import ValidateResponse + from ._models_py3 import ValidateResponseError + from ._models_py3 import VirtualApplication + from ._models_py3 import VirtualDirectory + from ._models_py3 import VirtualIPMapping + from ._models_py3 import VirtualNetworkProfile + from ._models_py3 import VnetGateway + from ._models_py3 import VnetInfo + from ._models_py3 import VnetParameters + from ._models_py3 import VnetRoute + from ._models_py3 import VnetValidationFailureDetails + from ._models_py3 import VnetValidationTestFailure + from ._models_py3 import WebAppCollection + from ._models_py3 import WebAppInstanceStatusCollection + from ._models_py3 import WebJob + from ._models_py3 import WebJobCollection + from ._models_py3 import WebSiteInstanceStatus + from ._models_py3 import WorkerPool + from ._models_py3 import WorkerPoolCollection + from ._models_py3 import WorkerPoolResource +except (SyntaxError, ImportError): + from ._models import AbnormalTimePeriod # type: ignore + from ._models import Address # type: ignore + from ._models import AddressResponse # type: ignore + from ._models import AllowedAudiencesValidation # type: ignore + from ._models import AnalysisData # type: ignore + from ._models import AnalysisDefinition # type: ignore + from ._models import ApiDefinitionInfo # type: ignore + from ._models import ApiManagementConfig # type: ignore + from ._models import AppRegistration # type: ignore + from ._models import AppServiceCertificate # type: ignore + from ._models import AppServiceCertificateCollection # type: ignore + from ._models import AppServiceCertificateOrder # type: ignore + from ._models import AppServiceCertificateOrderCollection # type: ignore + from ._models import AppServiceCertificateOrderPatchResource # type: ignore + from ._models import AppServiceCertificatePatchResource # type: ignore + from ._models import AppServiceCertificateResource # type: ignore + from ._models import AppServiceEnvironment # type: ignore + from ._models import AppServiceEnvironmentCollection # type: ignore + from ._models import AppServiceEnvironmentPatchResource # type: ignore + from ._models import AppServiceEnvironmentResource # type: ignore + from ._models import AppServicePlan # type: ignore + from ._models import AppServicePlanCollection # type: ignore + from ._models import AppServicePlanPatchResource # type: ignore + from ._models import ApplicationLogsConfig # type: ignore + from ._models import ApplicationStack # type: ignore + from ._models import ApplicationStackCollection # type: ignore + from ._models import ApplicationStackResource # type: ignore + from ._models import AppserviceGithubToken # type: ignore + from ._models import AppserviceGithubTokenRequest # type: ignore + from ._models import ArmIdWrapper # type: ignore + from ._models import AuthPlatform # type: ignore + from ._models import AutoHealActions # type: ignore + from ._models import AutoHealCustomAction # type: ignore + from ._models import AutoHealRules # type: ignore + from ._models import AutoHealTriggers # type: ignore + from ._models import AzureActiveDirectory # type: ignore + from ._models import AzureActiveDirectoryLogin # type: ignore + from ._models import AzureActiveDirectoryRegistration # type: ignore + from ._models import AzureActiveDirectoryValidation # type: ignore + from ._models import AzureBlobStorageApplicationLogsConfig # type: ignore + from ._models import AzureBlobStorageHttpLogsConfig # type: ignore + from ._models import AzureStorageInfoValue # type: ignore + from ._models import AzureStoragePropertyDictionaryResource # type: ignore + from ._models import AzureTableStorageApplicationLogsConfig # type: ignore + from ._models import BackupItem # type: ignore + from ._models import BackupItemCollection # type: ignore + from ._models import BackupRequest # type: ignore + from ._models import BackupSchedule # type: ignore + from ._models import BillingMeter # type: ignore + from ._models import BillingMeterCollection # type: ignore + from ._models import BlobStorageTokenStore # type: ignore + from ._models import Capability # type: ignore + from ._models import Certificate # type: ignore + from ._models import CertificateCollection # type: ignore + from ._models import CertificateDetails # type: ignore + from ._models import CertificateEmail # type: ignore + from ._models import CertificateOrderAction # type: ignore + from ._models import CertificatePatchResource # type: ignore + from ._models import ClientRegistration # type: ignore + from ._models import CloningInfo # type: ignore + from ._models import Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore + from ._models import ConnStringInfo # type: ignore + from ._models import ConnStringValueTypePair # type: ignore + from ._models import ConnectionStringDictionary # type: ignore + from ._models import Contact # type: ignore + from ._models import ContainerCpuStatistics # type: ignore + from ._models import ContainerCpuUsage # type: ignore + from ._models import ContainerInfo # type: ignore + from ._models import ContainerMemoryStatistics # type: ignore + from ._models import ContainerNetworkInterfaceStatistics # type: ignore + from ._models import ContainerThrottlingData # type: ignore + from ._models import ContinuousWebJob # type: ignore + from ._models import ContinuousWebJobCollection # type: ignore + from ._models import CookieExpiration # type: ignore + from ._models import CorsSettings # type: ignore + from ._models import CsmCopySlotEntity # type: ignore + from ._models import CsmMoveResourceEnvelope # type: ignore + from ._models import CsmOperationCollection # type: ignore + from ._models import CsmOperationDescription # type: ignore + from ._models import CsmOperationDescriptionProperties # type: ignore + from ._models import CsmOperationDisplay # type: ignore + from ._models import CsmPublishingCredentialsPoliciesCollection # type: ignore + from ._models import CsmPublishingCredentialsPoliciesEntity # type: ignore + from ._models import CsmPublishingProfileOptions # type: ignore + from ._models import CsmSlotEntity # type: ignore + from ._models import CsmUsageQuota # type: ignore + from ._models import CsmUsageQuotaCollection # type: ignore + from ._models import CustomHostnameAnalysisResult # type: ignore + from ._models import CustomOpenIdConnectProvider # type: ignore + from ._models import DataSource # type: ignore + from ._models import DataTableResponseColumn # type: ignore + from ._models import DataTableResponseObject # type: ignore + from ._models import DatabaseBackupSetting # type: ignore + from ._models import DefaultErrorResponse # type: ignore + from ._models import DefaultErrorResponseError # type: ignore + from ._models import DefaultErrorResponseErrorDetailsItem # type: ignore + from ._models import DeletedAppRestoreRequest # type: ignore + from ._models import DeletedSite # type: ignore + from ._models import DeletedWebAppCollection # type: ignore + from ._models import Deployment # type: ignore + from ._models import DeploymentCollection # type: ignore + from ._models import DeploymentLocations # type: ignore + from ._models import DetectorAbnormalTimePeriod # type: ignore + from ._models import DetectorDefinition # type: ignore + from ._models import DetectorInfo # type: ignore + from ._models import DetectorResponse # type: ignore + from ._models import DetectorResponseCollection # type: ignore + from ._models import DiagnosticAnalysis # type: ignore + from ._models import DiagnosticAnalysisCollection # type: ignore + from ._models import DiagnosticCategory # type: ignore + from ._models import DiagnosticCategoryCollection # type: ignore + from ._models import DiagnosticData # type: ignore + from ._models import DiagnosticDetectorCollection # type: ignore + from ._models import DiagnosticDetectorResponse # type: ignore + from ._models import DiagnosticMetricSample # type: ignore + from ._models import DiagnosticMetricSet # type: ignore + from ._models import Dimension # type: ignore + from ._models import Domain # type: ignore + from ._models import DomainAvailabilityCheckResult # type: ignore + from ._models import DomainCollection # type: ignore + from ._models import DomainControlCenterSsoRequest # type: ignore + from ._models import DomainOwnershipIdentifier # type: ignore + from ._models import DomainOwnershipIdentifierCollection # type: ignore + from ._models import DomainPatchResource # type: ignore + from ._models import DomainPurchaseConsent # type: ignore + from ._models import DomainRecommendationSearchParameters # type: ignore + from ._models import EnabledConfig # type: ignore + from ._models import EndpointDependency # type: ignore + from ._models import EndpointDetail # type: ignore + from ._models import ErrorEntity # type: ignore + from ._models import Experiments # type: ignore + from ._models import Facebook # type: ignore + from ._models import FileSystemApplicationLogsConfig # type: ignore + from ._models import FileSystemHttpLogsConfig # type: ignore + from ._models import FileSystemTokenStore # type: ignore + from ._models import ForwardProxy # type: ignore + from ._models import FunctionEnvelope # type: ignore + from ._models import FunctionEnvelopeCollection # type: ignore + from ._models import FunctionSecrets # type: ignore + from ._models import GeoRegion # type: ignore + from ._models import GeoRegionCollection # type: ignore + from ._models import GitHub # type: ignore + from ._models import GlobalCsmSkuDescription # type: ignore + from ._models import GlobalValidation # type: ignore + from ._models import Google # type: ignore + from ._models import HandlerMapping # type: ignore + from ._models import HostKeys # type: ignore + from ._models import HostName # type: ignore + from ._models import HostNameBinding # type: ignore + from ._models import HostNameBindingCollection # type: ignore + from ._models import HostNameSslState # type: ignore + from ._models import HostingEnvironmentDeploymentInfo # type: ignore + from ._models import HostingEnvironmentDiagnostics # type: ignore + from ._models import HostingEnvironmentProfile # type: ignore + from ._models import HttpLogsConfig # type: ignore + from ._models import HttpSettings # type: ignore + from ._models import HttpSettingsRoutes # type: ignore + from ._models import HybridConnection # type: ignore + from ._models import HybridConnectionCollection # type: ignore + from ._models import HybridConnectionKey # type: ignore + from ._models import HybridConnectionLimits # type: ignore + from ._models import Identifier # type: ignore + from ._models import IdentifierCollection # type: ignore + from ._models import IdentityProviders # type: ignore + from ._models import InboundEnvironmentEndpoint # type: ignore + from ._models import InboundEnvironmentEndpointCollection # type: ignore + from ._models import IpSecurityRestriction # type: ignore + from ._models import JwtClaimChecks # type: ignore + from ._models import KeyInfo # type: ignore + from ._models import LocalizableString # type: ignore + from ._models import LogSpecification # type: ignore + from ._models import Login # type: ignore + from ._models import LoginRoutes # type: ignore + from ._models import LoginScopes # type: ignore + from ._models import MSDeploy # type: ignore + from ._models import MSDeployLog # type: ignore + from ._models import MSDeployLogEntry # type: ignore + from ._models import MSDeployStatus # type: ignore + from ._models import ManagedServiceIdentity # type: ignore + from ._models import MetricAvailability # type: ignore + from ._models import MetricSpecification # type: ignore + from ._models import MigrateMySqlRequest # type: ignore + from ._models import MigrateMySqlStatus # type: ignore + from ._models import NameIdentifier # type: ignore + from ._models import NameIdentifierCollection # type: ignore + from ._models import NameValuePair # type: ignore + from ._models import NetworkAccessControlEntry # type: ignore + from ._models import NetworkFeatures # type: ignore + from ._models import NetworkTrace # type: ignore + from ._models import Nonce # type: ignore + from ._models import OpenIdConnectClientCredential # type: ignore + from ._models import OpenIdConnectConfig # type: ignore + from ._models import OpenIdConnectLogin # type: ignore + from ._models import OpenIdConnectRegistration # type: ignore + from ._models import Operation # type: ignore + from ._models import OutboundEnvironmentEndpoint # type: ignore + from ._models import OutboundEnvironmentEndpointCollection # type: ignore + from ._models import PerfMonCounterCollection # type: ignore + from ._models import PerfMonResponse # type: ignore + from ._models import PerfMonSample # type: ignore + from ._models import PerfMonSet # type: ignore + from ._models import PremierAddOn # type: ignore + from ._models import PremierAddOnOffer # type: ignore + from ._models import PremierAddOnOfferCollection # type: ignore + from ._models import PremierAddOnPatchResource # type: ignore + from ._models import PrivateAccess # type: ignore + from ._models import PrivateAccessSubnet # type: ignore + from ._models import PrivateAccessVirtualNetwork # type: ignore + from ._models import PrivateEndpointConnectionResource # type: ignore + from ._models import PrivateLinkConnectionApprovalRequestResource # type: ignore + from ._models import PrivateLinkConnectionState # type: ignore + from ._models import PrivateLinkResource # type: ignore + from ._models import PrivateLinkResourceProperties # type: ignore + from ._models import PrivateLinkResourcesWrapper # type: ignore + from ._models import ProcessInfo # type: ignore + from ._models import ProcessInfoCollection # type: ignore + from ._models import ProcessModuleInfo # type: ignore + from ._models import ProcessModuleInfoCollection # type: ignore + from ._models import ProcessThreadInfo # type: ignore + from ._models import ProcessThreadInfoCollection # type: ignore + from ._models import ProxyOnlyResource # type: ignore + from ._models import PublicCertificate # type: ignore + from ._models import PublicCertificateCollection # type: ignore + from ._models import PushSettings # type: ignore + from ._models import RampUpRule # type: ignore + from ._models import Recommendation # type: ignore + from ._models import RecommendationCollection # type: ignore + from ._models import RecommendationRule # type: ignore + from ._models import ReissueCertificateOrderRequest # type: ignore + from ._models import RelayServiceConnectionEntity # type: ignore + from ._models import Rendering # type: ignore + from ._models import RenewCertificateOrderRequest # type: ignore + from ._models import RequestsBasedTrigger # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceCollection # type: ignore + from ._models import ResourceHealthMetadata # type: ignore + from ._models import ResourceHealthMetadataCollection # type: ignore + from ._models import ResourceMetricAvailability # type: ignore + from ._models import ResourceMetricDefinition # type: ignore + from ._models import ResourceMetricDefinitionCollection # type: ignore + from ._models import ResourceNameAvailability # type: ignore + from ._models import ResourceNameAvailabilityRequest # type: ignore + from ._models import ResponseMetaData # type: ignore + from ._models import RestoreRequest # type: ignore + from ._models import ServiceSpecification # type: ignore + from ._models import Site # type: ignore + from ._models import SiteAuthSettings # type: ignore + from ._models import SiteAuthSettingsV2 # type: ignore + from ._models import SiteCloneability # type: ignore + from ._models import SiteCloneabilityCriterion # type: ignore + from ._models import SiteConfig # type: ignore + from ._models import SiteConfigResource # type: ignore + from ._models import SiteConfigResourceCollection # type: ignore + from ._models import SiteConfigurationSnapshotInfo # type: ignore + from ._models import SiteConfigurationSnapshotInfoCollection # type: ignore + from ._models import SiteExtensionInfo # type: ignore + from ._models import SiteExtensionInfoCollection # type: ignore + from ._models import SiteLimits # type: ignore + from ._models import SiteLogsConfig # type: ignore + from ._models import SiteMachineKey # type: ignore + from ._models import SitePatchResource # type: ignore + from ._models import SitePhpErrorLogFlag # type: ignore + from ._models import SiteSeal # type: ignore + from ._models import SiteSealRequest # type: ignore + from ._models import SiteSourceControl # type: ignore + from ._models import SkuCapacity # type: ignore + from ._models import SkuDescription # type: ignore + from ._models import SkuInfo # type: ignore + from ._models import SkuInfoCollection # type: ignore + from ._models import SkuInfos # type: ignore + from ._models import SlotConfigNamesResource # type: ignore + from ._models import SlotDifference # type: ignore + from ._models import SlotDifferenceCollection # type: ignore + from ._models import SlotSwapStatus # type: ignore + from ._models import SlowRequestsBasedTrigger # type: ignore + from ._models import Snapshot # type: ignore + from ._models import SnapshotCollection # type: ignore + from ._models import SnapshotRecoverySource # type: ignore + from ._models import SnapshotRestoreRequest # type: ignore + from ._models import Solution # type: ignore + from ._models import SourceControl # type: ignore + from ._models import SourceControlCollection # type: ignore + from ._models import StackMajorVersion # type: ignore + from ._models import StackMinorVersion # type: ignore + from ._models import StampCapacity # type: ignore + from ._models import StampCapacityCollection # type: ignore + from ._models import StaticSiteARMResource # type: ignore + from ._models import StaticSiteBuildARMResource # type: ignore + from ._models import StaticSiteBuildCollection # type: ignore + from ._models import StaticSiteBuildProperties # type: ignore + from ._models import StaticSiteCollection # type: ignore + from ._models import StaticSiteCustomDomainOverviewARMResource # type: ignore + from ._models import StaticSiteCustomDomainOverviewCollection # type: ignore + from ._models import StaticSiteFunctionOverviewARMResource # type: ignore + from ._models import StaticSiteFunctionOverviewCollection # type: ignore + from ._models import StaticSitePatchResource # type: ignore + from ._models import StaticSiteResetPropertiesARMResource # type: ignore + from ._models import StaticSiteUserARMResource # type: ignore + from ._models import StaticSiteUserCollection # type: ignore + from ._models import StaticSiteUserInvitationRequestResource # type: ignore + from ._models import StaticSiteUserInvitationResponseResource # type: ignore + from ._models import StaticSitesWorkflowPreview # type: ignore + from ._models import StaticSitesWorkflowPreviewRequest # type: ignore + from ._models import StatusCodesBasedTrigger # type: ignore + from ._models import StorageMigrationOptions # type: ignore + from ._models import StorageMigrationResponse # type: ignore + from ._models import StringDictionary # type: ignore + from ._models import SwiftVirtualNetwork # type: ignore + from ._models import SystemData # type: ignore + from ._models import TldLegalAgreement # type: ignore + from ._models import TldLegalAgreementCollection # type: ignore + from ._models import TokenStore # type: ignore + from ._models import TopLevelDomain # type: ignore + from ._models import TopLevelDomainAgreementOption # type: ignore + from ._models import TopLevelDomainCollection # type: ignore + from ._models import TriggeredJobHistory # type: ignore + from ._models import TriggeredJobHistoryCollection # type: ignore + from ._models import TriggeredJobRun # type: ignore + from ._models import TriggeredWebJob # type: ignore + from ._models import TriggeredWebJobCollection # type: ignore + from ._models import Twitter # type: ignore + from ._models import TwitterRegistration # type: ignore + from ._models import Usage # type: ignore + from ._models import UsageCollection # type: ignore + from ._models import User # type: ignore + from ._models import ValidateRequest # type: ignore + from ._models import ValidateResponse # type: ignore + from ._models import ValidateResponseError # type: ignore + from ._models import VirtualApplication # type: ignore + from ._models import VirtualDirectory # type: ignore + from ._models import VirtualIPMapping # type: ignore + from ._models import VirtualNetworkProfile # type: ignore + from ._models import VnetGateway # type: ignore + from ._models import VnetInfo # type: ignore + from ._models import VnetParameters # type: ignore + from ._models import VnetRoute # type: ignore + from ._models import VnetValidationFailureDetails # type: ignore + from ._models import VnetValidationTestFailure # type: ignore + from ._models import WebAppCollection # type: ignore + from ._models import WebAppInstanceStatusCollection # type: ignore + from ._models import WebJob # type: ignore + from ._models import WebJobCollection # type: ignore + from ._models import WebSiteInstanceStatus # type: ignore + from ._models import WorkerPool # type: ignore + from ._models import WorkerPoolCollection # type: ignore + from ._models import WorkerPoolResource # type: ignore + +from ._web_site_management_client_enums import ( + AccessControlEntryAction, + AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem, + AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem, + AppServicePlanRestrictions, + AutoHealActionType, + AzureResourceType, + AzureStorageState, + AzureStorageType, + BackupItemStatus, + BackupRestoreOperationType, + BuildStatus, + BuiltInAuthenticationProvider, + CertificateOrderActionType, + CertificateOrderStatus, + CertificateProductType, + Channels, + CheckNameResourceTypes, + ClientCertMode, + CloneAbilityResult, + ComputeModeOptions, + ConnectionStringType, + ContinuousWebJobStatus, + CookieExpirationConvention, + CreatedByType, + CustomHostNameDnsRecordType, + DatabaseType, + DnsType, + DnsVerificationTestResult, + DomainPatchResourcePropertiesDomainNotRenewableReasonsItem, + DomainPropertiesDomainNotRenewableReasonsItem, + DomainStatus, + DomainType, + Enum5, + Enum6, + ForwardProxyConvention, + FrequencyUnit, + FtpsState, + HostNameType, + HostType, + HostingEnvironmentStatus, + InAvailabilityReasonType, + IpFilterTag, + IssueType, + KeyVaultSecretStatus, + LoadBalancingMode, + LogLevel, + MSDeployLogEntryType, + MSDeployProvisioningState, + ManagedPipelineMode, + ManagedServiceIdentityType, + MySqlMigrationType, + NotificationLevel, + OperationStatus, + ProvisioningState, + PublicCertificateLocation, + PublishingProfileFormat, + RedundancyMode, + RenderingType, + ResourceScopeType, + RouteType, + ScmType, + SiteAvailabilityState, + SiteExtensionType, + SiteLoadBalancing, + SiteRuntimeState, + SkuName, + SolutionType, + SslState, + StatusOptions, + SupportedTlsVersions, + TriggerTypes, + TriggeredWebJobStatus, + UnauthenticatedClientAction, + UnauthenticatedClientActionV2, + UsageState, + ValidateResourceTypes, + WebJobType, + WorkerSizeOptions, +) + +__all__ = [ + 'AbnormalTimePeriod', + 'Address', + 'AddressResponse', + 'AllowedAudiencesValidation', + 'AnalysisData', + 'AnalysisDefinition', + 'ApiDefinitionInfo', + 'ApiManagementConfig', + 'AppRegistration', + 'AppServiceCertificate', + 'AppServiceCertificateCollection', + 'AppServiceCertificateOrder', + 'AppServiceCertificateOrderCollection', + 'AppServiceCertificateOrderPatchResource', + 'AppServiceCertificatePatchResource', + 'AppServiceCertificateResource', + 'AppServiceEnvironment', + 'AppServiceEnvironmentCollection', + 'AppServiceEnvironmentPatchResource', + 'AppServiceEnvironmentResource', + 'AppServicePlan', + 'AppServicePlanCollection', + 'AppServicePlanPatchResource', + 'ApplicationLogsConfig', + 'ApplicationStack', + 'ApplicationStackCollection', + 'ApplicationStackResource', + 'AppserviceGithubToken', + 'AppserviceGithubTokenRequest', + 'ArmIdWrapper', + 'AuthPlatform', + 'AutoHealActions', + 'AutoHealCustomAction', + 'AutoHealRules', + 'AutoHealTriggers', + 'AzureActiveDirectory', + 'AzureActiveDirectoryLogin', + 'AzureActiveDirectoryRegistration', + 'AzureActiveDirectoryValidation', + 'AzureBlobStorageApplicationLogsConfig', + 'AzureBlobStorageHttpLogsConfig', + 'AzureStorageInfoValue', + 'AzureStoragePropertyDictionaryResource', + 'AzureTableStorageApplicationLogsConfig', + 'BackupItem', + 'BackupItemCollection', + 'BackupRequest', + 'BackupSchedule', + 'BillingMeter', + 'BillingMeterCollection', + 'BlobStorageTokenStore', + 'Capability', + 'Certificate', + 'CertificateCollection', + 'CertificateDetails', + 'CertificateEmail', + 'CertificateOrderAction', + 'CertificatePatchResource', + 'ClientRegistration', + 'CloningInfo', + 'Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties', + 'ConnStringInfo', + 'ConnStringValueTypePair', + 'ConnectionStringDictionary', + 'Contact', + 'ContainerCpuStatistics', + 'ContainerCpuUsage', + 'ContainerInfo', + 'ContainerMemoryStatistics', + 'ContainerNetworkInterfaceStatistics', + 'ContainerThrottlingData', + 'ContinuousWebJob', + 'ContinuousWebJobCollection', + 'CookieExpiration', + 'CorsSettings', + 'CsmCopySlotEntity', + 'CsmMoveResourceEnvelope', + 'CsmOperationCollection', + 'CsmOperationDescription', + 'CsmOperationDescriptionProperties', + 'CsmOperationDisplay', + 'CsmPublishingCredentialsPoliciesCollection', + 'CsmPublishingCredentialsPoliciesEntity', + 'CsmPublishingProfileOptions', + 'CsmSlotEntity', + 'CsmUsageQuota', + 'CsmUsageQuotaCollection', + 'CustomHostnameAnalysisResult', + 'CustomOpenIdConnectProvider', + 'DataSource', + 'DataTableResponseColumn', + 'DataTableResponseObject', + 'DatabaseBackupSetting', + 'DefaultErrorResponse', + 'DefaultErrorResponseError', + 'DefaultErrorResponseErrorDetailsItem', + 'DeletedAppRestoreRequest', + 'DeletedSite', + 'DeletedWebAppCollection', + 'Deployment', + 'DeploymentCollection', + 'DeploymentLocations', + 'DetectorAbnormalTimePeriod', + 'DetectorDefinition', + 'DetectorInfo', + 'DetectorResponse', + 'DetectorResponseCollection', + 'DiagnosticAnalysis', + 'DiagnosticAnalysisCollection', + 'DiagnosticCategory', + 'DiagnosticCategoryCollection', + 'DiagnosticData', + 'DiagnosticDetectorCollection', + 'DiagnosticDetectorResponse', + 'DiagnosticMetricSample', + 'DiagnosticMetricSet', + 'Dimension', + 'Domain', + 'DomainAvailabilityCheckResult', + 'DomainCollection', + 'DomainControlCenterSsoRequest', + 'DomainOwnershipIdentifier', + 'DomainOwnershipIdentifierCollection', + 'DomainPatchResource', + 'DomainPurchaseConsent', + 'DomainRecommendationSearchParameters', + 'EnabledConfig', + 'EndpointDependency', + 'EndpointDetail', + 'ErrorEntity', + 'Experiments', + 'Facebook', + 'FileSystemApplicationLogsConfig', + 'FileSystemHttpLogsConfig', + 'FileSystemTokenStore', + 'ForwardProxy', + 'FunctionEnvelope', + 'FunctionEnvelopeCollection', + 'FunctionSecrets', + 'GeoRegion', + 'GeoRegionCollection', + 'GitHub', + 'GlobalCsmSkuDescription', + 'GlobalValidation', + 'Google', + 'HandlerMapping', + 'HostKeys', + 'HostName', + 'HostNameBinding', + 'HostNameBindingCollection', + 'HostNameSslState', + 'HostingEnvironmentDeploymentInfo', + 'HostingEnvironmentDiagnostics', + 'HostingEnvironmentProfile', + 'HttpLogsConfig', + 'HttpSettings', + 'HttpSettingsRoutes', + 'HybridConnection', + 'HybridConnectionCollection', + 'HybridConnectionKey', + 'HybridConnectionLimits', + 'Identifier', + 'IdentifierCollection', + 'IdentityProviders', + 'InboundEnvironmentEndpoint', + 'InboundEnvironmentEndpointCollection', + 'IpSecurityRestriction', + 'JwtClaimChecks', + 'KeyInfo', + 'LocalizableString', + 'LogSpecification', + 'Login', + 'LoginRoutes', + 'LoginScopes', + 'MSDeploy', + 'MSDeployLog', + 'MSDeployLogEntry', + 'MSDeployStatus', + 'ManagedServiceIdentity', + 'MetricAvailability', + 'MetricSpecification', + 'MigrateMySqlRequest', + 'MigrateMySqlStatus', + 'NameIdentifier', + 'NameIdentifierCollection', + 'NameValuePair', + 'NetworkAccessControlEntry', + 'NetworkFeatures', + 'NetworkTrace', + 'Nonce', + 'OpenIdConnectClientCredential', + 'OpenIdConnectConfig', + 'OpenIdConnectLogin', + 'OpenIdConnectRegistration', + 'Operation', + 'OutboundEnvironmentEndpoint', + 'OutboundEnvironmentEndpointCollection', + 'PerfMonCounterCollection', + 'PerfMonResponse', + 'PerfMonSample', + 'PerfMonSet', + 'PremierAddOn', + 'PremierAddOnOffer', + 'PremierAddOnOfferCollection', + 'PremierAddOnPatchResource', + 'PrivateAccess', + 'PrivateAccessSubnet', + 'PrivateAccessVirtualNetwork', + 'PrivateEndpointConnectionResource', + 'PrivateLinkConnectionApprovalRequestResource', + 'PrivateLinkConnectionState', + 'PrivateLinkResource', + 'PrivateLinkResourceProperties', + 'PrivateLinkResourcesWrapper', + 'ProcessInfo', + 'ProcessInfoCollection', + 'ProcessModuleInfo', + 'ProcessModuleInfoCollection', + 'ProcessThreadInfo', + 'ProcessThreadInfoCollection', + 'ProxyOnlyResource', + 'PublicCertificate', + 'PublicCertificateCollection', + 'PushSettings', + 'RampUpRule', + 'Recommendation', + 'RecommendationCollection', + 'RecommendationRule', + 'ReissueCertificateOrderRequest', + 'RelayServiceConnectionEntity', + 'Rendering', + 'RenewCertificateOrderRequest', + 'RequestsBasedTrigger', + 'Resource', + 'ResourceCollection', + 'ResourceHealthMetadata', + 'ResourceHealthMetadataCollection', + 'ResourceMetricAvailability', + 'ResourceMetricDefinition', + 'ResourceMetricDefinitionCollection', + 'ResourceNameAvailability', + 'ResourceNameAvailabilityRequest', + 'ResponseMetaData', + 'RestoreRequest', + 'ServiceSpecification', + 'Site', + 'SiteAuthSettings', + 'SiteAuthSettingsV2', + 'SiteCloneability', + 'SiteCloneabilityCriterion', + 'SiteConfig', + 'SiteConfigResource', + 'SiteConfigResourceCollection', + 'SiteConfigurationSnapshotInfo', + 'SiteConfigurationSnapshotInfoCollection', + 'SiteExtensionInfo', + 'SiteExtensionInfoCollection', + 'SiteLimits', + 'SiteLogsConfig', + 'SiteMachineKey', + 'SitePatchResource', + 'SitePhpErrorLogFlag', + 'SiteSeal', + 'SiteSealRequest', + 'SiteSourceControl', + 'SkuCapacity', + 'SkuDescription', + 'SkuInfo', + 'SkuInfoCollection', + 'SkuInfos', + 'SlotConfigNamesResource', + 'SlotDifference', + 'SlotDifferenceCollection', + 'SlotSwapStatus', + 'SlowRequestsBasedTrigger', + 'Snapshot', + 'SnapshotCollection', + 'SnapshotRecoverySource', + 'SnapshotRestoreRequest', + 'Solution', + 'SourceControl', + 'SourceControlCollection', + 'StackMajorVersion', + 'StackMinorVersion', + 'StampCapacity', + 'StampCapacityCollection', + 'StaticSiteARMResource', + 'StaticSiteBuildARMResource', + 'StaticSiteBuildCollection', + 'StaticSiteBuildProperties', + 'StaticSiteCollection', + 'StaticSiteCustomDomainOverviewARMResource', + 'StaticSiteCustomDomainOverviewCollection', + 'StaticSiteFunctionOverviewARMResource', + 'StaticSiteFunctionOverviewCollection', + 'StaticSitePatchResource', + 'StaticSiteResetPropertiesARMResource', + 'StaticSiteUserARMResource', + 'StaticSiteUserCollection', + 'StaticSiteUserInvitationRequestResource', + 'StaticSiteUserInvitationResponseResource', + 'StaticSitesWorkflowPreview', + 'StaticSitesWorkflowPreviewRequest', + 'StatusCodesBasedTrigger', + 'StorageMigrationOptions', + 'StorageMigrationResponse', + 'StringDictionary', + 'SwiftVirtualNetwork', + 'SystemData', + 'TldLegalAgreement', + 'TldLegalAgreementCollection', + 'TokenStore', + 'TopLevelDomain', + 'TopLevelDomainAgreementOption', + 'TopLevelDomainCollection', + 'TriggeredJobHistory', + 'TriggeredJobHistoryCollection', + 'TriggeredJobRun', + 'TriggeredWebJob', + 'TriggeredWebJobCollection', + 'Twitter', + 'TwitterRegistration', + 'Usage', + 'UsageCollection', + 'User', + 'ValidateRequest', + 'ValidateResponse', + 'ValidateResponseError', + 'VirtualApplication', + 'VirtualDirectory', + 'VirtualIPMapping', + 'VirtualNetworkProfile', + 'VnetGateway', + 'VnetInfo', + 'VnetParameters', + 'VnetRoute', + 'VnetValidationFailureDetails', + 'VnetValidationTestFailure', + 'WebAppCollection', + 'WebAppInstanceStatusCollection', + 'WebJob', + 'WebJobCollection', + 'WebSiteInstanceStatus', + 'WorkerPool', + 'WorkerPoolCollection', + 'WorkerPoolResource', + 'AccessControlEntryAction', + 'AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem', + 'AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem', + 'AppServicePlanRestrictions', + 'AutoHealActionType', + 'AzureResourceType', + 'AzureStorageState', + 'AzureStorageType', + 'BackupItemStatus', + 'BackupRestoreOperationType', + 'BuildStatus', + 'BuiltInAuthenticationProvider', + 'CertificateOrderActionType', + 'CertificateOrderStatus', + 'CertificateProductType', + 'Channels', + 'CheckNameResourceTypes', + 'ClientCertMode', + 'CloneAbilityResult', + 'ComputeModeOptions', + 'ConnectionStringType', + 'ContinuousWebJobStatus', + 'CookieExpirationConvention', + 'CreatedByType', + 'CustomHostNameDnsRecordType', + 'DatabaseType', + 'DnsType', + 'DnsVerificationTestResult', + 'DomainPatchResourcePropertiesDomainNotRenewableReasonsItem', + 'DomainPropertiesDomainNotRenewableReasonsItem', + 'DomainStatus', + 'DomainType', + 'Enum5', + 'Enum6', + 'ForwardProxyConvention', + 'FrequencyUnit', + 'FtpsState', + 'HostNameType', + 'HostType', + 'HostingEnvironmentStatus', + 'InAvailabilityReasonType', + 'IpFilterTag', + 'IssueType', + 'KeyVaultSecretStatus', + 'LoadBalancingMode', + 'LogLevel', + 'MSDeployLogEntryType', + 'MSDeployProvisioningState', + 'ManagedPipelineMode', + 'ManagedServiceIdentityType', + 'MySqlMigrationType', + 'NotificationLevel', + 'OperationStatus', + 'ProvisioningState', + 'PublicCertificateLocation', + 'PublishingProfileFormat', + 'RedundancyMode', + 'RenderingType', + 'ResourceScopeType', + 'RouteType', + 'ScmType', + 'SiteAvailabilityState', + 'SiteExtensionType', + 'SiteLoadBalancing', + 'SiteRuntimeState', + 'SkuName', + 'SolutionType', + 'SslState', + 'StatusOptions', + 'SupportedTlsVersions', + 'TriggerTypes', + 'TriggeredWebJobStatus', + 'UnauthenticatedClientAction', + 'UnauthenticatedClientActionV2', + 'UsageState', + 'ValidateResourceTypes', + 'WebJobType', + 'WorkerSizeOptions', +] diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/models/_models.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/models/_models.py new file mode 100644 index 000000000000..a9139c30ec2f --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/models/_models.py @@ -0,0 +1,17635 @@ +# 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.core.exceptions import HttpResponseError +import msrest.serialization + + +class AbnormalTimePeriod(msrest.serialization.Model): + """Class representing Abnormal Time Period identified in diagnosis. + + :param start_time: Start time of the downtime. + :type start_time: ~datetime.datetime + :param end_time: End time of the downtime. + :type end_time: ~datetime.datetime + :param events: List of Possible Cause of downtime. + :type events: list[~azure.mgmt.web.v2020_09_01.models.DetectorAbnormalTimePeriod] + :param solutions: List of proposed solutions. + :type solutions: list[~azure.mgmt.web.v2020_09_01.models.Solution] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'events': {'key': 'events', 'type': '[DetectorAbnormalTimePeriod]'}, + 'solutions': {'key': 'solutions', 'type': '[Solution]'}, + } + + def __init__( + self, + **kwargs + ): + super(AbnormalTimePeriod, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.events = kwargs.get('events', None) + self.solutions = kwargs.get('solutions', None) + + +class Address(msrest.serialization.Model): + """Address information for domain registration. + + All required parameters must be populated in order to send to Azure. + + :param address1: Required. First line of an Address. + :type address1: str + :param address2: The second line of the Address. Optional. + :type address2: str + :param city: Required. The city for the address. + :type city: str + :param country: Required. The country for the address. + :type country: str + :param postal_code: Required. The postal code for the address. + :type postal_code: str + :param state: Required. The state or province for the address. + :type state: str + """ + + _validation = { + 'address1': {'required': True}, + 'city': {'required': True}, + 'country': {'required': True}, + 'postal_code': {'required': True}, + 'state': {'required': True}, + } + + _attribute_map = { + 'address1': {'key': 'address1', 'type': 'str'}, + 'address2': {'key': 'address2', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Address, self).__init__(**kwargs) + self.address1 = kwargs['address1'] + self.address2 = kwargs.get('address2', None) + self.city = kwargs['city'] + self.country = kwargs['country'] + self.postal_code = kwargs['postal_code'] + self.state = kwargs['state'] + + +class ProxyOnlyResource(msrest.serialization.Model): + """Azure proxy only resource. This resource is not tracked by Azure Resource Manager. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyOnlyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.kind = kwargs.get('kind', None) + self.type = None + self.system_data = None + + +class AddressResponse(ProxyOnlyResource): + """Describes main public IP address and any extra virtual IPs. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param service_ip_address: Main public virtual IP. + :type service_ip_address: str + :param internal_ip_address: Virtual Network internal IP address of the App Service Environment + if it is in internal load-balancing mode. + :type internal_ip_address: str + :param outbound_ip_addresses: IP addresses appearing on outbound connections. + :type outbound_ip_addresses: list[str] + :param vip_mappings: Additional virtual IPs. + :type vip_mappings: list[~azure.mgmt.web.v2020_09_01.models.VirtualIPMapping] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'service_ip_address': {'key': 'properties.serviceIpAddress', 'type': 'str'}, + 'internal_ip_address': {'key': 'properties.internalIpAddress', 'type': 'str'}, + 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': '[str]'}, + 'vip_mappings': {'key': 'properties.vipMappings', 'type': '[VirtualIPMapping]'}, + } + + def __init__( + self, + **kwargs + ): + super(AddressResponse, self).__init__(**kwargs) + self.service_ip_address = kwargs.get('service_ip_address', None) + self.internal_ip_address = kwargs.get('internal_ip_address', None) + self.outbound_ip_addresses = kwargs.get('outbound_ip_addresses', None) + self.vip_mappings = kwargs.get('vip_mappings', None) + + +class AllowedAudiencesValidation(ProxyOnlyResource): + """AllowedAudiencesValidation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param allowed_audiences: + :type allowed_audiences: list[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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AllowedAudiencesValidation, self).__init__(**kwargs) + self.allowed_audiences = kwargs.get('allowed_audiences', None) + + +class AnalysisData(msrest.serialization.Model): + """Class Representing Detector Evidence used for analysis. + + :param source: Name of the Detector. + :type source: str + :param detector_definition: Detector Definition. + :type detector_definition: ~azure.mgmt.web.v2020_09_01.models.DetectorDefinition + :param metrics: Source Metrics. + :type metrics: list[~azure.mgmt.web.v2020_09_01.models.DiagnosticMetricSet] + :param data: Additional Source Data. + :type data: list[list[~azure.mgmt.web.v2020_09_01.models.NameValuePair]] + :param detector_meta_data: Detector Meta Data. + :type detector_meta_data: ~azure.mgmt.web.v2020_09_01.models.ResponseMetaData + """ + + _attribute_map = { + 'source': {'key': 'source', 'type': 'str'}, + 'detector_definition': {'key': 'detectorDefinition', 'type': 'DetectorDefinition'}, + 'metrics': {'key': 'metrics', 'type': '[DiagnosticMetricSet]'}, + 'data': {'key': 'data', 'type': '[[NameValuePair]]'}, + 'detector_meta_data': {'key': 'detectorMetaData', 'type': 'ResponseMetaData'}, + } + + def __init__( + self, + **kwargs + ): + super(AnalysisData, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.detector_definition = kwargs.get('detector_definition', None) + self.metrics = kwargs.get('metrics', None) + self.data = kwargs.get('data', None) + self.detector_meta_data = kwargs.get('detector_meta_data', None) + + +class AnalysisDefinition(ProxyOnlyResource): + """Definition of Analysis. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar description: Description of the Analysis. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AnalysisDefinition, self).__init__(**kwargs) + self.description = None + + +class ApiDefinitionInfo(msrest.serialization.Model): + """Information about the formal API definition for the app. + + :param url: The URL of the API definition. + :type url: str + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiDefinitionInfo, self).__init__(**kwargs) + self.url = kwargs.get('url', None) + + +class ApiManagementConfig(msrest.serialization.Model): + """Azure API management (APIM) configuration linked to the app. + + :param id: APIM-Api Identifier. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiManagementConfig, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class ApplicationLogsConfig(msrest.serialization.Model): + """Application logs configuration. + + :param file_system: Application logs to file system configuration. + :type file_system: ~azure.mgmt.web.v2020_09_01.models.FileSystemApplicationLogsConfig + :param azure_table_storage: Application logs to azure table storage configuration. + :type azure_table_storage: + ~azure.mgmt.web.v2020_09_01.models.AzureTableStorageApplicationLogsConfig + :param azure_blob_storage: Application logs to blob storage configuration. + :type azure_blob_storage: + ~azure.mgmt.web.v2020_09_01.models.AzureBlobStorageApplicationLogsConfig + """ + + _attribute_map = { + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemApplicationLogsConfig'}, + 'azure_table_storage': {'key': 'azureTableStorage', 'type': 'AzureTableStorageApplicationLogsConfig'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'AzureBlobStorageApplicationLogsConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationLogsConfig, self).__init__(**kwargs) + self.file_system = kwargs.get('file_system', None) + self.azure_table_storage = kwargs.get('azure_table_storage', None) + self.azure_blob_storage = kwargs.get('azure_blob_storage', None) + + +class ApplicationStack(msrest.serialization.Model): + """Application stack. + + :param name: Application stack name. + :type name: str + :param display: Application stack display name. + :type display: str + :param dependency: Application stack dependency. + :type dependency: str + :param major_versions: List of major versions available. + :type major_versions: list[~azure.mgmt.web.v2020_09_01.models.StackMajorVersion] + :param frameworks: List of frameworks associated with application stack. + :type frameworks: list[~azure.mgmt.web.v2020_09_01.models.ApplicationStack] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'str'}, + 'dependency': {'key': 'dependency', 'type': 'str'}, + 'major_versions': {'key': 'majorVersions', 'type': '[StackMajorVersion]'}, + 'frameworks': {'key': 'frameworks', 'type': '[ApplicationStack]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationStack, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.dependency = kwargs.get('dependency', None) + self.major_versions = kwargs.get('major_versions', None) + self.frameworks = kwargs.get('frameworks', None) + + +class ApplicationStackCollection(msrest.serialization.Model): + """Collection of Application Stacks. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.ApplicationStackResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationStackResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationStackCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class ApplicationStackResource(ProxyOnlyResource): + """ARM resource for a ApplicationStack. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param name_properties_name: Application stack name. + :type name_properties_name: str + :param display: Application stack display name. + :type display: str + :param dependency: Application stack dependency. + :type dependency: str + :param major_versions: List of major versions available. + :type major_versions: list[~azure.mgmt.web.v2020_09_01.models.StackMajorVersion] + :param frameworks: List of frameworks associated with application stack. + :type frameworks: list[~azure.mgmt.web.v2020_09_01.models.ApplicationStack] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'display': {'key': 'properties.display', 'type': 'str'}, + 'dependency': {'key': 'properties.dependency', 'type': 'str'}, + 'major_versions': {'key': 'properties.majorVersions', 'type': '[StackMajorVersion]'}, + 'frameworks': {'key': 'properties.frameworks', 'type': '[ApplicationStack]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationStackResource, self).__init__(**kwargs) + self.name_properties_name = kwargs.get('name_properties_name', None) + self.display = kwargs.get('display', None) + self.dependency = kwargs.get('dependency', None) + self.major_versions = kwargs.get('major_versions', None) + self.frameworks = kwargs.get('frameworks', None) + + +class AppRegistration(ProxyOnlyResource): + """AppRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param app_id: + :type app_id: str + :param app_secret_setting_name: + :type app_secret_setting_name: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'app_id': {'key': 'properties.appId', 'type': 'str'}, + 'app_secret_setting_name': {'key': 'properties.appSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppRegistration, self).__init__(**kwargs) + self.app_id = kwargs.get('app_id', None) + self.app_secret_setting_name = kwargs.get('app_secret_setting_name', None) + + +class AppServiceCertificate(msrest.serialization.Model): + """Key Vault container for a certificate that is purchased through Azure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param key_vault_id: Key Vault resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar provisioning_state: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.KeyVaultSecretStatus + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'key_vault_id': {'key': 'keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'keyVaultSecretName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceCertificate, self).__init__(**kwargs) + self.key_vault_id = kwargs.get('key_vault_id', None) + self.key_vault_secret_name = kwargs.get('key_vault_secret_name', None) + self.provisioning_state = None + + +class AppServiceCertificateCollection(msrest.serialization.Model): + """Collection of certificate order certificates. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServiceCertificateResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceCertificateCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class Resource(msrest.serialization.Model): + """Azure resource. This resource is tracked in Azure Resource Manager. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.kind = kwargs.get('kind', None) + self.location = kwargs['location'] + self.type = None + self.tags = kwargs.get('tags', None) + self.system_data = None + + +class AppServiceCertificateOrder(Resource): + """SSL certificate purchase order. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param certificates: State of the Key Vault secret. + :type certificates: dict[str, ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificate] + :param distinguished_name: Certificate distinguished name. + :type distinguished_name: str + :ivar domain_verification_token: Domain verification token. + :vartype domain_verification_token: str + :param validity_in_years: Duration in years (must be between 1 and 3). + :type validity_in_years: int + :param key_size: Certificate key size. + :type key_size: int + :param product_type: Certificate product type. Possible values include: + "StandardDomainValidatedSsl", "StandardDomainValidatedWildCardSsl". + :type product_type: str or ~azure.mgmt.web.v2020_09_01.models.CertificateProductType + :param auto_renew: :code:`true` if the certificate should be automatically renewed + when it expires; otherwise, :code:`false`. + :type auto_renew: bool + :ivar provisioning_state: Status of certificate order. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.ProvisioningState + :ivar status: Current order status. Possible values include: "Pendingissuance", "Issued", + "Revoked", "Canceled", "Denied", "Pendingrevocation", "PendingRekey", "Unused", "Expired", + "NotSubmitted". + :vartype status: str or ~azure.mgmt.web.v2020_09_01.models.CertificateOrderStatus + :ivar signed_certificate: Signed certificate. + :vartype signed_certificate: ~azure.mgmt.web.v2020_09_01.models.CertificateDetails + :param csr: Last CSR that was created for this order. + :type csr: str + :ivar intermediate: Intermediate certificate. + :vartype intermediate: ~azure.mgmt.web.v2020_09_01.models.CertificateDetails + :ivar root: Root certificate. + :vartype root: ~azure.mgmt.web.v2020_09_01.models.CertificateDetails + :ivar serial_number: Current serial number of the certificate. + :vartype serial_number: str + :ivar last_certificate_issuance_time: Certificate last issuance time. + :vartype last_certificate_issuance_time: ~datetime.datetime + :ivar expiration_time: Certificate expiration time. + :vartype expiration_time: ~datetime.datetime + :ivar is_private_key_external: :code:`true` if private key is external; otherwise, + :code:`false`. + :vartype is_private_key_external: bool + :ivar app_service_certificate_not_renewable_reasons: Reasons why App Service Certificate is not + renewable at the current moment. + :vartype app_service_certificate_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem] + :ivar next_auto_renewal_time_stamp: Time stamp when the certificate would be auto renewed next. + :vartype next_auto_renewal_time_stamp: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'domain_verification_token': {'readonly': True}, + 'validity_in_years': {'maximum': 3, 'minimum': 1}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'signed_certificate': {'readonly': True}, + 'intermediate': {'readonly': True}, + 'root': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'last_certificate_issuance_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'is_private_key_external': {'readonly': True}, + 'app_service_certificate_not_renewable_reasons': {'readonly': True}, + 'next_auto_renewal_time_stamp': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'certificates': {'key': 'properties.certificates', 'type': '{AppServiceCertificate}'}, + 'distinguished_name': {'key': 'properties.distinguishedName', 'type': 'str'}, + 'domain_verification_token': {'key': 'properties.domainVerificationToken', 'type': 'str'}, + 'validity_in_years': {'key': 'properties.validityInYears', 'type': 'int'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'signed_certificate': {'key': 'properties.signedCertificate', 'type': 'CertificateDetails'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'intermediate': {'key': 'properties.intermediate', 'type': 'CertificateDetails'}, + 'root': {'key': 'properties.root', 'type': 'CertificateDetails'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'last_certificate_issuance_time': {'key': 'properties.lastCertificateIssuanceTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + 'app_service_certificate_not_renewable_reasons': {'key': 'properties.appServiceCertificateNotRenewableReasons', 'type': '[str]'}, + 'next_auto_renewal_time_stamp': {'key': 'properties.nextAutoRenewalTimeStamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceCertificateOrder, self).__init__(**kwargs) + self.certificates = kwargs.get('certificates', None) + self.distinguished_name = kwargs.get('distinguished_name', None) + self.domain_verification_token = None + self.validity_in_years = kwargs.get('validity_in_years', 1) + self.key_size = kwargs.get('key_size', 2048) + self.product_type = kwargs.get('product_type', None) + self.auto_renew = kwargs.get('auto_renew', True) + self.provisioning_state = None + self.status = None + self.signed_certificate = None + self.csr = kwargs.get('csr', None) + self.intermediate = None + self.root = None + self.serial_number = None + self.last_certificate_issuance_time = None + self.expiration_time = None + self.is_private_key_external = None + self.app_service_certificate_not_renewable_reasons = None + self.next_auto_renewal_time_stamp = None + + +class AppServiceCertificateOrderCollection(msrest.serialization.Model): + """Collection of certificate orders. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrder] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServiceCertificateOrder]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceCertificateOrderCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class AppServiceCertificateOrderPatchResource(ProxyOnlyResource): + """ARM resource for a certificate order that is purchased through Azure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param certificates: State of the Key Vault secret. + :type certificates: dict[str, ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificate] + :param distinguished_name: Certificate distinguished name. + :type distinguished_name: str + :ivar domain_verification_token: Domain verification token. + :vartype domain_verification_token: str + :param validity_in_years: Duration in years (must be between 1 and 3). + :type validity_in_years: int + :param key_size: Certificate key size. + :type key_size: int + :param product_type: Certificate product type. Possible values include: + "StandardDomainValidatedSsl", "StandardDomainValidatedWildCardSsl". + :type product_type: str or ~azure.mgmt.web.v2020_09_01.models.CertificateProductType + :param auto_renew: :code:`true` if the certificate should be automatically renewed + when it expires; otherwise, :code:`false`. + :type auto_renew: bool + :ivar provisioning_state: Status of certificate order. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.ProvisioningState + :ivar status: Current order status. Possible values include: "Pendingissuance", "Issued", + "Revoked", "Canceled", "Denied", "Pendingrevocation", "PendingRekey", "Unused", "Expired", + "NotSubmitted". + :vartype status: str or ~azure.mgmt.web.v2020_09_01.models.CertificateOrderStatus + :ivar signed_certificate: Signed certificate. + :vartype signed_certificate: ~azure.mgmt.web.v2020_09_01.models.CertificateDetails + :param csr: Last CSR that was created for this order. + :type csr: str + :ivar intermediate: Intermediate certificate. + :vartype intermediate: ~azure.mgmt.web.v2020_09_01.models.CertificateDetails + :ivar root: Root certificate. + :vartype root: ~azure.mgmt.web.v2020_09_01.models.CertificateDetails + :ivar serial_number: Current serial number of the certificate. + :vartype serial_number: str + :ivar last_certificate_issuance_time: Certificate last issuance time. + :vartype last_certificate_issuance_time: ~datetime.datetime + :ivar expiration_time: Certificate expiration time. + :vartype expiration_time: ~datetime.datetime + :ivar is_private_key_external: :code:`true` if private key is external; otherwise, + :code:`false`. + :vartype is_private_key_external: bool + :ivar app_service_certificate_not_renewable_reasons: Reasons why App Service Certificate is not + renewable at the current moment. + :vartype app_service_certificate_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem] + :ivar next_auto_renewal_time_stamp: Time stamp when the certificate would be auto renewed next. + :vartype next_auto_renewal_time_stamp: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'domain_verification_token': {'readonly': True}, + 'validity_in_years': {'maximum': 3, 'minimum': 1}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'signed_certificate': {'readonly': True}, + 'intermediate': {'readonly': True}, + 'root': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'last_certificate_issuance_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'is_private_key_external': {'readonly': True}, + 'app_service_certificate_not_renewable_reasons': {'readonly': True}, + 'next_auto_renewal_time_stamp': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'certificates': {'key': 'properties.certificates', 'type': '{AppServiceCertificate}'}, + 'distinguished_name': {'key': 'properties.distinguishedName', 'type': 'str'}, + 'domain_verification_token': {'key': 'properties.domainVerificationToken', 'type': 'str'}, + 'validity_in_years': {'key': 'properties.validityInYears', 'type': 'int'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'signed_certificate': {'key': 'properties.signedCertificate', 'type': 'CertificateDetails'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'intermediate': {'key': 'properties.intermediate', 'type': 'CertificateDetails'}, + 'root': {'key': 'properties.root', 'type': 'CertificateDetails'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'last_certificate_issuance_time': {'key': 'properties.lastCertificateIssuanceTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + 'app_service_certificate_not_renewable_reasons': {'key': 'properties.appServiceCertificateNotRenewableReasons', 'type': '[str]'}, + 'next_auto_renewal_time_stamp': {'key': 'properties.nextAutoRenewalTimeStamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceCertificateOrderPatchResource, self).__init__(**kwargs) + self.certificates = kwargs.get('certificates', None) + self.distinguished_name = kwargs.get('distinguished_name', None) + self.domain_verification_token = None + self.validity_in_years = kwargs.get('validity_in_years', 1) + self.key_size = kwargs.get('key_size', 2048) + self.product_type = kwargs.get('product_type', None) + self.auto_renew = kwargs.get('auto_renew', True) + self.provisioning_state = None + self.status = None + self.signed_certificate = None + self.csr = kwargs.get('csr', None) + self.intermediate = None + self.root = None + self.serial_number = None + self.last_certificate_issuance_time = None + self.expiration_time = None + self.is_private_key_external = None + self.app_service_certificate_not_renewable_reasons = None + self.next_auto_renewal_time_stamp = None + + +class AppServiceCertificatePatchResource(ProxyOnlyResource): + """Key Vault container ARM resource for a certificate that is purchased through Azure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param key_vault_id: Key Vault resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar provisioning_state: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.KeyVaultSecretStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceCertificatePatchResource, self).__init__(**kwargs) + self.key_vault_id = kwargs.get('key_vault_id', None) + self.key_vault_secret_name = kwargs.get('key_vault_secret_name', None) + self.provisioning_state = None + + +class AppServiceCertificateResource(Resource): + """Key Vault container ARM resource for a certificate that is purchased through Azure. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param key_vault_id: Key Vault resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar provisioning_state: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.KeyVaultSecretStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceCertificateResource, self).__init__(**kwargs) + self.key_vault_id = kwargs.get('key_vault_id', None) + self.key_vault_secret_name = kwargs.get('key_vault_secret_name', None) + self.provisioning_state = None + + +class AppServiceEnvironment(msrest.serialization.Model): + """Description of an App Service Environment. + + 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. + + :param name: Required. Name of the App Service Environment. + :type name: str + :param location: Required. Location of the App Service Environment, e.g. "West US". + :type location: str + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.ProvisioningState + :ivar status: Current status of the App Service Environment. Possible values include: + "Preparing", "Ready", "Scaling", "Deleting". + :vartype status: str or ~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentStatus + :param vnet_name: Name of the Virtual Network for the App Service Environment. + :type vnet_name: str + :param vnet_resource_group_name: Resource group of the Virtual Network. + :type vnet_resource_group_name: str + :param vnet_subnet_name: Subnet of the Virtual Network. + :type vnet_subnet_name: str + :param virtual_network: Required. Description of the Virtual Network. + :type virtual_network: ~azure.mgmt.web.v2020_09_01.models.VirtualNetworkProfile + :param internal_load_balancing_mode: Specifies which endpoints to serve internally in the + Virtual Network for the App Service Environment. Possible values include: "None", "Web", + "Publishing", "Web,Publishing". + :type internal_load_balancing_mode: str or ~azure.mgmt.web.v2020_09_01.models.LoadBalancingMode + :param multi_size: Front-end VM size, e.g. "Medium", "Large". + :type multi_size: str + :param multi_role_count: Number of front-end instances. + :type multi_role_count: int + :param worker_pools: Required. Description of worker pools with worker size IDs, VM sizes, and + number of workers in each pool. + :type worker_pools: list[~azure.mgmt.web.v2020_09_01.models.WorkerPool] + :param ipssl_address_count: Number of IP SSL addresses reserved for the App Service + Environment. + :type ipssl_address_count: int + :ivar database_edition: Edition of the metadata database for the App Service Environment, e.g. + "Standard". + :vartype database_edition: str + :ivar database_service_objective: Service objective of the metadata database for the App + Service Environment, e.g. "S0". + :vartype database_service_objective: str + :ivar upgrade_domains: Number of upgrade domains of the App Service Environment. + :vartype upgrade_domains: int + :ivar subscription_id: Subscription of the App Service Environment. + :vartype subscription_id: str + :param dns_suffix: DNS suffix of the App Service Environment. + :type dns_suffix: str + :ivar last_action: Last deployment action on the App Service Environment. + :vartype last_action: str + :ivar last_action_result: Result of the last deployment action on the App Service Environment. + :vartype last_action_result: str + :ivar allowed_multi_sizes: List of comma separated strings describing which VM sizes are + allowed for front-ends. + :vartype allowed_multi_sizes: str + :ivar allowed_worker_sizes: List of comma separated strings describing which VM sizes are + allowed for workers. + :vartype allowed_worker_sizes: str + :ivar maximum_number_of_machines: Maximum number of VMs in the App Service Environment. + :vartype maximum_number_of_machines: int + :ivar vip_mappings: Description of IP SSL mapping for the App Service Environment. + :vartype vip_mappings: list[~azure.mgmt.web.v2020_09_01.models.VirtualIPMapping] + :ivar environment_capacities: Current total, used, and available worker capacities. + :vartype environment_capacities: list[~azure.mgmt.web.v2020_09_01.models.StampCapacity] + :param network_access_control_list: Access control list for controlling traffic to the App + Service Environment. + :type network_access_control_list: + list[~azure.mgmt.web.v2020_09_01.models.NetworkAccessControlEntry] + :ivar environment_is_healthy: True/false indicating whether the App Service Environment is + healthy. + :vartype environment_is_healthy: bool + :ivar environment_status: Detailed message about with results of the last check of the App + Service Environment. + :vartype environment_status: str + :ivar resource_group: Resource group of the App Service Environment. + :vartype resource_group: str + :param front_end_scale_factor: Scale factor for front-ends. + :type front_end_scale_factor: int + :ivar default_front_end_scale_factor: Default Scale Factor for FrontEnds. + :vartype default_front_end_scale_factor: int + :param api_management_account_id: API Management Account associated with the App Service + Environment. + :type api_management_account_id: str + :param suspended: :code:`true` if the App Service Environment is suspended; + otherwise, :code:`false`. The environment can be suspended, e.g. when the + management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :type suspended: bool + :param dynamic_cache_enabled: True/false indicating whether the App Service Environment is + suspended. The environment can be suspended e.g. when the management endpoint is no longer + available + (most likely because NSG blocked the incoming traffic). + :type dynamic_cache_enabled: bool + :param cluster_settings: Custom settings for changing the behavior of the App Service + Environment. + :type cluster_settings: list[~azure.mgmt.web.v2020_09_01.models.NameValuePair] + :param user_whitelisted_ip_ranges: User added ip ranges to whitelist on ASE db. + :type user_whitelisted_ip_ranges: list[str] + :param has_linux_workers: Flag that displays whether an ASE has linux workers or not. + :type has_linux_workers: bool + :param ssl_cert_key_vault_id: Key Vault ID for ILB App Service Environment default SSL + certificate. + :type ssl_cert_key_vault_id: str + :param ssl_cert_key_vault_secret_name: Key Vault Secret Name for ILB App Service Environment + default SSL certificate. + :type ssl_cert_key_vault_secret_name: str + """ + + _validation = { + 'name': {'required': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'virtual_network': {'required': True}, + 'worker_pools': {'required': True}, + 'database_edition': {'readonly': True}, + 'database_service_objective': {'readonly': True}, + 'upgrade_domains': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'last_action': {'readonly': True}, + 'last_action_result': {'readonly': True}, + 'allowed_multi_sizes': {'readonly': True}, + 'allowed_worker_sizes': {'readonly': True}, + 'maximum_number_of_machines': {'readonly': True}, + 'vip_mappings': {'readonly': True}, + 'environment_capacities': {'readonly': True}, + 'environment_is_healthy': {'readonly': True}, + 'environment_status': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'default_front_end_scale_factor': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'vnet_name': {'key': 'vnetName', 'type': 'str'}, + 'vnet_resource_group_name': {'key': 'vnetResourceGroupName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'vnetSubnetName', 'type': 'str'}, + 'virtual_network': {'key': 'virtualNetwork', 'type': 'VirtualNetworkProfile'}, + 'internal_load_balancing_mode': {'key': 'internalLoadBalancingMode', 'type': 'str'}, + 'multi_size': {'key': 'multiSize', 'type': 'str'}, + 'multi_role_count': {'key': 'multiRoleCount', 'type': 'int'}, + 'worker_pools': {'key': 'workerPools', 'type': '[WorkerPool]'}, + 'ipssl_address_count': {'key': 'ipsslAddressCount', 'type': 'int'}, + 'database_edition': {'key': 'databaseEdition', 'type': 'str'}, + 'database_service_objective': {'key': 'databaseServiceObjective', 'type': 'str'}, + 'upgrade_domains': {'key': 'upgradeDomains', 'type': 'int'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'dns_suffix': {'key': 'dnsSuffix', 'type': 'str'}, + 'last_action': {'key': 'lastAction', 'type': 'str'}, + 'last_action_result': {'key': 'lastActionResult', 'type': 'str'}, + 'allowed_multi_sizes': {'key': 'allowedMultiSizes', 'type': 'str'}, + 'allowed_worker_sizes': {'key': 'allowedWorkerSizes', 'type': 'str'}, + 'maximum_number_of_machines': {'key': 'maximumNumberOfMachines', 'type': 'int'}, + 'vip_mappings': {'key': 'vipMappings', 'type': '[VirtualIPMapping]'}, + 'environment_capacities': {'key': 'environmentCapacities', 'type': '[StampCapacity]'}, + 'network_access_control_list': {'key': 'networkAccessControlList', 'type': '[NetworkAccessControlEntry]'}, + 'environment_is_healthy': {'key': 'environmentIsHealthy', 'type': 'bool'}, + 'environment_status': {'key': 'environmentStatus', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'front_end_scale_factor': {'key': 'frontEndScaleFactor', 'type': 'int'}, + 'default_front_end_scale_factor': {'key': 'defaultFrontEndScaleFactor', 'type': 'int'}, + 'api_management_account_id': {'key': 'apiManagementAccountId', 'type': 'str'}, + 'suspended': {'key': 'suspended', 'type': 'bool'}, + 'dynamic_cache_enabled': {'key': 'dynamicCacheEnabled', 'type': 'bool'}, + 'cluster_settings': {'key': 'clusterSettings', 'type': '[NameValuePair]'}, + 'user_whitelisted_ip_ranges': {'key': 'userWhitelistedIpRanges', 'type': '[str]'}, + 'has_linux_workers': {'key': 'hasLinuxWorkers', 'type': 'bool'}, + 'ssl_cert_key_vault_id': {'key': 'sslCertKeyVaultId', 'type': 'str'}, + 'ssl_cert_key_vault_secret_name': {'key': 'sslCertKeyVaultSecretName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceEnvironment, self).__init__(**kwargs) + self.name = kwargs['name'] + self.location = kwargs['location'] + self.provisioning_state = None + self.status = None + self.vnet_name = kwargs.get('vnet_name', None) + self.vnet_resource_group_name = kwargs.get('vnet_resource_group_name', None) + self.vnet_subnet_name = kwargs.get('vnet_subnet_name', None) + self.virtual_network = kwargs['virtual_network'] + self.internal_load_balancing_mode = kwargs.get('internal_load_balancing_mode', None) + self.multi_size = kwargs.get('multi_size', None) + self.multi_role_count = kwargs.get('multi_role_count', None) + self.worker_pools = kwargs['worker_pools'] + self.ipssl_address_count = kwargs.get('ipssl_address_count', None) + self.database_edition = None + self.database_service_objective = None + self.upgrade_domains = None + self.subscription_id = None + self.dns_suffix = kwargs.get('dns_suffix', None) + self.last_action = None + self.last_action_result = None + self.allowed_multi_sizes = None + self.allowed_worker_sizes = None + self.maximum_number_of_machines = None + self.vip_mappings = None + self.environment_capacities = None + self.network_access_control_list = kwargs.get('network_access_control_list', None) + self.environment_is_healthy = None + self.environment_status = None + self.resource_group = None + self.front_end_scale_factor = kwargs.get('front_end_scale_factor', None) + self.default_front_end_scale_factor = None + self.api_management_account_id = kwargs.get('api_management_account_id', None) + self.suspended = kwargs.get('suspended', None) + self.dynamic_cache_enabled = kwargs.get('dynamic_cache_enabled', None) + self.cluster_settings = kwargs.get('cluster_settings', None) + self.user_whitelisted_ip_ranges = kwargs.get('user_whitelisted_ip_ranges', None) + self.has_linux_workers = kwargs.get('has_linux_workers', None) + self.ssl_cert_key_vault_id = kwargs.get('ssl_cert_key_vault_id', None) + self.ssl_cert_key_vault_secret_name = kwargs.get('ssl_cert_key_vault_secret_name', None) + + +class AppServiceEnvironmentCollection(msrest.serialization.Model): + """Collection of App Service Environments. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.AppServiceEnvironmentResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServiceEnvironmentResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceEnvironmentCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class AppServiceEnvironmentPatchResource(ProxyOnlyResource): + """ARM resource for a app service environment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param name_properties_name: Name of the App Service Environment. + :type name_properties_name: str + :param location: Location of the App Service Environment, e.g. "West US". + :type location: str + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.ProvisioningState + :ivar status: Current status of the App Service Environment. Possible values include: + "Preparing", "Ready", "Scaling", "Deleting". + :vartype status: str or ~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentStatus + :param vnet_name: Name of the Virtual Network for the App Service Environment. + :type vnet_name: str + :param vnet_resource_group_name: Resource group of the Virtual Network. + :type vnet_resource_group_name: str + :param vnet_subnet_name: Subnet of the Virtual Network. + :type vnet_subnet_name: str + :param virtual_network: Description of the Virtual Network. + :type virtual_network: ~azure.mgmt.web.v2020_09_01.models.VirtualNetworkProfile + :param internal_load_balancing_mode: Specifies which endpoints to serve internally in the + Virtual Network for the App Service Environment. Possible values include: "None", "Web", + "Publishing", "Web,Publishing". + :type internal_load_balancing_mode: str or ~azure.mgmt.web.v2020_09_01.models.LoadBalancingMode + :param multi_size: Front-end VM size, e.g. "Medium", "Large". + :type multi_size: str + :param multi_role_count: Number of front-end instances. + :type multi_role_count: int + :param worker_pools: Description of worker pools with worker size IDs, VM sizes, and number of + workers in each pool. + :type worker_pools: list[~azure.mgmt.web.v2020_09_01.models.WorkerPool] + :param ipssl_address_count: Number of IP SSL addresses reserved for the App Service + Environment. + :type ipssl_address_count: int + :ivar database_edition: Edition of the metadata database for the App Service Environment, e.g. + "Standard". + :vartype database_edition: str + :ivar database_service_objective: Service objective of the metadata database for the App + Service Environment, e.g. "S0". + :vartype database_service_objective: str + :ivar upgrade_domains: Number of upgrade domains of the App Service Environment. + :vartype upgrade_domains: int + :ivar subscription_id: Subscription of the App Service Environment. + :vartype subscription_id: str + :param dns_suffix: DNS suffix of the App Service Environment. + :type dns_suffix: str + :ivar last_action: Last deployment action on the App Service Environment. + :vartype last_action: str + :ivar last_action_result: Result of the last deployment action on the App Service Environment. + :vartype last_action_result: str + :ivar allowed_multi_sizes: List of comma separated strings describing which VM sizes are + allowed for front-ends. + :vartype allowed_multi_sizes: str + :ivar allowed_worker_sizes: List of comma separated strings describing which VM sizes are + allowed for workers. + :vartype allowed_worker_sizes: str + :ivar maximum_number_of_machines: Maximum number of VMs in the App Service Environment. + :vartype maximum_number_of_machines: int + :ivar vip_mappings: Description of IP SSL mapping for the App Service Environment. + :vartype vip_mappings: list[~azure.mgmt.web.v2020_09_01.models.VirtualIPMapping] + :ivar environment_capacities: Current total, used, and available worker capacities. + :vartype environment_capacities: list[~azure.mgmt.web.v2020_09_01.models.StampCapacity] + :param network_access_control_list: Access control list for controlling traffic to the App + Service Environment. + :type network_access_control_list: + list[~azure.mgmt.web.v2020_09_01.models.NetworkAccessControlEntry] + :ivar environment_is_healthy: True/false indicating whether the App Service Environment is + healthy. + :vartype environment_is_healthy: bool + :ivar environment_status: Detailed message about with results of the last check of the App + Service Environment. + :vartype environment_status: str + :ivar resource_group: Resource group of the App Service Environment. + :vartype resource_group: str + :param front_end_scale_factor: Scale factor for front-ends. + :type front_end_scale_factor: int + :ivar default_front_end_scale_factor: Default Scale Factor for FrontEnds. + :vartype default_front_end_scale_factor: int + :param api_management_account_id: API Management Account associated with the App Service + Environment. + :type api_management_account_id: str + :param suspended: :code:`true` if the App Service Environment is suspended; + otherwise, :code:`false`. The environment can be suspended, e.g. when the + management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :type suspended: bool + :param dynamic_cache_enabled: True/false indicating whether the App Service Environment is + suspended. The environment can be suspended e.g. when the management endpoint is no longer + available + (most likely because NSG blocked the incoming traffic). + :type dynamic_cache_enabled: bool + :param cluster_settings: Custom settings for changing the behavior of the App Service + Environment. + :type cluster_settings: list[~azure.mgmt.web.v2020_09_01.models.NameValuePair] + :param user_whitelisted_ip_ranges: User added ip ranges to whitelist on ASE db. + :type user_whitelisted_ip_ranges: list[str] + :param has_linux_workers: Flag that displays whether an ASE has linux workers or not. + :type has_linux_workers: bool + :param ssl_cert_key_vault_id: Key Vault ID for ILB App Service Environment default SSL + certificate. + :type ssl_cert_key_vault_id: str + :param ssl_cert_key_vault_secret_name: Key Vault Secret Name for ILB App Service Environment + default SSL certificate. + :type ssl_cert_key_vault_secret_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'database_edition': {'readonly': True}, + 'database_service_objective': {'readonly': True}, + 'upgrade_domains': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'last_action': {'readonly': True}, + 'last_action_result': {'readonly': True}, + 'allowed_multi_sizes': {'readonly': True}, + 'allowed_worker_sizes': {'readonly': True}, + 'maximum_number_of_machines': {'readonly': True}, + 'vip_mappings': {'readonly': True}, + 'environment_capacities': {'readonly': True}, + 'environment_is_healthy': {'readonly': True}, + 'environment_status': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'default_front_end_scale_factor': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_resource_group_name': {'key': 'properties.vnetResourceGroupName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'properties.vnetSubnetName', 'type': 'str'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'VirtualNetworkProfile'}, + 'internal_load_balancing_mode': {'key': 'properties.internalLoadBalancingMode', 'type': 'str'}, + 'multi_size': {'key': 'properties.multiSize', 'type': 'str'}, + 'multi_role_count': {'key': 'properties.multiRoleCount', 'type': 'int'}, + 'worker_pools': {'key': 'properties.workerPools', 'type': '[WorkerPool]'}, + 'ipssl_address_count': {'key': 'properties.ipsslAddressCount', 'type': 'int'}, + 'database_edition': {'key': 'properties.databaseEdition', 'type': 'str'}, + 'database_service_objective': {'key': 'properties.databaseServiceObjective', 'type': 'str'}, + 'upgrade_domains': {'key': 'properties.upgradeDomains', 'type': 'int'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'dns_suffix': {'key': 'properties.dnsSuffix', 'type': 'str'}, + 'last_action': {'key': 'properties.lastAction', 'type': 'str'}, + 'last_action_result': {'key': 'properties.lastActionResult', 'type': 'str'}, + 'allowed_multi_sizes': {'key': 'properties.allowedMultiSizes', 'type': 'str'}, + 'allowed_worker_sizes': {'key': 'properties.allowedWorkerSizes', 'type': 'str'}, + 'maximum_number_of_machines': {'key': 'properties.maximumNumberOfMachines', 'type': 'int'}, + 'vip_mappings': {'key': 'properties.vipMappings', 'type': '[VirtualIPMapping]'}, + 'environment_capacities': {'key': 'properties.environmentCapacities', 'type': '[StampCapacity]'}, + 'network_access_control_list': {'key': 'properties.networkAccessControlList', 'type': '[NetworkAccessControlEntry]'}, + 'environment_is_healthy': {'key': 'properties.environmentIsHealthy', 'type': 'bool'}, + 'environment_status': {'key': 'properties.environmentStatus', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'front_end_scale_factor': {'key': 'properties.frontEndScaleFactor', 'type': 'int'}, + 'default_front_end_scale_factor': {'key': 'properties.defaultFrontEndScaleFactor', 'type': 'int'}, + 'api_management_account_id': {'key': 'properties.apiManagementAccountId', 'type': 'str'}, + 'suspended': {'key': 'properties.suspended', 'type': 'bool'}, + 'dynamic_cache_enabled': {'key': 'properties.dynamicCacheEnabled', 'type': 'bool'}, + 'cluster_settings': {'key': 'properties.clusterSettings', 'type': '[NameValuePair]'}, + 'user_whitelisted_ip_ranges': {'key': 'properties.userWhitelistedIpRanges', 'type': '[str]'}, + 'has_linux_workers': {'key': 'properties.hasLinuxWorkers', 'type': 'bool'}, + 'ssl_cert_key_vault_id': {'key': 'properties.sslCertKeyVaultId', 'type': 'str'}, + 'ssl_cert_key_vault_secret_name': {'key': 'properties.sslCertKeyVaultSecretName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceEnvironmentPatchResource, self).__init__(**kwargs) + self.name_properties_name = kwargs.get('name_properties_name', None) + self.location = kwargs.get('location', None) + self.provisioning_state = None + self.status = None + self.vnet_name = kwargs.get('vnet_name', None) + self.vnet_resource_group_name = kwargs.get('vnet_resource_group_name', None) + self.vnet_subnet_name = kwargs.get('vnet_subnet_name', None) + self.virtual_network = kwargs.get('virtual_network', None) + self.internal_load_balancing_mode = kwargs.get('internal_load_balancing_mode', None) + self.multi_size = kwargs.get('multi_size', None) + self.multi_role_count = kwargs.get('multi_role_count', None) + self.worker_pools = kwargs.get('worker_pools', None) + self.ipssl_address_count = kwargs.get('ipssl_address_count', None) + self.database_edition = None + self.database_service_objective = None + self.upgrade_domains = None + self.subscription_id = None + self.dns_suffix = kwargs.get('dns_suffix', None) + self.last_action = None + self.last_action_result = None + self.allowed_multi_sizes = None + self.allowed_worker_sizes = None + self.maximum_number_of_machines = None + self.vip_mappings = None + self.environment_capacities = None + self.network_access_control_list = kwargs.get('network_access_control_list', None) + self.environment_is_healthy = None + self.environment_status = None + self.resource_group = None + self.front_end_scale_factor = kwargs.get('front_end_scale_factor', None) + self.default_front_end_scale_factor = None + self.api_management_account_id = kwargs.get('api_management_account_id', None) + self.suspended = kwargs.get('suspended', None) + self.dynamic_cache_enabled = kwargs.get('dynamic_cache_enabled', None) + self.cluster_settings = kwargs.get('cluster_settings', None) + self.user_whitelisted_ip_ranges = kwargs.get('user_whitelisted_ip_ranges', None) + self.has_linux_workers = kwargs.get('has_linux_workers', None) + self.ssl_cert_key_vault_id = kwargs.get('ssl_cert_key_vault_id', None) + self.ssl_cert_key_vault_secret_name = kwargs.get('ssl_cert_key_vault_secret_name', None) + + +class AppServiceEnvironmentResource(Resource): + """App Service Environment ARM 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param name_properties_name: Name of the App Service Environment. + :type name_properties_name: str + :param location_properties_location: Location of the App Service Environment, e.g. "West US". + :type location_properties_location: str + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.ProvisioningState + :ivar status: Current status of the App Service Environment. Possible values include: + "Preparing", "Ready", "Scaling", "Deleting". + :vartype status: str or ~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentStatus + :param vnet_name: Name of the Virtual Network for the App Service Environment. + :type vnet_name: str + :param vnet_resource_group_name: Resource group of the Virtual Network. + :type vnet_resource_group_name: str + :param vnet_subnet_name: Subnet of the Virtual Network. + :type vnet_subnet_name: str + :param virtual_network: Description of the Virtual Network. + :type virtual_network: ~azure.mgmt.web.v2020_09_01.models.VirtualNetworkProfile + :param internal_load_balancing_mode: Specifies which endpoints to serve internally in the + Virtual Network for the App Service Environment. Possible values include: "None", "Web", + "Publishing", "Web,Publishing". + :type internal_load_balancing_mode: str or ~azure.mgmt.web.v2020_09_01.models.LoadBalancingMode + :param multi_size: Front-end VM size, e.g. "Medium", "Large". + :type multi_size: str + :param multi_role_count: Number of front-end instances. + :type multi_role_count: int + :param worker_pools: Description of worker pools with worker size IDs, VM sizes, and number of + workers in each pool. + :type worker_pools: list[~azure.mgmt.web.v2020_09_01.models.WorkerPool] + :param ipssl_address_count: Number of IP SSL addresses reserved for the App Service + Environment. + :type ipssl_address_count: int + :ivar database_edition: Edition of the metadata database for the App Service Environment, e.g. + "Standard". + :vartype database_edition: str + :ivar database_service_objective: Service objective of the metadata database for the App + Service Environment, e.g. "S0". + :vartype database_service_objective: str + :ivar upgrade_domains: Number of upgrade domains of the App Service Environment. + :vartype upgrade_domains: int + :ivar subscription_id: Subscription of the App Service Environment. + :vartype subscription_id: str + :param dns_suffix: DNS suffix of the App Service Environment. + :type dns_suffix: str + :ivar last_action: Last deployment action on the App Service Environment. + :vartype last_action: str + :ivar last_action_result: Result of the last deployment action on the App Service Environment. + :vartype last_action_result: str + :ivar allowed_multi_sizes: List of comma separated strings describing which VM sizes are + allowed for front-ends. + :vartype allowed_multi_sizes: str + :ivar allowed_worker_sizes: List of comma separated strings describing which VM sizes are + allowed for workers. + :vartype allowed_worker_sizes: str + :ivar maximum_number_of_machines: Maximum number of VMs in the App Service Environment. + :vartype maximum_number_of_machines: int + :ivar vip_mappings: Description of IP SSL mapping for the App Service Environment. + :vartype vip_mappings: list[~azure.mgmt.web.v2020_09_01.models.VirtualIPMapping] + :ivar environment_capacities: Current total, used, and available worker capacities. + :vartype environment_capacities: list[~azure.mgmt.web.v2020_09_01.models.StampCapacity] + :param network_access_control_list: Access control list for controlling traffic to the App + Service Environment. + :type network_access_control_list: + list[~azure.mgmt.web.v2020_09_01.models.NetworkAccessControlEntry] + :ivar environment_is_healthy: True/false indicating whether the App Service Environment is + healthy. + :vartype environment_is_healthy: bool + :ivar environment_status: Detailed message about with results of the last check of the App + Service Environment. + :vartype environment_status: str + :ivar resource_group: Resource group of the App Service Environment. + :vartype resource_group: str + :param front_end_scale_factor: Scale factor for front-ends. + :type front_end_scale_factor: int + :ivar default_front_end_scale_factor: Default Scale Factor for FrontEnds. + :vartype default_front_end_scale_factor: int + :param api_management_account_id: API Management Account associated with the App Service + Environment. + :type api_management_account_id: str + :param suspended: :code:`true` if the App Service Environment is suspended; + otherwise, :code:`false`. The environment can be suspended, e.g. when the + management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :type suspended: bool + :param dynamic_cache_enabled: True/false indicating whether the App Service Environment is + suspended. The environment can be suspended e.g. when the management endpoint is no longer + available + (most likely because NSG blocked the incoming traffic). + :type dynamic_cache_enabled: bool + :param cluster_settings: Custom settings for changing the behavior of the App Service + Environment. + :type cluster_settings: list[~azure.mgmt.web.v2020_09_01.models.NameValuePair] + :param user_whitelisted_ip_ranges: User added ip ranges to whitelist on ASE db. + :type user_whitelisted_ip_ranges: list[str] + :param has_linux_workers: Flag that displays whether an ASE has linux workers or not. + :type has_linux_workers: bool + :param ssl_cert_key_vault_id: Key Vault ID for ILB App Service Environment default SSL + certificate. + :type ssl_cert_key_vault_id: str + :param ssl_cert_key_vault_secret_name: Key Vault Secret Name for ILB App Service Environment + default SSL certificate. + :type ssl_cert_key_vault_secret_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'database_edition': {'readonly': True}, + 'database_service_objective': {'readonly': True}, + 'upgrade_domains': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'last_action': {'readonly': True}, + 'last_action_result': {'readonly': True}, + 'allowed_multi_sizes': {'readonly': True}, + 'allowed_worker_sizes': {'readonly': True}, + 'maximum_number_of_machines': {'readonly': True}, + 'vip_mappings': {'readonly': True}, + 'environment_capacities': {'readonly': True}, + 'environment_is_healthy': {'readonly': True}, + 'environment_status': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'default_front_end_scale_factor': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'location_properties_location': {'key': 'properties.location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_resource_group_name': {'key': 'properties.vnetResourceGroupName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'properties.vnetSubnetName', 'type': 'str'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'VirtualNetworkProfile'}, + 'internal_load_balancing_mode': {'key': 'properties.internalLoadBalancingMode', 'type': 'str'}, + 'multi_size': {'key': 'properties.multiSize', 'type': 'str'}, + 'multi_role_count': {'key': 'properties.multiRoleCount', 'type': 'int'}, + 'worker_pools': {'key': 'properties.workerPools', 'type': '[WorkerPool]'}, + 'ipssl_address_count': {'key': 'properties.ipsslAddressCount', 'type': 'int'}, + 'database_edition': {'key': 'properties.databaseEdition', 'type': 'str'}, + 'database_service_objective': {'key': 'properties.databaseServiceObjective', 'type': 'str'}, + 'upgrade_domains': {'key': 'properties.upgradeDomains', 'type': 'int'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'dns_suffix': {'key': 'properties.dnsSuffix', 'type': 'str'}, + 'last_action': {'key': 'properties.lastAction', 'type': 'str'}, + 'last_action_result': {'key': 'properties.lastActionResult', 'type': 'str'}, + 'allowed_multi_sizes': {'key': 'properties.allowedMultiSizes', 'type': 'str'}, + 'allowed_worker_sizes': {'key': 'properties.allowedWorkerSizes', 'type': 'str'}, + 'maximum_number_of_machines': {'key': 'properties.maximumNumberOfMachines', 'type': 'int'}, + 'vip_mappings': {'key': 'properties.vipMappings', 'type': '[VirtualIPMapping]'}, + 'environment_capacities': {'key': 'properties.environmentCapacities', 'type': '[StampCapacity]'}, + 'network_access_control_list': {'key': 'properties.networkAccessControlList', 'type': '[NetworkAccessControlEntry]'}, + 'environment_is_healthy': {'key': 'properties.environmentIsHealthy', 'type': 'bool'}, + 'environment_status': {'key': 'properties.environmentStatus', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'front_end_scale_factor': {'key': 'properties.frontEndScaleFactor', 'type': 'int'}, + 'default_front_end_scale_factor': {'key': 'properties.defaultFrontEndScaleFactor', 'type': 'int'}, + 'api_management_account_id': {'key': 'properties.apiManagementAccountId', 'type': 'str'}, + 'suspended': {'key': 'properties.suspended', 'type': 'bool'}, + 'dynamic_cache_enabled': {'key': 'properties.dynamicCacheEnabled', 'type': 'bool'}, + 'cluster_settings': {'key': 'properties.clusterSettings', 'type': '[NameValuePair]'}, + 'user_whitelisted_ip_ranges': {'key': 'properties.userWhitelistedIpRanges', 'type': '[str]'}, + 'has_linux_workers': {'key': 'properties.hasLinuxWorkers', 'type': 'bool'}, + 'ssl_cert_key_vault_id': {'key': 'properties.sslCertKeyVaultId', 'type': 'str'}, + 'ssl_cert_key_vault_secret_name': {'key': 'properties.sslCertKeyVaultSecretName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceEnvironmentResource, self).__init__(**kwargs) + self.name_properties_name = kwargs.get('name_properties_name', None) + self.location_properties_location = kwargs.get('location_properties_location', None) + self.provisioning_state = None + self.status = None + self.vnet_name = kwargs.get('vnet_name', None) + self.vnet_resource_group_name = kwargs.get('vnet_resource_group_name', None) + self.vnet_subnet_name = kwargs.get('vnet_subnet_name', None) + self.virtual_network = kwargs.get('virtual_network', None) + self.internal_load_balancing_mode = kwargs.get('internal_load_balancing_mode', None) + self.multi_size = kwargs.get('multi_size', None) + self.multi_role_count = kwargs.get('multi_role_count', None) + self.worker_pools = kwargs.get('worker_pools', None) + self.ipssl_address_count = kwargs.get('ipssl_address_count', None) + self.database_edition = None + self.database_service_objective = None + self.upgrade_domains = None + self.subscription_id = None + self.dns_suffix = kwargs.get('dns_suffix', None) + self.last_action = None + self.last_action_result = None + self.allowed_multi_sizes = None + self.allowed_worker_sizes = None + self.maximum_number_of_machines = None + self.vip_mappings = None + self.environment_capacities = None + self.network_access_control_list = kwargs.get('network_access_control_list', None) + self.environment_is_healthy = None + self.environment_status = None + self.resource_group = None + self.front_end_scale_factor = kwargs.get('front_end_scale_factor', None) + self.default_front_end_scale_factor = None + self.api_management_account_id = kwargs.get('api_management_account_id', None) + self.suspended = kwargs.get('suspended', None) + self.dynamic_cache_enabled = kwargs.get('dynamic_cache_enabled', None) + self.cluster_settings = kwargs.get('cluster_settings', None) + self.user_whitelisted_ip_ranges = kwargs.get('user_whitelisted_ip_ranges', None) + self.has_linux_workers = kwargs.get('has_linux_workers', None) + self.ssl_cert_key_vault_id = kwargs.get('ssl_cert_key_vault_id', None) + self.ssl_cert_key_vault_secret_name = kwargs.get('ssl_cert_key_vault_secret_name', None) + + +class AppserviceGithubToken(msrest.serialization.Model): + """Github access token for Appservice CLI github integration. + + :param access_token: Github access token for Appservice CLI github integration. + :type access_token: str + :param scope: Scope of the github access token. + :type scope: str + :param token_type: token type. + :type token_type: str + :param got_token: True if valid github token received, False otherwise. + :type got_token: bool + :param error_message: Error message if unable to get token. + :type error_message: str + """ + + _attribute_map = { + 'access_token': {'key': 'accessToken', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'}, + 'token_type': {'key': 'tokenType', 'type': 'str'}, + 'got_token': {'key': 'gotToken', 'type': 'bool'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppserviceGithubToken, self).__init__(**kwargs) + self.access_token = kwargs.get('access_token', None) + self.scope = kwargs.get('scope', None) + self.token_type = kwargs.get('token_type', None) + self.got_token = kwargs.get('got_token', None) + self.error_message = kwargs.get('error_message', None) + + +class AppserviceGithubTokenRequest(msrest.serialization.Model): + """Appservice Github token request content. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Code string to exchange for Github Access token. + :type code: str + :param state: Required. State string used for verification. + :type state: str + """ + + _validation = { + 'code': {'required': True}, + 'state': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppserviceGithubTokenRequest, self).__init__(**kwargs) + self.code = kwargs['code'] + self.state = kwargs['state'] + + +class AppServicePlan(Resource): + """App Service plan. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param sku: Description of a SKU for a scalable resource. + :type sku: ~azure.mgmt.web.v2020_09_01.models.SkuDescription + :param worker_tier_name: Target worker tier assigned to the App Service plan. + :type worker_tier_name: str + :ivar status: App Service plan status. Possible values include: "Ready", "Pending", "Creating". + :vartype status: str or ~azure.mgmt.web.v2020_09_01.models.StatusOptions + :ivar subscription: App Service plan subscription. + :vartype subscription: str + :param hosting_environment_profile: Specification for the App Service Environment to use for + the App Service plan. + :type hosting_environment_profile: ~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentProfile + :ivar maximum_number_of_workers: Maximum number of instances that can be assigned to this App + Service plan. + :vartype maximum_number_of_workers: int + :ivar geo_region: Geographical location for the App Service plan. + :vartype geo_region: str + :param per_site_scaling: If :code:`true`, apps assigned to this App Service plan + can be scaled independently. + If :code:`false`, apps assigned to this App Service plan will scale to all + instances of the plan. + :type per_site_scaling: bool + :param maximum_elastic_worker_count: Maximum number of total workers allowed for this + ElasticScaleEnabled App Service Plan. + :type maximum_elastic_worker_count: int + :ivar number_of_sites: Number of apps assigned to this App Service plan. + :vartype number_of_sites: int + :param is_spot: If :code:`true`, this App Service Plan owns spot instances. + :type is_spot: bool + :param spot_expiration_time: The time when the server farm expires. Valid only if it is a spot + server farm. + :type spot_expiration_time: ~datetime.datetime + :param free_offer_expiration_time: The time when the server farm free offer expires. + :type free_offer_expiration_time: ~datetime.datetime + :ivar resource_group: Resource group of the App Service plan. + :vartype resource_group: str + :param reserved: If Linux app service plan :code:`true`, + :code:`false` otherwise. + :type reserved: bool + :param is_xenon: Obsolete: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type is_xenon: bool + :param hyper_v: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type hyper_v: bool + :param target_worker_count: Scaling worker count. + :type target_worker_count: int + :param target_worker_size_id: Scaling worker size ID. + :type target_worker_size_id: int + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'status': {'readonly': True}, + 'subscription': {'readonly': True}, + 'maximum_number_of_workers': {'readonly': True}, + 'geo_region': {'readonly': True}, + 'number_of_sites': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'worker_tier_name': {'key': 'properties.workerTierName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'maximum_number_of_workers': {'key': 'properties.maximumNumberOfWorkers', 'type': 'int'}, + 'geo_region': {'key': 'properties.geoRegion', 'type': 'str'}, + 'per_site_scaling': {'key': 'properties.perSiteScaling', 'type': 'bool'}, + 'maximum_elastic_worker_count': {'key': 'properties.maximumElasticWorkerCount', 'type': 'int'}, + 'number_of_sites': {'key': 'properties.numberOfSites', 'type': 'int'}, + 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, + 'spot_expiration_time': {'key': 'properties.spotExpirationTime', 'type': 'iso-8601'}, + 'free_offer_expiration_time': {'key': 'properties.freeOfferExpirationTime', 'type': 'iso-8601'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'target_worker_count': {'key': 'properties.targetWorkerCount', 'type': 'int'}, + 'target_worker_size_id': {'key': 'properties.targetWorkerSizeId', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServicePlan, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.worker_tier_name = kwargs.get('worker_tier_name', None) + self.status = None + self.subscription = None + self.hosting_environment_profile = kwargs.get('hosting_environment_profile', None) + self.maximum_number_of_workers = None + self.geo_region = None + self.per_site_scaling = kwargs.get('per_site_scaling', False) + self.maximum_elastic_worker_count = kwargs.get('maximum_elastic_worker_count', None) + self.number_of_sites = None + self.is_spot = kwargs.get('is_spot', None) + self.spot_expiration_time = kwargs.get('spot_expiration_time', None) + self.free_offer_expiration_time = kwargs.get('free_offer_expiration_time', None) + self.resource_group = None + self.reserved = kwargs.get('reserved', False) + self.is_xenon = kwargs.get('is_xenon', False) + self.hyper_v = kwargs.get('hyper_v', False) + self.target_worker_count = kwargs.get('target_worker_count', None) + self.target_worker_size_id = kwargs.get('target_worker_size_id', None) + self.provisioning_state = None + + +class AppServicePlanCollection(msrest.serialization.Model): + """Collection of App Service plans. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.AppServicePlan] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServicePlan]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServicePlanCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class AppServicePlanPatchResource(ProxyOnlyResource): + """ARM resource for a app service plan. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param worker_tier_name: Target worker tier assigned to the App Service plan. + :type worker_tier_name: str + :ivar status: App Service plan status. Possible values include: "Ready", "Pending", "Creating". + :vartype status: str or ~azure.mgmt.web.v2020_09_01.models.StatusOptions + :ivar subscription: App Service plan subscription. + :vartype subscription: str + :param hosting_environment_profile: Specification for the App Service Environment to use for + the App Service plan. + :type hosting_environment_profile: ~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentProfile + :ivar maximum_number_of_workers: Maximum number of instances that can be assigned to this App + Service plan. + :vartype maximum_number_of_workers: int + :ivar geo_region: Geographical location for the App Service plan. + :vartype geo_region: str + :param per_site_scaling: If :code:`true`, apps assigned to this App Service plan + can be scaled independently. + If :code:`false`, apps assigned to this App Service plan will scale to all + instances of the plan. + :type per_site_scaling: bool + :param maximum_elastic_worker_count: Maximum number of total workers allowed for this + ElasticScaleEnabled App Service Plan. + :type maximum_elastic_worker_count: int + :ivar number_of_sites: Number of apps assigned to this App Service plan. + :vartype number_of_sites: int + :param is_spot: If :code:`true`, this App Service Plan owns spot instances. + :type is_spot: bool + :param spot_expiration_time: The time when the server farm expires. Valid only if it is a spot + server farm. + :type spot_expiration_time: ~datetime.datetime + :param free_offer_expiration_time: The time when the server farm free offer expires. + :type free_offer_expiration_time: ~datetime.datetime + :ivar resource_group: Resource group of the App Service plan. + :vartype resource_group: str + :param reserved: This needs to set to :code:`true` when creating a Linux App + Service Plan, along with :code:`kind` set to :code:`Linux`. It should + be :code:`false` otherwise. + :type reserved: bool + :param is_xenon: Obsolete: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type is_xenon: bool + :param hyper_v: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type hyper_v: bool + :param target_worker_count: Scaling worker count. + :type target_worker_count: int + :param target_worker_size_id: Scaling worker size ID. + :type target_worker_size_id: int + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'status': {'readonly': True}, + 'subscription': {'readonly': True}, + 'maximum_number_of_workers': {'readonly': True}, + 'geo_region': {'readonly': True}, + 'number_of_sites': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'worker_tier_name': {'key': 'properties.workerTierName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'maximum_number_of_workers': {'key': 'properties.maximumNumberOfWorkers', 'type': 'int'}, + 'geo_region': {'key': 'properties.geoRegion', 'type': 'str'}, + 'per_site_scaling': {'key': 'properties.perSiteScaling', 'type': 'bool'}, + 'maximum_elastic_worker_count': {'key': 'properties.maximumElasticWorkerCount', 'type': 'int'}, + 'number_of_sites': {'key': 'properties.numberOfSites', 'type': 'int'}, + 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, + 'spot_expiration_time': {'key': 'properties.spotExpirationTime', 'type': 'iso-8601'}, + 'free_offer_expiration_time': {'key': 'properties.freeOfferExpirationTime', 'type': 'iso-8601'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'target_worker_count': {'key': 'properties.targetWorkerCount', 'type': 'int'}, + 'target_worker_size_id': {'key': 'properties.targetWorkerSizeId', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServicePlanPatchResource, self).__init__(**kwargs) + self.worker_tier_name = kwargs.get('worker_tier_name', None) + self.status = None + self.subscription = None + self.hosting_environment_profile = kwargs.get('hosting_environment_profile', None) + self.maximum_number_of_workers = None + self.geo_region = None + self.per_site_scaling = kwargs.get('per_site_scaling', False) + self.maximum_elastic_worker_count = kwargs.get('maximum_elastic_worker_count', None) + self.number_of_sites = None + self.is_spot = kwargs.get('is_spot', None) + self.spot_expiration_time = kwargs.get('spot_expiration_time', None) + self.free_offer_expiration_time = kwargs.get('free_offer_expiration_time', None) + self.resource_group = None + self.reserved = kwargs.get('reserved', False) + self.is_xenon = kwargs.get('is_xenon', False) + self.hyper_v = kwargs.get('hyper_v', False) + self.target_worker_count = kwargs.get('target_worker_count', None) + self.target_worker_size_id = kwargs.get('target_worker_size_id', None) + self.provisioning_state = None + + +class ArmIdWrapper(msrest.serialization.Model): + """A wrapper for an ARM resource id. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ArmIdWrapper, self).__init__(**kwargs) + self.id = None + + +class AuthPlatform(ProxyOnlyResource): + """AuthPlatform. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param enabled: + :type enabled: bool + :param runtime_version: + :type runtime_version: str + :param config_file_path: + :type config_file_path: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'runtime_version': {'key': 'properties.runtimeVersion', 'type': 'str'}, + 'config_file_path': {'key': 'properties.configFilePath', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AuthPlatform, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.runtime_version = kwargs.get('runtime_version', None) + self.config_file_path = kwargs.get('config_file_path', None) + + +class AutoHealActions(msrest.serialization.Model): + """Actions which to take by the auto-heal module when a rule is triggered. + + :param action_type: Predefined action to be taken. Possible values include: "Recycle", + "LogEvent", "CustomAction". + :type action_type: str or ~azure.mgmt.web.v2020_09_01.models.AutoHealActionType + :param custom_action: Custom action to be taken. + :type custom_action: ~azure.mgmt.web.v2020_09_01.models.AutoHealCustomAction + :param min_process_execution_time: Minimum time the process must execute + before taking the action. + :type min_process_execution_time: str + """ + + _attribute_map = { + 'action_type': {'key': 'actionType', 'type': 'str'}, + 'custom_action': {'key': 'customAction', 'type': 'AutoHealCustomAction'}, + 'min_process_execution_time': {'key': 'minProcessExecutionTime', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AutoHealActions, self).__init__(**kwargs) + self.action_type = kwargs.get('action_type', None) + self.custom_action = kwargs.get('custom_action', None) + self.min_process_execution_time = kwargs.get('min_process_execution_time', None) + + +class AutoHealCustomAction(msrest.serialization.Model): + """Custom action to be executed +when an auto heal rule is triggered. + + :param exe: Executable to be run. + :type exe: str + :param parameters: Parameters for the executable. + :type parameters: str + """ + + _attribute_map = { + 'exe': {'key': 'exe', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AutoHealCustomAction, self).__init__(**kwargs) + self.exe = kwargs.get('exe', None) + self.parameters = kwargs.get('parameters', None) + + +class AutoHealRules(msrest.serialization.Model): + """Rules that can be defined for auto-heal. + + :param triggers: Conditions that describe when to execute the auto-heal actions. + :type triggers: ~azure.mgmt.web.v2020_09_01.models.AutoHealTriggers + :param actions: Actions to be executed when a rule is triggered. + :type actions: ~azure.mgmt.web.v2020_09_01.models.AutoHealActions + """ + + _attribute_map = { + 'triggers': {'key': 'triggers', 'type': 'AutoHealTriggers'}, + 'actions': {'key': 'actions', 'type': 'AutoHealActions'}, + } + + def __init__( + self, + **kwargs + ): + super(AutoHealRules, self).__init__(**kwargs) + self.triggers = kwargs.get('triggers', None) + self.actions = kwargs.get('actions', None) + + +class AutoHealTriggers(msrest.serialization.Model): + """Triggers for auto-heal. + + :param requests: A rule based on total requests. + :type requests: ~azure.mgmt.web.v2020_09_01.models.RequestsBasedTrigger + :param private_bytes_in_kb: A rule based on private bytes. + :type private_bytes_in_kb: int + :param status_codes: A rule based on status codes. + :type status_codes: list[~azure.mgmt.web.v2020_09_01.models.StatusCodesBasedTrigger] + :param slow_requests: A rule based on request execution time. + :type slow_requests: ~azure.mgmt.web.v2020_09_01.models.SlowRequestsBasedTrigger + """ + + _attribute_map = { + 'requests': {'key': 'requests', 'type': 'RequestsBasedTrigger'}, + 'private_bytes_in_kb': {'key': 'privateBytesInKB', 'type': 'int'}, + 'status_codes': {'key': 'statusCodes', 'type': '[StatusCodesBasedTrigger]'}, + 'slow_requests': {'key': 'slowRequests', 'type': 'SlowRequestsBasedTrigger'}, + } + + def __init__( + self, + **kwargs + ): + super(AutoHealTriggers, self).__init__(**kwargs) + self.requests = kwargs.get('requests', None) + self.private_bytes_in_kb = kwargs.get('private_bytes_in_kb', None) + self.status_codes = kwargs.get('status_codes', None) + self.slow_requests = kwargs.get('slow_requests', None) + + +class AzureActiveDirectory(ProxyOnlyResource): + """AzureActiveDirectory. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_09_01.models.AzureActiveDirectoryRegistration + :param login: + :type login: ~azure.mgmt.web.v2020_09_01.models.AzureActiveDirectoryLogin + :param validation: + :type validation: ~azure.mgmt.web.v2020_09_01.models.AzureActiveDirectoryValidation + :param is_auto_provisioned: + :type is_auto_provisioned: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'AzureActiveDirectoryRegistration'}, + 'login': {'key': 'properties.login', 'type': 'AzureActiveDirectoryLogin'}, + 'validation': {'key': 'properties.validation', 'type': 'AzureActiveDirectoryValidation'}, + 'is_auto_provisioned': {'key': 'properties.isAutoProvisioned', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureActiveDirectory, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.registration = kwargs.get('registration', None) + self.login = kwargs.get('login', None) + self.validation = kwargs.get('validation', None) + self.is_auto_provisioned = kwargs.get('is_auto_provisioned', None) + + +class AzureActiveDirectoryLogin(ProxyOnlyResource): + """AzureActiveDirectoryLogin. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param disable_www_authenticate: + :type disable_www_authenticate: bool + :param login_parameters: + :type login_parameters: list[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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'disable_www_authenticate': {'key': 'properties.disableWWWAuthenticate', 'type': 'bool'}, + 'login_parameters': {'key': 'properties.loginParameters', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureActiveDirectoryLogin, self).__init__(**kwargs) + self.disable_www_authenticate = kwargs.get('disable_www_authenticate', None) + self.login_parameters = kwargs.get('login_parameters', None) + + +class AzureActiveDirectoryRegistration(ProxyOnlyResource): + """AzureActiveDirectoryRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param open_id_issuer: + :type open_id_issuer: str + :param client_id: + :type client_id: str + :param client_secret_setting_name: + :type client_secret_setting_name: str + :param client_secret_certificate_thumbprint: + :type client_secret_certificate_thumbprint: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'open_id_issuer': {'key': 'properties.openIdIssuer', 'type': 'str'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_secret_certificate_thumbprint': {'key': 'properties.clientSecretCertificateThumbprint', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureActiveDirectoryRegistration, self).__init__(**kwargs) + self.open_id_issuer = kwargs.get('open_id_issuer', None) + self.client_id = kwargs.get('client_id', None) + self.client_secret_setting_name = kwargs.get('client_secret_setting_name', None) + self.client_secret_certificate_thumbprint = kwargs.get('client_secret_certificate_thumbprint', None) + + +class AzureActiveDirectoryValidation(ProxyOnlyResource): + """AzureActiveDirectoryValidation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param jwt_claim_checks: + :type jwt_claim_checks: ~azure.mgmt.web.v2020_09_01.models.JwtClaimChecks + :param allowed_audiences: + :type allowed_audiences: list[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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'jwt_claim_checks': {'key': 'properties.jwtClaimChecks', 'type': 'JwtClaimChecks'}, + 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureActiveDirectoryValidation, self).__init__(**kwargs) + self.jwt_claim_checks = kwargs.get('jwt_claim_checks', None) + self.allowed_audiences = kwargs.get('allowed_audiences', None) + + +class AzureBlobStorageApplicationLogsConfig(msrest.serialization.Model): + """Application logs azure blob storage configuration. + + :param level: Log level. Possible values include: "Off", "Verbose", "Information", "Warning", + "Error". + :type level: str or ~azure.mgmt.web.v2020_09_01.models.LogLevel + :param sas_url: SAS url to a azure blob container with read/write/list/delete permissions. + :type sas_url: str + :param retention_in_days: Retention in days. + Remove blobs older than X days. + 0 or lower means no retention. + :type retention_in_days: int + """ + + _attribute_map = { + 'level': {'key': 'level', 'type': 'str'}, + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureBlobStorageApplicationLogsConfig, self).__init__(**kwargs) + self.level = kwargs.get('level', None) + self.sas_url = kwargs.get('sas_url', None) + self.retention_in_days = kwargs.get('retention_in_days', None) + + +class AzureBlobStorageHttpLogsConfig(msrest.serialization.Model): + """Http logs to azure blob storage configuration. + + :param sas_url: SAS url to a azure blob container with read/write/list/delete permissions. + :type sas_url: str + :param retention_in_days: Retention in days. + Remove blobs older than X days. + 0 or lower means no retention. + :type retention_in_days: int + :param enabled: True if configuration is enabled, false if it is disabled and null if + configuration is not set. + :type enabled: bool + """ + + _attribute_map = { + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureBlobStorageHttpLogsConfig, self).__init__(**kwargs) + self.sas_url = kwargs.get('sas_url', None) + self.retention_in_days = kwargs.get('retention_in_days', None) + self.enabled = kwargs.get('enabled', None) + + +class AzureStorageInfoValue(msrest.serialization.Model): + """Azure Files or Blob Storage access information value for dictionary storage. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Type of storage. Possible values include: "AzureFiles", "AzureBlob". + :type type: str or ~azure.mgmt.web.v2020_09_01.models.AzureStorageType + :param account_name: Name of the storage account. + :type account_name: str + :param share_name: Name of the file share (container name, for Blob storage). + :type share_name: str + :param access_key: Access key for the storage account. + :type access_key: str + :param mount_path: Path to mount the storage within the site's runtime environment. + :type mount_path: str + :ivar state: State of the storage account. Possible values include: "Ok", "InvalidCredentials", + "InvalidShare". + :vartype state: str or ~azure.mgmt.web.v2020_09_01.models.AzureStorageState + """ + + _validation = { + 'state': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'account_name': {'key': 'accountName', 'type': 'str'}, + 'share_name': {'key': 'shareName', 'type': 'str'}, + 'access_key': {'key': 'accessKey', 'type': 'str'}, + 'mount_path': {'key': 'mountPath', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureStorageInfoValue, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.account_name = kwargs.get('account_name', None) + self.share_name = kwargs.get('share_name', None) + self.access_key = kwargs.get('access_key', None) + self.mount_path = kwargs.get('mount_path', None) + self.state = None + + +class AzureStoragePropertyDictionaryResource(ProxyOnlyResource): + """AzureStorageInfo dictionary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param properties: Azure storage accounts. + :type properties: dict[str, ~azure.mgmt.web.v2020_09_01.models.AzureStorageInfoValue] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': '{AzureStorageInfoValue}'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureStoragePropertyDictionaryResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class AzureTableStorageApplicationLogsConfig(msrest.serialization.Model): + """Application logs to Azure table storage configuration. + + All required parameters must be populated in order to send to Azure. + + :param level: Log level. Possible values include: "Off", "Verbose", "Information", "Warning", + "Error". + :type level: str or ~azure.mgmt.web.v2020_09_01.models.LogLevel + :param sas_url: Required. SAS URL to an Azure table with add/query/delete permissions. + :type sas_url: str + """ + + _validation = { + 'sas_url': {'required': True}, + } + + _attribute_map = { + 'level': {'key': 'level', 'type': 'str'}, + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureTableStorageApplicationLogsConfig, self).__init__(**kwargs) + self.level = kwargs.get('level', None) + self.sas_url = kwargs['sas_url'] + + +class BackupItem(ProxyOnlyResource): + """Backup description. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar backup_id: Id of the backup. + :vartype backup_id: int + :ivar storage_account_url: SAS URL for the storage account container which contains this + backup. + :vartype storage_account_url: str + :ivar blob_name: Name of the blob which contains data for this backup. + :vartype blob_name: str + :ivar name_properties_name: Name of this backup. + :vartype name_properties_name: str + :ivar status: Backup status. Possible values include: "InProgress", "Failed", "Succeeded", + "TimedOut", "Created", "Skipped", "PartiallySucceeded", "DeleteInProgress", "DeleteFailed", + "Deleted". + :vartype status: str or ~azure.mgmt.web.v2020_09_01.models.BackupItemStatus + :ivar size_in_bytes: Size of the backup in bytes. + :vartype size_in_bytes: long + :ivar created: Timestamp of the backup creation. + :vartype created: ~datetime.datetime + :ivar log: Details regarding this backup. Might contain an error message. + :vartype log: str + :ivar databases: List of databases included in the backup. + :vartype databases: list[~azure.mgmt.web.v2020_09_01.models.DatabaseBackupSetting] + :ivar scheduled: True if this backup has been created due to a schedule being triggered. + :vartype scheduled: bool + :ivar last_restore_time_stamp: Timestamp of a last restore operation which used this backup. + :vartype last_restore_time_stamp: ~datetime.datetime + :ivar finished_time_stamp: Timestamp when this backup finished. + :vartype finished_time_stamp: ~datetime.datetime + :ivar correlation_id: Unique correlation identifier. Please use this along with the timestamp + while communicating with Azure support. + :vartype correlation_id: str + :ivar website_size_in_bytes: Size of the original web app which has been backed up. + :vartype website_size_in_bytes: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'backup_id': {'readonly': True}, + 'storage_account_url': {'readonly': True}, + 'blob_name': {'readonly': True}, + 'name_properties_name': {'readonly': True}, + 'status': {'readonly': True}, + 'size_in_bytes': {'readonly': True}, + 'created': {'readonly': True}, + 'log': {'readonly': True}, + 'databases': {'readonly': True}, + 'scheduled': {'readonly': True}, + 'last_restore_time_stamp': {'readonly': True}, + 'finished_time_stamp': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'website_size_in_bytes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'backup_id': {'key': 'properties.id', 'type': 'int'}, + 'storage_account_url': {'key': 'properties.storageAccountUrl', 'type': 'str'}, + 'blob_name': {'key': 'properties.blobName', 'type': 'str'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'size_in_bytes': {'key': 'properties.sizeInBytes', 'type': 'long'}, + 'created': {'key': 'properties.created', 'type': 'iso-8601'}, + 'log': {'key': 'properties.log', 'type': 'str'}, + 'databases': {'key': 'properties.databases', 'type': '[DatabaseBackupSetting]'}, + 'scheduled': {'key': 'properties.scheduled', 'type': 'bool'}, + 'last_restore_time_stamp': {'key': 'properties.lastRestoreTimeStamp', 'type': 'iso-8601'}, + 'finished_time_stamp': {'key': 'properties.finishedTimeStamp', 'type': 'iso-8601'}, + 'correlation_id': {'key': 'properties.correlationId', 'type': 'str'}, + 'website_size_in_bytes': {'key': 'properties.websiteSizeInBytes', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupItem, self).__init__(**kwargs) + self.backup_id = None + self.storage_account_url = None + self.blob_name = None + self.name_properties_name = None + self.status = None + self.size_in_bytes = None + self.created = None + self.log = None + self.databases = None + self.scheduled = None + self.last_restore_time_stamp = None + self.finished_time_stamp = None + self.correlation_id = None + self.website_size_in_bytes = None + + +class BackupItemCollection(msrest.serialization.Model): + """Collection of backup items. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.BackupItem] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BackupItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupItemCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class BackupRequest(ProxyOnlyResource): + """Description of a backup which will be performed. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param backup_name: Name of the backup. + :type backup_name: str + :param enabled: True if the backup schedule is enabled (must be included in that case), false + if the backup schedule should be disabled. + :type enabled: bool + :param storage_account_url: SAS URL to the container. + :type storage_account_url: str + :param backup_schedule: Schedule for the backup if it is executed periodically. + :type backup_schedule: ~azure.mgmt.web.v2020_09_01.models.BackupSchedule + :param databases: Databases included in the backup. + :type databases: list[~azure.mgmt.web.v2020_09_01.models.DatabaseBackupSetting] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'backup_name': {'key': 'properties.backupName', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'storage_account_url': {'key': 'properties.storageAccountUrl', 'type': 'str'}, + 'backup_schedule': {'key': 'properties.backupSchedule', 'type': 'BackupSchedule'}, + 'databases': {'key': 'properties.databases', 'type': '[DatabaseBackupSetting]'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupRequest, self).__init__(**kwargs) + self.backup_name = kwargs.get('backup_name', None) + self.enabled = kwargs.get('enabled', None) + self.storage_account_url = kwargs.get('storage_account_url', None) + self.backup_schedule = kwargs.get('backup_schedule', None) + self.databases = kwargs.get('databases', None) + + +class BackupSchedule(msrest.serialization.Model): + """Description of a backup schedule. Describes how often should be the backup performed and what should be the retention policy. + + 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. + + :param frequency_interval: Required. How often the backup should be executed (e.g. for weekly + backup, this should be set to 7 and FrequencyUnit should be set to Day). + :type frequency_interval: int + :param frequency_unit: Required. The unit of time for how often the backup should be executed + (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7). + Possible values include: "Day", "Hour". Default value: "Day". + :type frequency_unit: str or ~azure.mgmt.web.v2020_09_01.models.FrequencyUnit + :param keep_at_least_one_backup: Required. True if the retention policy should always keep at + least one backup in the storage account, regardless how old it is; false otherwise. + :type keep_at_least_one_backup: bool + :param retention_period_in_days: Required. After how many days backups should be deleted. + :type retention_period_in_days: int + :param start_time: When the schedule should start working. + :type start_time: ~datetime.datetime + :ivar last_execution_time: Last time when this schedule was triggered. + :vartype last_execution_time: ~datetime.datetime + """ + + _validation = { + 'frequency_interval': {'required': True}, + 'frequency_unit': {'required': True}, + 'keep_at_least_one_backup': {'required': True}, + 'retention_period_in_days': {'required': True}, + 'last_execution_time': {'readonly': True}, + } + + _attribute_map = { + 'frequency_interval': {'key': 'frequencyInterval', 'type': 'int'}, + 'frequency_unit': {'key': 'frequencyUnit', 'type': 'str'}, + 'keep_at_least_one_backup': {'key': 'keepAtLeastOneBackup', 'type': 'bool'}, + 'retention_period_in_days': {'key': 'retentionPeriodInDays', 'type': 'int'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'last_execution_time': {'key': 'lastExecutionTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupSchedule, self).__init__(**kwargs) + self.frequency_interval = kwargs.get('frequency_interval', 7) + self.frequency_unit = kwargs.get('frequency_unit', "Day") + self.keep_at_least_one_backup = kwargs.get('keep_at_least_one_backup', True) + self.retention_period_in_days = kwargs.get('retention_period_in_days', 30) + self.start_time = kwargs.get('start_time', None) + self.last_execution_time = None + + +class BillingMeter(ProxyOnlyResource): + """App Service billing entity that contains information about meter which the Azure billing system utilizes to charge users for services. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param meter_id: Meter GUID onboarded in Commerce. + :type meter_id: str + :param billing_location: Azure Location of billable resource. + :type billing_location: str + :param short_name: Short Name from App Service Azure pricing Page. + :type short_name: str + :param friendly_name: Friendly name of the meter. + :type friendly_name: str + :param resource_type: App Service ResourceType meter used for. + :type resource_type: str + :param os_type: App Service OS type meter used for. + :type os_type: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, + 'billing_location': {'key': 'properties.billingLocation', 'type': 'str'}, + 'short_name': {'key': 'properties.shortName', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'resource_type': {'key': 'properties.resourceType', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BillingMeter, self).__init__(**kwargs) + self.meter_id = kwargs.get('meter_id', None) + self.billing_location = kwargs.get('billing_location', None) + self.short_name = kwargs.get('short_name', None) + self.friendly_name = kwargs.get('friendly_name', None) + self.resource_type = kwargs.get('resource_type', None) + self.os_type = kwargs.get('os_type', None) + + +class BillingMeterCollection(msrest.serialization.Model): + """Collection of Billing Meters. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.BillingMeter] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingMeter]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BillingMeterCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class BlobStorageTokenStore(ProxyOnlyResource): + """BlobStorageTokenStore. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param sas_url_setting_name: + :type sas_url_setting_name: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'sas_url_setting_name': {'key': 'properties.sasUrlSettingName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobStorageTokenStore, self).__init__(**kwargs) + self.sas_url_setting_name = kwargs.get('sas_url_setting_name', None) + + +class Capability(msrest.serialization.Model): + """Describes the capabilities/features allowed for a specific SKU. + + :param name: Name of the SKU capability. + :type name: str + :param value: Value of the SKU capability. + :type value: str + :param reason: Reason of the SKU capability. + :type reason: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Capability, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + self.reason = kwargs.get('reason', None) + + +class Certificate(Resource): + """SSL certificate for an app. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar friendly_name: Friendly name of the certificate. + :vartype friendly_name: str + :ivar subject_name: Subject name of the certificate. + :vartype subject_name: str + :param host_names: Host names the certificate applies to. + :type host_names: list[str] + :param pfx_blob: Pfx blob. + :type pfx_blob: bytearray + :ivar site_name: App name. + :vartype site_name: str + :ivar self_link: Self link. + :vartype self_link: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar issue_date: Certificate issue Date. + :vartype issue_date: ~datetime.datetime + :ivar expiration_date: Certificate expiration date. + :vartype expiration_date: ~datetime.datetime + :param password: Certificate password. + :type password: str + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid: Is the certificate valid?. + :vartype valid: bool + :ivar cer_blob: Raw bytes of .cer file. + :vartype cer_blob: bytearray + :ivar public_key_hash: Public key hash. + :vartype public_key_hash: str + :ivar hosting_environment_profile: Specification for the App Service Environment to use for the + certificate. + :vartype hosting_environment_profile: + ~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentProfile + :param key_vault_id: Key Vault Csm resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar key_vault_secret_status: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype key_vault_secret_status: str or + ~azure.mgmt.web.v2020_09_01.models.KeyVaultSecretStatus + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param canonical_name: CNAME of the certificate to be issued via free certificate. + :type canonical_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'site_name': {'readonly': True}, + 'self_link': {'readonly': True}, + 'issuer': {'readonly': True}, + 'issue_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'valid': {'readonly': True}, + 'cer_blob': {'readonly': True}, + 'public_key_hash': {'readonly': True}, + 'hosting_environment_profile': {'readonly': True}, + 'key_vault_secret_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'subject_name': {'key': 'properties.subjectName', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'pfx_blob': {'key': 'properties.pfxBlob', 'type': 'bytearray'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'self_link': {'key': 'properties.selfLink', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'issue_date': {'key': 'properties.issueDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'valid': {'key': 'properties.valid', 'type': 'bool'}, + 'cer_blob': {'key': 'properties.cerBlob', 'type': 'bytearray'}, + 'public_key_hash': {'key': 'properties.publicKeyHash', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'key_vault_secret_status': {'key': 'properties.keyVaultSecretStatus', 'type': 'str'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'canonical_name': {'key': 'properties.canonicalName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Certificate, self).__init__(**kwargs) + self.friendly_name = None + self.subject_name = None + self.host_names = kwargs.get('host_names', None) + self.pfx_blob = kwargs.get('pfx_blob', None) + self.site_name = None + self.self_link = None + self.issuer = None + self.issue_date = None + self.expiration_date = None + self.password = kwargs.get('password', None) + self.thumbprint = None + self.valid = None + self.cer_blob = None + self.public_key_hash = None + self.hosting_environment_profile = None + self.key_vault_id = kwargs.get('key_vault_id', None) + self.key_vault_secret_name = kwargs.get('key_vault_secret_name', None) + self.key_vault_secret_status = None + self.server_farm_id = kwargs.get('server_farm_id', None) + self.canonical_name = kwargs.get('canonical_name', None) + + +class CertificateCollection(msrest.serialization.Model): + """Collection of certificates. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.Certificate] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Certificate]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class CertificateDetails(msrest.serialization.Model): + """SSL certificate details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar version: Certificate Version. + :vartype version: int + :ivar serial_number: Certificate Serial Number. + :vartype serial_number: str + :ivar thumbprint: Certificate Thumbprint. + :vartype thumbprint: str + :ivar subject: Certificate Subject. + :vartype subject: str + :ivar not_before: Date Certificate is valid from. + :vartype not_before: ~datetime.datetime + :ivar not_after: Date Certificate is valid to. + :vartype not_after: ~datetime.datetime + :ivar signature_algorithm: Certificate Signature algorithm. + :vartype signature_algorithm: str + :ivar issuer: Certificate Issuer. + :vartype issuer: str + :ivar raw_data: Raw certificate data. + :vartype raw_data: str + """ + + _validation = { + 'version': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'subject': {'readonly': True}, + 'not_before': {'readonly': True}, + 'not_after': {'readonly': True}, + 'signature_algorithm': {'readonly': True}, + 'issuer': {'readonly': True}, + 'raw_data': {'readonly': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'int'}, + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + 'not_before': {'key': 'notBefore', 'type': 'iso-8601'}, + 'not_after': {'key': 'notAfter', 'type': 'iso-8601'}, + 'signature_algorithm': {'key': 'signatureAlgorithm', 'type': 'str'}, + 'issuer': {'key': 'issuer', 'type': 'str'}, + 'raw_data': {'key': 'rawData', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateDetails, self).__init__(**kwargs) + self.version = None + self.serial_number = None + self.thumbprint = None + self.subject = None + self.not_before = None + self.not_after = None + self.signature_algorithm = None + self.issuer = None + self.raw_data = None + + +class CertificateEmail(ProxyOnlyResource): + """SSL certificate email. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param email_id: Email id. + :type email_id: str + :param time_stamp: Time stamp. + :type time_stamp: ~datetime.datetime + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'email_id': {'key': 'properties.emailId', 'type': 'str'}, + 'time_stamp': {'key': 'properties.timeStamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateEmail, self).__init__(**kwargs) + self.email_id = kwargs.get('email_id', None) + self.time_stamp = kwargs.get('time_stamp', None) + + +class CertificateOrderAction(ProxyOnlyResource): + """Certificate order action. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar action_type: Action type. Possible values include: "CertificateIssued", + "CertificateOrderCanceled", "CertificateOrderCreated", "CertificateRevoked", + "DomainValidationComplete", "FraudDetected", "OrgNameChange", "OrgValidationComplete", + "SanDrop", "FraudCleared", "CertificateExpired", "CertificateExpirationWarning", + "FraudDocumentationRequired", "Unknown". + :vartype action_type: str or ~azure.mgmt.web.v2020_09_01.models.CertificateOrderActionType + :ivar created_at: Time at which the certificate action was performed. + :vartype created_at: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'action_type': {'readonly': True}, + 'created_at': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'action_type': {'key': 'properties.actionType', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateOrderAction, self).__init__(**kwargs) + self.action_type = None + self.created_at = None + + +class CertificatePatchResource(ProxyOnlyResource): + """ARM resource for a certificate. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar friendly_name: Friendly name of the certificate. + :vartype friendly_name: str + :ivar subject_name: Subject name of the certificate. + :vartype subject_name: str + :param host_names: Host names the certificate applies to. + :type host_names: list[str] + :param pfx_blob: Pfx blob. + :type pfx_blob: bytearray + :ivar site_name: App name. + :vartype site_name: str + :ivar self_link: Self link. + :vartype self_link: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar issue_date: Certificate issue Date. + :vartype issue_date: ~datetime.datetime + :ivar expiration_date: Certificate expiration date. + :vartype expiration_date: ~datetime.datetime + :param password: Certificate password. + :type password: str + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid: Is the certificate valid?. + :vartype valid: bool + :ivar cer_blob: Raw bytes of .cer file. + :vartype cer_blob: bytearray + :ivar public_key_hash: Public key hash. + :vartype public_key_hash: str + :ivar hosting_environment_profile: Specification for the App Service Environment to use for the + certificate. + :vartype hosting_environment_profile: + ~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentProfile + :param key_vault_id: Key Vault Csm resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar key_vault_secret_status: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype key_vault_secret_status: str or + ~azure.mgmt.web.v2020_09_01.models.KeyVaultSecretStatus + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param canonical_name: CNAME of the certificate to be issued via free certificate. + :type canonical_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'site_name': {'readonly': True}, + 'self_link': {'readonly': True}, + 'issuer': {'readonly': True}, + 'issue_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'valid': {'readonly': True}, + 'cer_blob': {'readonly': True}, + 'public_key_hash': {'readonly': True}, + 'hosting_environment_profile': {'readonly': True}, + 'key_vault_secret_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'subject_name': {'key': 'properties.subjectName', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'pfx_blob': {'key': 'properties.pfxBlob', 'type': 'bytearray'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'self_link': {'key': 'properties.selfLink', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'issue_date': {'key': 'properties.issueDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'valid': {'key': 'properties.valid', 'type': 'bool'}, + 'cer_blob': {'key': 'properties.cerBlob', 'type': 'bytearray'}, + 'public_key_hash': {'key': 'properties.publicKeyHash', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'key_vault_secret_status': {'key': 'properties.keyVaultSecretStatus', 'type': 'str'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'canonical_name': {'key': 'properties.canonicalName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificatePatchResource, self).__init__(**kwargs) + self.friendly_name = None + self.subject_name = None + self.host_names = kwargs.get('host_names', None) + self.pfx_blob = kwargs.get('pfx_blob', None) + self.site_name = None + self.self_link = None + self.issuer = None + self.issue_date = None + self.expiration_date = None + self.password = kwargs.get('password', None) + self.thumbprint = None + self.valid = None + self.cer_blob = None + self.public_key_hash = None + self.hosting_environment_profile = None + self.key_vault_id = kwargs.get('key_vault_id', None) + self.key_vault_secret_name = kwargs.get('key_vault_secret_name', None) + self.key_vault_secret_status = None + self.server_farm_id = kwargs.get('server_farm_id', None) + self.canonical_name = kwargs.get('canonical_name', None) + + +class ClientRegistration(ProxyOnlyResource): + """ClientRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param client_id: + :type client_id: str + :param client_secret_setting_name: + :type client_secret_setting_name: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ClientRegistration, self).__init__(**kwargs) + self.client_id = kwargs.get('client_id', None) + self.client_secret_setting_name = kwargs.get('client_secret_setting_name', None) + + +class CloningInfo(msrest.serialization.Model): + """Information needed for cloning operation. + + All required parameters must be populated in order to send to Azure. + + :param correlation_id: Correlation ID of cloning operation. This ID ties multiple cloning + operations + together to use the same snapshot. + :type correlation_id: str + :param overwrite: :code:`true` to overwrite destination app; otherwise, + :code:`false`. + :type overwrite: bool + :param clone_custom_host_names: :code:`true` to clone custom hostnames from source + app; otherwise, :code:`false`. + :type clone_custom_host_names: bool + :param clone_source_control: :code:`true` to clone source control from source app; + otherwise, :code:`false`. + :type clone_source_control: bool + :param source_web_app_id: Required. ARM resource ID of the source app. App resource ID is of + the form + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + for production slots and + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + for other slots. + :type source_web_app_id: str + :param source_web_app_location: Location of source app ex: West US or North Europe. + :type source_web_app_location: str + :param hosting_environment: App Service Environment. + :type hosting_environment: str + :param app_settings_overrides: Application setting overrides for cloned app. If specified, + these settings override the settings cloned + from source app. Otherwise, application settings from source app are retained. + :type app_settings_overrides: dict[str, str] + :param configure_load_balancing: :code:`true` to configure load balancing for + source and destination app. + :type configure_load_balancing: bool + :param traffic_manager_profile_id: ARM resource ID of the Traffic Manager profile to use, if it + exists. Traffic Manager resource ID is of the form + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + :type traffic_manager_profile_id: str + :param traffic_manager_profile_name: Name of Traffic Manager profile to create. This is only + needed if Traffic Manager profile does not already exist. + :type traffic_manager_profile_name: str + """ + + _validation = { + 'source_web_app_id': {'required': True}, + } + + _attribute_map = { + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'overwrite': {'key': 'overwrite', 'type': 'bool'}, + 'clone_custom_host_names': {'key': 'cloneCustomHostNames', 'type': 'bool'}, + 'clone_source_control': {'key': 'cloneSourceControl', 'type': 'bool'}, + 'source_web_app_id': {'key': 'sourceWebAppId', 'type': 'str'}, + 'source_web_app_location': {'key': 'sourceWebAppLocation', 'type': 'str'}, + 'hosting_environment': {'key': 'hostingEnvironment', 'type': 'str'}, + 'app_settings_overrides': {'key': 'appSettingsOverrides', 'type': '{str}'}, + 'configure_load_balancing': {'key': 'configureLoadBalancing', 'type': 'bool'}, + 'traffic_manager_profile_id': {'key': 'trafficManagerProfileId', 'type': 'str'}, + 'traffic_manager_profile_name': {'key': 'trafficManagerProfileName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CloningInfo, self).__init__(**kwargs) + self.correlation_id = kwargs.get('correlation_id', None) + self.overwrite = kwargs.get('overwrite', None) + self.clone_custom_host_names = kwargs.get('clone_custom_host_names', None) + self.clone_source_control = kwargs.get('clone_source_control', None) + self.source_web_app_id = kwargs['source_web_app_id'] + self.source_web_app_location = kwargs.get('source_web_app_location', None) + self.hosting_environment = kwargs.get('hosting_environment', None) + self.app_settings_overrides = kwargs.get('app_settings_overrides', None) + self.configure_load_balancing = kwargs.get('configure_load_balancing', None) + self.traffic_manager_profile_id = kwargs.get('traffic_manager_profile_id', None) + self.traffic_manager_profile_name = kwargs.get('traffic_manager_profile_name', None) + + +class Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: Principal Id of user assigned identity. + :vartype principal_id: str + :ivar client_id: Client Id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class ConnectionStringDictionary(ProxyOnlyResource): + """String dictionary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param properties: Connection strings. + :type properties: dict[str, ~azure.mgmt.web.v2020_09_01.models.ConnStringValueTypePair] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': '{ConnStringValueTypePair}'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionStringDictionary, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ConnStringInfo(msrest.serialization.Model): + """Database connection string information. + + :param name: Name of connection string. + :type name: str + :param connection_string: Connection string value. + :type connection_string: str + :param type: Type of database. Possible values include: "MySql", "SQLServer", "SQLAzure", + "Custom", "NotificationHub", "ServiceBus", "EventHub", "ApiHub", "DocDb", "RedisCache", + "PostgreSQL". + :type type: str or ~azure.mgmt.web.v2020_09_01.models.ConnectionStringType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnStringInfo, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.connection_string = kwargs.get('connection_string', None) + self.type = kwargs.get('type', None) + + +class ConnStringValueTypePair(msrest.serialization.Model): + """Database connection string value to type pair. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Value of pair. + :type value: str + :param type: Required. Type of database. Possible values include: "MySql", "SQLServer", + "SQLAzure", "Custom", "NotificationHub", "ServiceBus", "EventHub", "ApiHub", "DocDb", + "RedisCache", "PostgreSQL". + :type type: str or ~azure.mgmt.web.v2020_09_01.models.ConnectionStringType + """ + + _validation = { + 'value': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnStringValueTypePair, self).__init__(**kwargs) + self.value = kwargs['value'] + self.type = kwargs['type'] + + +class Contact(msrest.serialization.Model): + """Contact information for domain registration. If 'Domain Privacy' option is not selected then the contact information is made publicly available through the Whois +directories as per ICANN requirements. + + All required parameters must be populated in order to send to Azure. + + :param address_mailing: Mailing address. + :type address_mailing: ~azure.mgmt.web.v2020_09_01.models.Address + :param email: Required. Email address. + :type email: str + :param fax: Fax number. + :type fax: str + :param job_title: Job title. + :type job_title: str + :param name_first: Required. First name. + :type name_first: str + :param name_last: Required. Last name. + :type name_last: str + :param name_middle: Middle name. + :type name_middle: str + :param organization: Organization contact belongs to. + :type organization: str + :param phone: Required. Phone number. + :type phone: str + """ + + _validation = { + 'email': {'required': True}, + 'name_first': {'required': True}, + 'name_last': {'required': True}, + 'phone': {'required': True}, + } + + _attribute_map = { + 'address_mailing': {'key': 'addressMailing', 'type': 'Address'}, + 'email': {'key': 'email', 'type': 'str'}, + 'fax': {'key': 'fax', 'type': 'str'}, + 'job_title': {'key': 'jobTitle', 'type': 'str'}, + 'name_first': {'key': 'nameFirst', 'type': 'str'}, + 'name_last': {'key': 'nameLast', 'type': 'str'}, + 'name_middle': {'key': 'nameMiddle', 'type': 'str'}, + 'organization': {'key': 'organization', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Contact, self).__init__(**kwargs) + self.address_mailing = kwargs.get('address_mailing', None) + self.email = kwargs['email'] + self.fax = kwargs.get('fax', None) + self.job_title = kwargs.get('job_title', None) + self.name_first = kwargs['name_first'] + self.name_last = kwargs['name_last'] + self.name_middle = kwargs.get('name_middle', None) + self.organization = kwargs.get('organization', None) + self.phone = kwargs['phone'] + + +class ContainerCpuStatistics(msrest.serialization.Model): + """ContainerCpuStatistics. + + :param cpu_usage: + :type cpu_usage: ~azure.mgmt.web.v2020_09_01.models.ContainerCpuUsage + :param system_cpu_usage: + :type system_cpu_usage: long + :param online_cpu_count: + :type online_cpu_count: int + :param throttling_data: + :type throttling_data: ~azure.mgmt.web.v2020_09_01.models.ContainerThrottlingData + """ + + _attribute_map = { + 'cpu_usage': {'key': 'cpuUsage', 'type': 'ContainerCpuUsage'}, + 'system_cpu_usage': {'key': 'systemCpuUsage', 'type': 'long'}, + 'online_cpu_count': {'key': 'onlineCpuCount', 'type': 'int'}, + 'throttling_data': {'key': 'throttlingData', 'type': 'ContainerThrottlingData'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerCpuStatistics, self).__init__(**kwargs) + self.cpu_usage = kwargs.get('cpu_usage', None) + self.system_cpu_usage = kwargs.get('system_cpu_usage', None) + self.online_cpu_count = kwargs.get('online_cpu_count', None) + self.throttling_data = kwargs.get('throttling_data', None) + + +class ContainerCpuUsage(msrest.serialization.Model): + """ContainerCpuUsage. + + :param total_usage: + :type total_usage: long + :param per_cpu_usage: + :type per_cpu_usage: list[long] + :param kernel_mode_usage: + :type kernel_mode_usage: long + :param user_mode_usage: + :type user_mode_usage: long + """ + + _attribute_map = { + 'total_usage': {'key': 'totalUsage', 'type': 'long'}, + 'per_cpu_usage': {'key': 'perCpuUsage', 'type': '[long]'}, + 'kernel_mode_usage': {'key': 'kernelModeUsage', 'type': 'long'}, + 'user_mode_usage': {'key': 'userModeUsage', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerCpuUsage, self).__init__(**kwargs) + self.total_usage = kwargs.get('total_usage', None) + self.per_cpu_usage = kwargs.get('per_cpu_usage', None) + self.kernel_mode_usage = kwargs.get('kernel_mode_usage', None) + self.user_mode_usage = kwargs.get('user_mode_usage', None) + + +class ContainerInfo(msrest.serialization.Model): + """ContainerInfo. + + :param current_time_stamp: + :type current_time_stamp: ~datetime.datetime + :param previous_time_stamp: + :type previous_time_stamp: ~datetime.datetime + :param current_cpu_stats: + :type current_cpu_stats: ~azure.mgmt.web.v2020_09_01.models.ContainerCpuStatistics + :param previous_cpu_stats: + :type previous_cpu_stats: ~azure.mgmt.web.v2020_09_01.models.ContainerCpuStatistics + :param memory_stats: + :type memory_stats: ~azure.mgmt.web.v2020_09_01.models.ContainerMemoryStatistics + :param name: + :type name: str + :param id: + :type id: str + :param eth0: + :type eth0: ~azure.mgmt.web.v2020_09_01.models.ContainerNetworkInterfaceStatistics + """ + + _attribute_map = { + 'current_time_stamp': {'key': 'currentTimeStamp', 'type': 'iso-8601'}, + 'previous_time_stamp': {'key': 'previousTimeStamp', 'type': 'iso-8601'}, + 'current_cpu_stats': {'key': 'currentCpuStats', 'type': 'ContainerCpuStatistics'}, + 'previous_cpu_stats': {'key': 'previousCpuStats', 'type': 'ContainerCpuStatistics'}, + 'memory_stats': {'key': 'memoryStats', 'type': 'ContainerMemoryStatistics'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'eth0': {'key': 'eth0', 'type': 'ContainerNetworkInterfaceStatistics'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerInfo, self).__init__(**kwargs) + self.current_time_stamp = kwargs.get('current_time_stamp', None) + self.previous_time_stamp = kwargs.get('previous_time_stamp', None) + self.current_cpu_stats = kwargs.get('current_cpu_stats', None) + self.previous_cpu_stats = kwargs.get('previous_cpu_stats', None) + self.memory_stats = kwargs.get('memory_stats', None) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.eth0 = kwargs.get('eth0', None) + + +class ContainerMemoryStatistics(msrest.serialization.Model): + """ContainerMemoryStatistics. + + :param usage: + :type usage: long + :param max_usage: + :type max_usage: long + :param limit: + :type limit: long + """ + + _attribute_map = { + 'usage': {'key': 'usage', 'type': 'long'}, + 'max_usage': {'key': 'maxUsage', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerMemoryStatistics, self).__init__(**kwargs) + self.usage = kwargs.get('usage', None) + self.max_usage = kwargs.get('max_usage', None) + self.limit = kwargs.get('limit', None) + + +class ContainerNetworkInterfaceStatistics(msrest.serialization.Model): + """ContainerNetworkInterfaceStatistics. + + :param rx_bytes: + :type rx_bytes: long + :param rx_packets: + :type rx_packets: long + :param rx_errors: + :type rx_errors: long + :param rx_dropped: + :type rx_dropped: long + :param tx_bytes: + :type tx_bytes: long + :param tx_packets: + :type tx_packets: long + :param tx_errors: + :type tx_errors: long + :param tx_dropped: + :type tx_dropped: long + """ + + _attribute_map = { + 'rx_bytes': {'key': 'rxBytes', 'type': 'long'}, + 'rx_packets': {'key': 'rxPackets', 'type': 'long'}, + 'rx_errors': {'key': 'rxErrors', 'type': 'long'}, + 'rx_dropped': {'key': 'rxDropped', 'type': 'long'}, + 'tx_bytes': {'key': 'txBytes', 'type': 'long'}, + 'tx_packets': {'key': 'txPackets', 'type': 'long'}, + 'tx_errors': {'key': 'txErrors', 'type': 'long'}, + 'tx_dropped': {'key': 'txDropped', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerNetworkInterfaceStatistics, self).__init__(**kwargs) + self.rx_bytes = kwargs.get('rx_bytes', None) + self.rx_packets = kwargs.get('rx_packets', None) + self.rx_errors = kwargs.get('rx_errors', None) + self.rx_dropped = kwargs.get('rx_dropped', None) + self.tx_bytes = kwargs.get('tx_bytes', None) + self.tx_packets = kwargs.get('tx_packets', None) + self.tx_errors = kwargs.get('tx_errors', None) + self.tx_dropped = kwargs.get('tx_dropped', None) + + +class ContainerThrottlingData(msrest.serialization.Model): + """ContainerThrottlingData. + + :param periods: + :type periods: int + :param throttled_periods: + :type throttled_periods: int + :param throttled_time: + :type throttled_time: int + """ + + _attribute_map = { + 'periods': {'key': 'periods', 'type': 'int'}, + 'throttled_periods': {'key': 'throttledPeriods', 'type': 'int'}, + 'throttled_time': {'key': 'throttledTime', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerThrottlingData, self).__init__(**kwargs) + self.periods = kwargs.get('periods', None) + self.throttled_periods = kwargs.get('throttled_periods', None) + self.throttled_time = kwargs.get('throttled_time', None) + + +class ContinuousWebJob(ProxyOnlyResource): + """Continuous Web Job Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param status: Job status. Possible values include: "Initializing", "Starting", "Running", + "PendingRestart", "Stopped". + :type status: str or ~azure.mgmt.web.v2020_09_01.models.ContinuousWebJobStatus + :param detailed_status: Detailed status. + :type detailed_status: str + :param log_url: Log URL. + :type log_url: str + :param run_command: Run command. + :type run_command: str + :param url: Job URL. + :type url: str + :param extra_info_url: Extra Info URL. + :type extra_info_url: str + :param web_job_type: Job type. Possible values include: "Continuous", "Triggered". + :type web_job_type: str or ~azure.mgmt.web.v2020_09_01.models.WebJobType + :param error: Error information. + :type error: str + :param using_sdk: Using SDK?. + :type using_sdk: bool + :param settings: Job settings. + :type settings: dict[str, object] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'detailed_status': {'key': 'properties.detailed_status', 'type': 'str'}, + 'log_url': {'key': 'properties.log_url', 'type': 'str'}, + 'run_command': {'key': 'properties.run_command', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'extra_info_url': {'key': 'properties.extra_info_url', 'type': 'str'}, + 'web_job_type': {'key': 'properties.web_job_type', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'str'}, + 'using_sdk': {'key': 'properties.using_sdk', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(ContinuousWebJob, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.detailed_status = kwargs.get('detailed_status', None) + self.log_url = kwargs.get('log_url', None) + self.run_command = kwargs.get('run_command', None) + self.url = kwargs.get('url', None) + self.extra_info_url = kwargs.get('extra_info_url', None) + self.web_job_type = kwargs.get('web_job_type', None) + self.error = kwargs.get('error', None) + self.using_sdk = kwargs.get('using_sdk', None) + self.settings = kwargs.get('settings', None) + + +class ContinuousWebJobCollection(msrest.serialization.Model): + """Collection of Kudu continuous web job information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.ContinuousWebJob] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ContinuousWebJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ContinuousWebJobCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class CookieExpiration(ProxyOnlyResource): + """CookieExpiration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param convention: Possible values include: "FixedTime", "IdentityProviderDerived". + :type convention: str or ~azure.mgmt.web.v2020_09_01.models.CookieExpirationConvention + :param time_to_expiration: + :type time_to_expiration: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'convention': {'key': 'properties.convention', 'type': 'str'}, + 'time_to_expiration': {'key': 'properties.timeToExpiration', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CookieExpiration, self).__init__(**kwargs) + self.convention = kwargs.get('convention', None) + self.time_to_expiration = kwargs.get('time_to_expiration', None) + + +class CorsSettings(msrest.serialization.Model): + """Cross-Origin Resource Sharing (CORS) settings for the app. + + :param allowed_origins: Gets or sets the list of origins that should be allowed to make cross- + origin + calls (for example: http://example.com:12345). Use "*" to allow all. + :type allowed_origins: list[str] + :param support_credentials: Gets or sets whether CORS requests with credentials are allowed. + See + https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + for more details. + :type support_credentials: bool + """ + + _attribute_map = { + 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'support_credentials': {'key': 'supportCredentials', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(CorsSettings, self).__init__(**kwargs) + self.allowed_origins = kwargs.get('allowed_origins', None) + self.support_credentials = kwargs.get('support_credentials', None) + + +class CsmCopySlotEntity(msrest.serialization.Model): + """Copy deployment slot parameters. + + All required parameters must be populated in order to send to Azure. + + :param target_slot: Required. Destination deployment slot during copy operation. + :type target_slot: str + :param site_config: Required. The site object which will be merged with the source slot site + to produce new destination slot site object. + :code:`null` to just copy source slot content. Otherwise a + :code:`Site` + object with properties to override source slot site. + :type site_config: ~azure.mgmt.web.v2020_09_01.models.SiteConfig + """ + + _validation = { + 'target_slot': {'required': True}, + 'site_config': {'required': True}, + } + + _attribute_map = { + 'target_slot': {'key': 'targetSlot', 'type': 'str'}, + 'site_config': {'key': 'siteConfig', 'type': 'SiteConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmCopySlotEntity, self).__init__(**kwargs) + self.target_slot = kwargs['target_slot'] + self.site_config = kwargs['site_config'] + + +class CsmMoveResourceEnvelope(msrest.serialization.Model): + """Object with a list of the resources that need to be moved and the resource group they should be moved to. + + :param target_resource_group: + :type target_resource_group: str + :param resources: + :type resources: list[str] + """ + + _validation = { + 'target_resource_group': {'max_length': 90, 'min_length': 1, 'pattern': r' ^[-\w\._\(\)]+[^\.]$'}, + } + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmMoveResourceEnvelope, self).__init__(**kwargs) + self.target_resource_group = kwargs.get('target_resource_group', None) + self.resources = kwargs.get('resources', None) + + +class CsmOperationCollection(msrest.serialization.Model): + """Collection of Azure resource manager operation metadata. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.CsmOperationDescription] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CsmOperationDescription]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmOperationCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class CsmOperationDescription(msrest.serialization.Model): + """Description of an operation available for Microsoft.Web resource provider. + + :param name: + :type name: str + :param display: Meta data about operation used for display in portal. + :type display: ~azure.mgmt.web.v2020_09_01.models.CsmOperationDisplay + :param origin: + :type origin: str + :param properties: Properties available for a Microsoft.Web resource provider operation. + :type properties: ~azure.mgmt.web.v2020_09_01.models.CsmOperationDescriptionProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'CsmOperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CsmOperationDescriptionProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmOperationDescription, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) + + +class CsmOperationDescriptionProperties(msrest.serialization.Model): + """Properties available for a Microsoft.Web resource provider operation. + + :param service_specification: Resource metrics service provided by Microsoft.Insights resource + provider. + :type service_specification: ~azure.mgmt.web.v2020_09_01.models.ServiceSpecification + """ + + _attribute_map = { + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmOperationDescriptionProperties, self).__init__(**kwargs) + self.service_specification = kwargs.get('service_specification', None) + + +class CsmOperationDisplay(msrest.serialization.Model): + """Meta data about operation used for display in portal. + + :param provider: + :type provider: str + :param resource: + :type resource: str + :param operation: + :type operation: str + :param description: + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmOperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class CsmPublishingCredentialsPoliciesCollection(ProxyOnlyResource): + """Publishing Credentials Policies collection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param ftp: Whether FTP is allowed. + :type ftp: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingCredentialsPoliciesEntity + :param scm: Whether Scm Basic Auth is allowed. + :type scm: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingCredentialsPoliciesEntity + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'ftp': {'key': 'properties.ftp', 'type': 'CsmPublishingCredentialsPoliciesEntity'}, + 'scm': {'key': 'properties.scm', 'type': 'CsmPublishingCredentialsPoliciesEntity'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmPublishingCredentialsPoliciesCollection, self).__init__(**kwargs) + self.ftp = kwargs.get('ftp', None) + self.scm = kwargs.get('scm', None) + + +class CsmPublishingCredentialsPoliciesEntity(ProxyOnlyResource): + """Publishing Credentials Policies parameters. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param allow: :code:`true` to allow access to a publishing method; otherwise, + :code:`false`. + :type allow: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'allow': {'key': 'properties.allow', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmPublishingCredentialsPoliciesEntity, self).__init__(**kwargs) + self.allow = kwargs.get('allow', None) + + +class CsmPublishingProfileOptions(msrest.serialization.Model): + """Publishing options for requested profile. + + :param format: Name of the format. Valid values are: + FileZilla3 + WebDeploy -- default + Ftp. Possible values include: "FileZilla3", "WebDeploy", "Ftp". + :type format: str or ~azure.mgmt.web.v2020_09_01.models.PublishingProfileFormat + :param include_disaster_recovery_endpoints: Include the DisasterRecover endpoint if true. + :type include_disaster_recovery_endpoints: bool + """ + + _attribute_map = { + 'format': {'key': 'format', 'type': 'str'}, + 'include_disaster_recovery_endpoints': {'key': 'includeDisasterRecoveryEndpoints', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmPublishingProfileOptions, self).__init__(**kwargs) + self.format = kwargs.get('format', None) + self.include_disaster_recovery_endpoints = kwargs.get('include_disaster_recovery_endpoints', None) + + +class CsmSlotEntity(msrest.serialization.Model): + """Deployment slot parameters. + + All required parameters must be populated in order to send to Azure. + + :param target_slot: Required. Destination deployment slot during swap operation. + :type target_slot: str + :param preserve_vnet: Required. :code:`true` to preserve Virtual Network to the + slot during swap; otherwise, :code:`false`. + :type preserve_vnet: bool + """ + + _validation = { + 'target_slot': {'required': True}, + 'preserve_vnet': {'required': True}, + } + + _attribute_map = { + 'target_slot': {'key': 'targetSlot', 'type': 'str'}, + 'preserve_vnet': {'key': 'preserveVnet', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmSlotEntity, self).__init__(**kwargs) + self.target_slot = kwargs['target_slot'] + self.preserve_vnet = kwargs['preserve_vnet'] + + +class CsmUsageQuota(msrest.serialization.Model): + """Usage of the quota resource. + + :param unit: Units of measurement for the quota resource. + :type unit: str + :param next_reset_time: Next reset time for the resource counter. + :type next_reset_time: ~datetime.datetime + :param current_value: The current value of the resource counter. + :type current_value: long + :param limit: The resource limit. + :type limit: long + :param name: Quota name. + :type name: ~azure.mgmt.web.v2020_09_01.models.LocalizableString + """ + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'next_reset_time': {'key': 'nextResetTime', 'type': 'iso-8601'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'LocalizableString'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmUsageQuota, self).__init__(**kwargs) + self.unit = kwargs.get('unit', None) + self.next_reset_time = kwargs.get('next_reset_time', None) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) + + +class CsmUsageQuotaCollection(msrest.serialization.Model): + """Collection of CSM usage quotas. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.CsmUsageQuota] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CsmUsageQuota]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmUsageQuotaCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class CustomHostnameAnalysisResult(ProxyOnlyResource): + """Custom domain analysis. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar is_hostname_already_verified: :code:`true` if hostname is already verified; + otherwise, :code:`false`. + :vartype is_hostname_already_verified: bool + :ivar custom_domain_verification_test: DNS verification test result. Possible values include: + "Passed", "Failed", "Skipped". + :vartype custom_domain_verification_test: str or + ~azure.mgmt.web.v2020_09_01.models.DnsVerificationTestResult + :ivar custom_domain_verification_failure_info: Raw failure information if DNS verification + fails. + :vartype custom_domain_verification_failure_info: + ~azure.mgmt.web.v2020_09_01.models.ErrorEntity + :ivar has_conflict_on_scale_unit: :code:`true` if there is a conflict on a scale + unit; otherwise, :code:`false`. + :vartype has_conflict_on_scale_unit: bool + :ivar has_conflict_across_subscription: :code:`true` if there is a conflict across + subscriptions; otherwise, :code:`false`. + :vartype has_conflict_across_subscription: bool + :ivar conflicting_app_resource_id: Name of the conflicting app on scale unit if it's within the + same subscription. + :vartype conflicting_app_resource_id: str + :param c_name_records: CName records controller can see for this hostname. + :type c_name_records: list[str] + :param txt_records: TXT records controller can see for this hostname. + :type txt_records: list[str] + :param a_records: A records controller can see for this hostname. + :type a_records: list[str] + :param alternate_c_name_records: Alternate CName records controller can see for this hostname. + :type alternate_c_name_records: list[str] + :param alternate_txt_records: Alternate TXT records controller can see for this hostname. + :type alternate_txt_records: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'is_hostname_already_verified': {'readonly': True}, + 'custom_domain_verification_test': {'readonly': True}, + 'custom_domain_verification_failure_info': {'readonly': True}, + 'has_conflict_on_scale_unit': {'readonly': True}, + 'has_conflict_across_subscription': {'readonly': True}, + 'conflicting_app_resource_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'is_hostname_already_verified': {'key': 'properties.isHostnameAlreadyVerified', 'type': 'bool'}, + 'custom_domain_verification_test': {'key': 'properties.customDomainVerificationTest', 'type': 'str'}, + 'custom_domain_verification_failure_info': {'key': 'properties.customDomainVerificationFailureInfo', 'type': 'ErrorEntity'}, + 'has_conflict_on_scale_unit': {'key': 'properties.hasConflictOnScaleUnit', 'type': 'bool'}, + 'has_conflict_across_subscription': {'key': 'properties.hasConflictAcrossSubscription', 'type': 'bool'}, + 'conflicting_app_resource_id': {'key': 'properties.conflictingAppResourceId', 'type': 'str'}, + 'c_name_records': {'key': 'properties.cNameRecords', 'type': '[str]'}, + 'txt_records': {'key': 'properties.txtRecords', 'type': '[str]'}, + 'a_records': {'key': 'properties.aRecords', 'type': '[str]'}, + 'alternate_c_name_records': {'key': 'properties.alternateCNameRecords', 'type': '[str]'}, + 'alternate_txt_records': {'key': 'properties.alternateTxtRecords', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(CustomHostnameAnalysisResult, self).__init__(**kwargs) + self.is_hostname_already_verified = None + self.custom_domain_verification_test = None + self.custom_domain_verification_failure_info = None + self.has_conflict_on_scale_unit = None + self.has_conflict_across_subscription = None + self.conflicting_app_resource_id = None + self.c_name_records = kwargs.get('c_name_records', None) + self.txt_records = kwargs.get('txt_records', None) + self.a_records = kwargs.get('a_records', None) + self.alternate_c_name_records = kwargs.get('alternate_c_name_records', None) + self.alternate_txt_records = kwargs.get('alternate_txt_records', None) + + +class CustomOpenIdConnectProvider(ProxyOnlyResource): + """CustomOpenIdConnectProvider. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_09_01.models.OpenIdConnectRegistration + :param login: + :type login: ~azure.mgmt.web.v2020_09_01.models.OpenIdConnectLogin + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'OpenIdConnectRegistration'}, + 'login': {'key': 'properties.login', 'type': 'OpenIdConnectLogin'}, + } + + def __init__( + self, + **kwargs + ): + super(CustomOpenIdConnectProvider, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.registration = kwargs.get('registration', None) + self.login = kwargs.get('login', None) + + +class DatabaseBackupSetting(msrest.serialization.Model): + """Database backup settings. + + All required parameters must be populated in order to send to Azure. + + :param database_type: Required. Database type (e.g. SqlAzure / MySql). Possible values include: + "SqlAzure", "MySql", "LocalMySql", "PostgreSql". + :type database_type: str or ~azure.mgmt.web.v2020_09_01.models.DatabaseType + :param name: + :type name: str + :param connection_string_name: Contains a connection string name that is linked to the + SiteConfig.ConnectionStrings. + This is used during restore with overwrite connection strings options. + :type connection_string_name: str + :param connection_string: Contains a connection string to a database which is being backed up + or restored. If the restore should happen to a new database, the database name inside is the + new one. + :type connection_string: str + """ + + _validation = { + 'database_type': {'required': True}, + } + + _attribute_map = { + 'database_type': {'key': 'databaseType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'connection_string_name': {'key': 'connectionStringName', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabaseBackupSetting, self).__init__(**kwargs) + self.database_type = kwargs['database_type'] + self.name = kwargs.get('name', None) + self.connection_string_name = kwargs.get('connection_string_name', None) + self.connection_string = kwargs.get('connection_string', None) + + +class DataSource(msrest.serialization.Model): + """Class representing data source used by the detectors. + + :param instructions: Instructions if any for the data source. + :type instructions: list[str] + :param data_source_uri: Datasource Uri Links. + :type data_source_uri: list[~azure.mgmt.web.v2020_09_01.models.NameValuePair] + """ + + _attribute_map = { + 'instructions': {'key': 'instructions', 'type': '[str]'}, + 'data_source_uri': {'key': 'dataSourceUri', 'type': '[NameValuePair]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataSource, self).__init__(**kwargs) + self.instructions = kwargs.get('instructions', None) + self.data_source_uri = kwargs.get('data_source_uri', None) + + +class DataTableResponseColumn(msrest.serialization.Model): + """Column definition. + + :param column_name: Name of the column. + :type column_name: str + :param data_type: Data type which looks like 'String' or 'Int32'. + :type data_type: str + :param column_type: Column Type. + :type column_type: str + """ + + _attribute_map = { + 'column_name': {'key': 'columnName', 'type': 'str'}, + 'data_type': {'key': 'dataType', 'type': 'str'}, + 'column_type': {'key': 'columnType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataTableResponseColumn, self).__init__(**kwargs) + self.column_name = kwargs.get('column_name', None) + self.data_type = kwargs.get('data_type', None) + self.column_type = kwargs.get('column_type', None) + + +class DataTableResponseObject(msrest.serialization.Model): + """Data Table which defines columns and raw row values. + + :param table_name: Name of the table. + :type table_name: str + :param columns: List of columns with data types. + :type columns: list[~azure.mgmt.web.v2020_09_01.models.DataTableResponseColumn] + :param rows: Raw row values. + :type rows: list[list[str]] + """ + + _attribute_map = { + 'table_name': {'key': 'tableName', 'type': 'str'}, + 'columns': {'key': 'columns', 'type': '[DataTableResponseColumn]'}, + 'rows': {'key': 'rows', 'type': '[[str]]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataTableResponseObject, self).__init__(**kwargs) + self.table_name = kwargs.get('table_name', None) + self.columns = kwargs.get('columns', None) + self.rows = kwargs.get('rows', None) + + +class DefaultErrorResponse(msrest.serialization.Model): + """App Service error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Error model. + :vartype error: ~azure.mgmt.web.v2020_09_01.models.DefaultErrorResponseError + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'DefaultErrorResponseError'}, + } + + def __init__( + self, + **kwargs + ): + super(DefaultErrorResponse, self).__init__(**kwargs) + self.error = None + + +class DefaultErrorResponseError(msrest.serialization.Model): + """Error model. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Standardized string to programmatically identify the error. + :vartype code: str + :ivar message: Detailed error description and debugging information. + :vartype message: str + :ivar target: Detailed error description and debugging information. + :vartype target: str + :param details: + :type details: list[~azure.mgmt.web.v2020_09_01.models.DefaultErrorResponseErrorDetailsItem] + :ivar innererror: More information to debug error. + :vartype innererror: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'innererror': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[DefaultErrorResponseErrorDetailsItem]'}, + 'innererror': {'key': 'innererror', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DefaultErrorResponseError, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = kwargs.get('details', None) + self.innererror = None + + +class DefaultErrorResponseErrorDetailsItem(msrest.serialization.Model): + """Detailed errors. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Standardized string to programmatically identify the error. + :vartype code: str + :ivar message: Detailed error description and debugging information. + :vartype message: str + :ivar target: Detailed error description and debugging information. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DefaultErrorResponseErrorDetailsItem, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + + +class DeletedAppRestoreRequest(ProxyOnlyResource): + """Details about restoring a deleted app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param deleted_site_id: ARM resource ID of the deleted app. Example: + /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}. + :type deleted_site_id: str + :param recover_configuration: If true, deleted site configuration, in addition to content, will + be restored. + :type recover_configuration: bool + :param snapshot_time: Point in time to restore the deleted app from, formatted as a DateTime + string. + If unspecified, default value is the time that the app was deleted. + :type snapshot_time: str + :param use_dr_secondary: If true, the snapshot is retrieved from DRSecondary endpoint. + :type use_dr_secondary: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'deleted_site_id': {'key': 'properties.deletedSiteId', 'type': 'str'}, + 'recover_configuration': {'key': 'properties.recoverConfiguration', 'type': 'bool'}, + 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'str'}, + 'use_dr_secondary': {'key': 'properties.useDRSecondary', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedAppRestoreRequest, self).__init__(**kwargs) + self.deleted_site_id = kwargs.get('deleted_site_id', None) + self.recover_configuration = kwargs.get('recover_configuration', None) + self.snapshot_time = kwargs.get('snapshot_time', None) + self.use_dr_secondary = kwargs.get('use_dr_secondary', None) + + +class DeletedSite(ProxyOnlyResource): + """A deleted app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar deleted_site_id: Numeric id for the deleted site. + :vartype deleted_site_id: int + :ivar deleted_timestamp: Time in UTC when the app was deleted. + :vartype deleted_timestamp: str + :ivar subscription: Subscription containing the deleted site. + :vartype subscription: str + :ivar resource_group: ResourceGroup that contained the deleted site. + :vartype resource_group: str + :ivar deleted_site_name: Name of the deleted site. + :vartype deleted_site_name: str + :ivar slot: Slot of the deleted site. + :vartype slot: str + :ivar kind_properties_kind: Kind of site that was deleted. + :vartype kind_properties_kind: str + :ivar geo_region_name: Geo Region of the deleted site. + :vartype geo_region_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'deleted_site_id': {'readonly': True}, + 'deleted_timestamp': {'readonly': True}, + 'subscription': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'deleted_site_name': {'readonly': True}, + 'slot': {'readonly': True}, + 'kind_properties_kind': {'readonly': True}, + 'geo_region_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'deleted_site_id': {'key': 'properties.deletedSiteId', 'type': 'int'}, + 'deleted_timestamp': {'key': 'properties.deletedTimestamp', 'type': 'str'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'deleted_site_name': {'key': 'properties.deletedSiteName', 'type': 'str'}, + 'slot': {'key': 'properties.slot', 'type': 'str'}, + 'kind_properties_kind': {'key': 'properties.kind', 'type': 'str'}, + 'geo_region_name': {'key': 'properties.geoRegionName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedSite, self).__init__(**kwargs) + self.deleted_site_id = None + self.deleted_timestamp = None + self.subscription = None + self.resource_group = None + self.deleted_site_name = None + self.slot = None + self.kind_properties_kind = None + self.geo_region_name = None + + +class DeletedWebAppCollection(msrest.serialization.Model): + """Collection of deleted apps. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.DeletedSite] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DeletedSite]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedWebAppCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class Deployment(ProxyOnlyResource): + """User credentials used for publishing activity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param status: Deployment status. + :type status: int + :param message: Details about deployment status. + :type message: str + :param author: Who authored the deployment. + :type author: str + :param deployer: Who performed the deployment. + :type deployer: str + :param author_email: Author email. + :type author_email: str + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param end_time: End time. + :type end_time: ~datetime.datetime + :param active: True if deployment is currently active, false if completed and null if not + started. + :type active: bool + :param details: Details on deployment. + :type details: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'status': {'key': 'properties.status', 'type': 'int'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'author': {'key': 'properties.author', 'type': 'str'}, + 'deployer': {'key': 'properties.deployer', 'type': 'str'}, + 'author_email': {'key': 'properties.author_email', 'type': 'str'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.end_time', 'type': 'iso-8601'}, + 'active': {'key': 'properties.active', 'type': 'bool'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Deployment, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.message = kwargs.get('message', None) + self.author = kwargs.get('author', None) + self.deployer = kwargs.get('deployer', None) + self.author_email = kwargs.get('author_email', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.active = kwargs.get('active', None) + self.details = kwargs.get('details', None) + + +class DeploymentCollection(msrest.serialization.Model): + """Collection of app deployments. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.Deployment] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Deployment]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DeploymentCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class DeploymentLocations(msrest.serialization.Model): + """List of available locations (regions or App Service Environments) for +deployment of App Service resources. + + :param locations: Available regions. + :type locations: list[~azure.mgmt.web.v2020_09_01.models.GeoRegion] + :param hosting_environments: Available App Service Environments with full descriptions of the + environments. + :type hosting_environments: list[~azure.mgmt.web.v2020_09_01.models.AppServiceEnvironment] + :param hosting_environment_deployment_infos: Available App Service Environments with basic + information. + :type hosting_environment_deployment_infos: + list[~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentDeploymentInfo] + """ + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[GeoRegion]'}, + 'hosting_environments': {'key': 'hostingEnvironments', 'type': '[AppServiceEnvironment]'}, + 'hosting_environment_deployment_infos': {'key': 'hostingEnvironmentDeploymentInfos', 'type': '[HostingEnvironmentDeploymentInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(DeploymentLocations, self).__init__(**kwargs) + self.locations = kwargs.get('locations', None) + self.hosting_environments = kwargs.get('hosting_environments', None) + self.hosting_environment_deployment_infos = kwargs.get('hosting_environment_deployment_infos', None) + + +class DetectorAbnormalTimePeriod(msrest.serialization.Model): + """Class representing Abnormal Time Period detected. + + :param start_time: Start time of the correlated event. + :type start_time: ~datetime.datetime + :param end_time: End time of the correlated event. + :type end_time: ~datetime.datetime + :param message: Message describing the event. + :type message: str + :param source: Represents the name of the Detector. + :type source: str + :param priority: Represents the rank of the Detector. + :type priority: float + :param meta_data: Downtime metadata. + :type meta_data: list[list[~azure.mgmt.web.v2020_09_01.models.NameValuePair]] + :param type: Represents the type of the Detector. Possible values include: "ServiceIncident", + "AppDeployment", "AppCrash", "RuntimeIssueDetected", "AseDeployment", "UserIssue", + "PlatformIssue", "Other". + :type type: str or ~azure.mgmt.web.v2020_09_01.models.IssueType + :param solutions: List of proposed solutions. + :type solutions: list[~azure.mgmt.web.v2020_09_01.models.Solution] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'float'}, + 'meta_data': {'key': 'metaData', 'type': '[[NameValuePair]]'}, + 'type': {'key': 'type', 'type': 'str'}, + 'solutions': {'key': 'solutions', 'type': '[Solution]'}, + } + + def __init__( + self, + **kwargs + ): + super(DetectorAbnormalTimePeriod, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.message = kwargs.get('message', None) + self.source = kwargs.get('source', None) + self.priority = kwargs.get('priority', None) + self.meta_data = kwargs.get('meta_data', None) + self.type = kwargs.get('type', None) + self.solutions = kwargs.get('solutions', None) + + +class DetectorDefinition(ProxyOnlyResource): + """Class representing detector definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar display_name: Display name of the detector. + :vartype display_name: str + :ivar description: Description of the detector. + :vartype description: str + :ivar rank: Detector Rank. + :vartype rank: float + :ivar is_enabled: Flag representing whether detector is enabled or not. + :vartype is_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'rank': {'readonly': True}, + 'is_enabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'rank': {'key': 'properties.rank', 'type': 'float'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DetectorDefinition, self).__init__(**kwargs) + self.display_name = None + self.description = None + self.rank = None + self.is_enabled = None + + +class DetectorInfo(msrest.serialization.Model): + """Definition of Detector. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar description: Short description of the detector and its purpose. + :vartype description: str + :ivar category: Support Category. + :vartype category: str + :ivar sub_category: Support Sub Category. + :vartype sub_category: str + :ivar support_topic_id: Support Topic Id. + :vartype support_topic_id: str + """ + + _validation = { + 'description': {'readonly': True}, + 'category': {'readonly': True}, + 'sub_category': {'readonly': True}, + 'support_topic_id': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'sub_category': {'key': 'subCategory', 'type': 'str'}, + 'support_topic_id': {'key': 'supportTopicId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DetectorInfo, self).__init__(**kwargs) + self.description = None + self.category = None + self.sub_category = None + self.support_topic_id = None + + +class DetectorResponse(ProxyOnlyResource): + """Class representing Response from Detector. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param metadata: metadata for the detector. + :type metadata: ~azure.mgmt.web.v2020_09_01.models.DetectorInfo + :param dataset: Data Set. + :type dataset: list[~azure.mgmt.web.v2020_09_01.models.DiagnosticData] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'metadata': {'key': 'properties.metadata', 'type': 'DetectorInfo'}, + 'dataset': {'key': 'properties.dataset', 'type': '[DiagnosticData]'}, + } + + def __init__( + self, + **kwargs + ): + super(DetectorResponse, self).__init__(**kwargs) + self.metadata = kwargs.get('metadata', None) + self.dataset = kwargs.get('dataset', None) + + +class DetectorResponseCollection(msrest.serialization.Model): + """Collection of detector responses. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.DetectorResponse] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DetectorResponse]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DetectorResponseCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class DiagnosticAnalysis(ProxyOnlyResource): + """Class representing a diagnostic analysis done on an application. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param abnormal_time_periods: List of time periods. + :type abnormal_time_periods: list[~azure.mgmt.web.v2020_09_01.models.AbnormalTimePeriod] + :param payload: Data by each detector. + :type payload: list[~azure.mgmt.web.v2020_09_01.models.AnalysisData] + :param non_correlated_detectors: Data by each detector for detectors that did not corelate. + :type non_correlated_detectors: list[~azure.mgmt.web.v2020_09_01.models.DetectorDefinition] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'abnormal_time_periods': {'key': 'properties.abnormalTimePeriods', 'type': '[AbnormalTimePeriod]'}, + 'payload': {'key': 'properties.payload', 'type': '[AnalysisData]'}, + 'non_correlated_detectors': {'key': 'properties.nonCorrelatedDetectors', 'type': '[DetectorDefinition]'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticAnalysis, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.abnormal_time_periods = kwargs.get('abnormal_time_periods', None) + self.payload = kwargs.get('payload', None) + self.non_correlated_detectors = kwargs.get('non_correlated_detectors', None) + + +class DiagnosticAnalysisCollection(msrest.serialization.Model): + """Collection of Diagnostic Analyses. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.AnalysisDefinition] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AnalysisDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticAnalysisCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class DiagnosticCategory(ProxyOnlyResource): + """Class representing detector definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar description: Description of the diagnostic category. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticCategory, self).__init__(**kwargs) + self.description = None + + +class DiagnosticCategoryCollection(msrest.serialization.Model): + """Collection of Diagnostic Categories. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.DiagnosticCategory] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DiagnosticCategory]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticCategoryCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class DiagnosticData(msrest.serialization.Model): + """Set of data with rendering instructions. + + :param table: Data in table form. + :type table: ~azure.mgmt.web.v2020_09_01.models.DataTableResponseObject + :param rendering_properties: Properties that describe how the table should be rendered. + :type rendering_properties: ~azure.mgmt.web.v2020_09_01.models.Rendering + """ + + _attribute_map = { + 'table': {'key': 'table', 'type': 'DataTableResponseObject'}, + 'rendering_properties': {'key': 'renderingProperties', 'type': 'Rendering'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticData, self).__init__(**kwargs) + self.table = kwargs.get('table', None) + self.rendering_properties = kwargs.get('rendering_properties', None) + + +class DiagnosticDetectorCollection(msrest.serialization.Model): + """Collection of Diagnostic Detectors. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.DetectorDefinition] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DetectorDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticDetectorCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class DiagnosticDetectorResponse(ProxyOnlyResource): + """Class representing Response from Diagnostic Detectors. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param issue_detected: Flag representing Issue was detected. + :type issue_detected: bool + :param detector_definition: Detector's definition. + :type detector_definition: ~azure.mgmt.web.v2020_09_01.models.DetectorDefinition + :param metrics: Metrics provided by the detector. + :type metrics: list[~azure.mgmt.web.v2020_09_01.models.DiagnosticMetricSet] + :param abnormal_time_periods: List of Correlated events found by the detector. + :type abnormal_time_periods: + list[~azure.mgmt.web.v2020_09_01.models.DetectorAbnormalTimePeriod] + :param data: Additional Data that detector wants to send. + :type data: list[list[~azure.mgmt.web.v2020_09_01.models.NameValuePair]] + :param response_meta_data: Meta Data. + :type response_meta_data: ~azure.mgmt.web.v2020_09_01.models.ResponseMetaData + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'issue_detected': {'key': 'properties.issueDetected', 'type': 'bool'}, + 'detector_definition': {'key': 'properties.detectorDefinition', 'type': 'DetectorDefinition'}, + 'metrics': {'key': 'properties.metrics', 'type': '[DiagnosticMetricSet]'}, + 'abnormal_time_periods': {'key': 'properties.abnormalTimePeriods', 'type': '[DetectorAbnormalTimePeriod]'}, + 'data': {'key': 'properties.data', 'type': '[[NameValuePair]]'}, + 'response_meta_data': {'key': 'properties.responseMetaData', 'type': 'ResponseMetaData'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticDetectorResponse, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.issue_detected = kwargs.get('issue_detected', None) + self.detector_definition = kwargs.get('detector_definition', None) + self.metrics = kwargs.get('metrics', None) + self.abnormal_time_periods = kwargs.get('abnormal_time_periods', None) + self.data = kwargs.get('data', None) + self.response_meta_data = kwargs.get('response_meta_data', None) + + +class DiagnosticMetricSample(msrest.serialization.Model): + """Class representing Diagnostic Metric. + + :param timestamp: Time at which metric is measured. + :type timestamp: ~datetime.datetime + :param role_instance: Role Instance. Null if this counter is not per instance + This is returned and should be whichever instance name we desire to be returned + i.e. CPU and Memory return RDWORKERNAME (LargeDed..._IN_0) + where RDWORKERNAME is Machine name below and RoleInstance name in parenthesis. + :type role_instance: str + :param total: Total value of the metric. If multiple measurements are made this will have sum + of all. + :type total: float + :param maximum: Maximum of the metric sampled during the time period. + :type maximum: float + :param minimum: Minimum of the metric sampled during the time period. + :type minimum: float + :param is_aggregated: Whether the values are aggregates across all workers or not. + :type is_aggregated: bool + """ + + _attribute_map = { + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'role_instance': {'key': 'roleInstance', 'type': 'str'}, + 'total': {'key': 'total', 'type': 'float'}, + 'maximum': {'key': 'maximum', 'type': 'float'}, + 'minimum': {'key': 'minimum', 'type': 'float'}, + 'is_aggregated': {'key': 'isAggregated', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticMetricSample, self).__init__(**kwargs) + self.timestamp = kwargs.get('timestamp', None) + self.role_instance = kwargs.get('role_instance', None) + self.total = kwargs.get('total', None) + self.maximum = kwargs.get('maximum', None) + self.minimum = kwargs.get('minimum', None) + self.is_aggregated = kwargs.get('is_aggregated', None) + + +class DiagnosticMetricSet(msrest.serialization.Model): + """Class representing Diagnostic Metric information. + + :param name: Name of the metric. + :type name: str + :param unit: Metric's unit. + :type unit: str + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param time_grain: Presented time grain. Supported grains at the moment are PT1M, PT1H, P1D. + :type time_grain: str + :param values: Collection of metric values for the selected period based on the + {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain}. + :type values: list[~azure.mgmt.web.v2020_09_01.models.DiagnosticMetricSample] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[DiagnosticMetricSample]'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticMetricSet, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.unit = kwargs.get('unit', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.time_grain = kwargs.get('time_grain', None) + self.values = kwargs.get('values', None) + + +class Dimension(msrest.serialization.Model): + """Dimension of a resource metric. For e.g. instance specific HTTP requests for a web app, +where instance name is dimension of the metric HTTP request. + + :param name: + :type name: str + :param display_name: + :type display_name: str + :param internal_name: + :type internal_name: str + :param to_be_exported_for_shoebox: + :type to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.internal_name = kwargs.get('internal_name', None) + self.to_be_exported_for_shoebox = kwargs.get('to_be_exported_for_shoebox', None) + + +class Domain(Resource): + """Information about a domain. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param contact_admin: Administrative contact. + :type contact_admin: ~azure.mgmt.web.v2020_09_01.models.Contact + :param contact_billing: Billing contact. + :type contact_billing: ~azure.mgmt.web.v2020_09_01.models.Contact + :param contact_registrant: Registrant contact. + :type contact_registrant: ~azure.mgmt.web.v2020_09_01.models.Contact + :param contact_tech: Technical contact. + :type contact_tech: ~azure.mgmt.web.v2020_09_01.models.Contact + :ivar registration_status: Domain registration status. Possible values include: "Active", + "Awaiting", "Cancelled", "Confiscated", "Disabled", "Excluded", "Expired", "Failed", "Held", + "Locked", "Parked", "Pending", "Reserved", "Reverted", "Suspended", "Transferred", "Unknown", + "Unlocked", "Unparked", "Updated", "JsonConverterFailed". + :vartype registration_status: str or ~azure.mgmt.web.v2020_09_01.models.DomainStatus + :ivar provisioning_state: Domain provisioning state. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.ProvisioningState + :ivar name_servers: Name servers. + :vartype name_servers: list[str] + :param privacy: :code:`true` if domain privacy is enabled for this domain; + otherwise, :code:`false`. + :type privacy: bool + :ivar created_time: Domain creation timestamp. + :vartype created_time: ~datetime.datetime + :ivar expiration_time: Domain expiration timestamp. + :vartype expiration_time: ~datetime.datetime + :ivar last_renewed_time: Timestamp when the domain was renewed last time. + :vartype last_renewed_time: ~datetime.datetime + :param auto_renew: :code:`true` if the domain should be automatically renewed; + otherwise, :code:`false`. + :type auto_renew: bool + :ivar ready_for_dns_record_management: :code:`true` if Azure can assign this + domain to App Service apps; otherwise, :code:`false`. This value will be + :code:`true` if domain registration status is active and + it is hosted on name servers Azure has programmatic access to. + :vartype ready_for_dns_record_management: bool + :ivar managed_host_names: All hostnames derived from the domain and assigned to Azure + resources. + :vartype managed_host_names: list[~azure.mgmt.web.v2020_09_01.models.HostName] + :param consent: Legal agreement consent. + :type consent: ~azure.mgmt.web.v2020_09_01.models.DomainPurchaseConsent + :ivar domain_not_renewable_reasons: Reasons why domain is not renewable. + :vartype domain_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2020_09_01.models.DomainPropertiesDomainNotRenewableReasonsItem] + :param dns_type: Current DNS type. Possible values include: "AzureDns", + "DefaultDomainRegistrarDns". + :type dns_type: str or ~azure.mgmt.web.v2020_09_01.models.DnsType + :param dns_zone_id: Azure DNS Zone to use. + :type dns_zone_id: str + :param target_dns_type: Target DNS type (would be used for migration). Possible values include: + "AzureDns", "DefaultDomainRegistrarDns". + :type target_dns_type: str or ~azure.mgmt.web.v2020_09_01.models.DnsType + :param auth_code: + :type auth_code: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'registration_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'name_servers': {'readonly': True}, + 'created_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'last_renewed_time': {'readonly': True}, + 'ready_for_dns_record_management': {'readonly': True}, + 'managed_host_names': {'readonly': True}, + 'domain_not_renewable_reasons': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'contact_admin': {'key': 'properties.contactAdmin', 'type': 'Contact'}, + 'contact_billing': {'key': 'properties.contactBilling', 'type': 'Contact'}, + 'contact_registrant': {'key': 'properties.contactRegistrant', 'type': 'Contact'}, + 'contact_tech': {'key': 'properties.contactTech', 'type': 'Contact'}, + 'registration_status': {'key': 'properties.registrationStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name_servers': {'key': 'properties.nameServers', 'type': '[str]'}, + 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'last_renewed_time': {'key': 'properties.lastRenewedTime', 'type': 'iso-8601'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'ready_for_dns_record_management': {'key': 'properties.readyForDnsRecordManagement', 'type': 'bool'}, + 'managed_host_names': {'key': 'properties.managedHostNames', 'type': '[HostName]'}, + 'consent': {'key': 'properties.consent', 'type': 'DomainPurchaseConsent'}, + 'domain_not_renewable_reasons': {'key': 'properties.domainNotRenewableReasons', 'type': '[str]'}, + 'dns_type': {'key': 'properties.dnsType', 'type': 'str'}, + 'dns_zone_id': {'key': 'properties.dnsZoneId', 'type': 'str'}, + 'target_dns_type': {'key': 'properties.targetDnsType', 'type': 'str'}, + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Domain, self).__init__(**kwargs) + self.contact_admin = kwargs.get('contact_admin', None) + self.contact_billing = kwargs.get('contact_billing', None) + self.contact_registrant = kwargs.get('contact_registrant', None) + self.contact_tech = kwargs.get('contact_tech', None) + self.registration_status = None + self.provisioning_state = None + self.name_servers = None + self.privacy = kwargs.get('privacy', None) + self.created_time = None + self.expiration_time = None + self.last_renewed_time = None + self.auto_renew = kwargs.get('auto_renew', True) + self.ready_for_dns_record_management = None + self.managed_host_names = None + self.consent = kwargs.get('consent', None) + self.domain_not_renewable_reasons = None + self.dns_type = kwargs.get('dns_type', None) + self.dns_zone_id = kwargs.get('dns_zone_id', None) + self.target_dns_type = kwargs.get('target_dns_type', None) + self.auth_code = kwargs.get('auth_code', None) + + +class DomainAvailabilityCheckResult(msrest.serialization.Model): + """Domain availability check result. + + :param name: Name of the domain. + :type name: str + :param available: :code:`true` if domain can be purchased using CreateDomain API; + otherwise, :code:`false`. + :type available: bool + :param domain_type: Valid values are Regular domain: Azure will charge the full price of domain + registration, SoftDeleted: Purchasing this domain will simply restore it and this operation + will not cost anything. Possible values include: "Regular", "SoftDeleted". + :type domain_type: str or ~azure.mgmt.web.v2020_09_01.models.DomainType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'available': {'key': 'available', 'type': 'bool'}, + 'domain_type': {'key': 'domainType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainAvailabilityCheckResult, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.available = kwargs.get('available', None) + self.domain_type = kwargs.get('domain_type', None) + + +class DomainCollection(msrest.serialization.Model): + """Collection of domains. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.Domain] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Domain]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class DomainControlCenterSsoRequest(msrest.serialization.Model): + """Single sign-on request information for domain management. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar url: URL where the single sign-on request is to be made. + :vartype url: str + :ivar post_parameter_key: Post parameter key. + :vartype post_parameter_key: str + :ivar post_parameter_value: Post parameter value. Client should use 'application/x-www-form- + urlencoded' encoding for this value. + :vartype post_parameter_value: str + """ + + _validation = { + 'url': {'readonly': True}, + 'post_parameter_key': {'readonly': True}, + 'post_parameter_value': {'readonly': True}, + } + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'post_parameter_key': {'key': 'postParameterKey', 'type': 'str'}, + 'post_parameter_value': {'key': 'postParameterValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainControlCenterSsoRequest, self).__init__(**kwargs) + self.url = None + self.post_parameter_key = None + self.post_parameter_value = None + + +class DomainOwnershipIdentifier(ProxyOnlyResource): + """Domain ownership Identifier. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param ownership_id: Ownership Id. + :type ownership_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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'ownership_id': {'key': 'properties.ownershipId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainOwnershipIdentifier, self).__init__(**kwargs) + self.ownership_id = kwargs.get('ownership_id', None) + + +class DomainOwnershipIdentifierCollection(msrest.serialization.Model): + """Collection of domain ownership identifiers. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.DomainOwnershipIdentifier] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DomainOwnershipIdentifier]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainOwnershipIdentifierCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class DomainPatchResource(ProxyOnlyResource): + """ARM resource for a domain. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param contact_admin: Administrative contact. + :type contact_admin: ~azure.mgmt.web.v2020_09_01.models.Contact + :param contact_billing: Billing contact. + :type contact_billing: ~azure.mgmt.web.v2020_09_01.models.Contact + :param contact_registrant: Registrant contact. + :type contact_registrant: ~azure.mgmt.web.v2020_09_01.models.Contact + :param contact_tech: Technical contact. + :type contact_tech: ~azure.mgmt.web.v2020_09_01.models.Contact + :ivar registration_status: Domain registration status. Possible values include: "Active", + "Awaiting", "Cancelled", "Confiscated", "Disabled", "Excluded", "Expired", "Failed", "Held", + "Locked", "Parked", "Pending", "Reserved", "Reverted", "Suspended", "Transferred", "Unknown", + "Unlocked", "Unparked", "Updated", "JsonConverterFailed". + :vartype registration_status: str or ~azure.mgmt.web.v2020_09_01.models.DomainStatus + :ivar provisioning_state: Domain provisioning state. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.ProvisioningState + :ivar name_servers: Name servers. + :vartype name_servers: list[str] + :param privacy: :code:`true` if domain privacy is enabled for this domain; + otherwise, :code:`false`. + :type privacy: bool + :ivar created_time: Domain creation timestamp. + :vartype created_time: ~datetime.datetime + :ivar expiration_time: Domain expiration timestamp. + :vartype expiration_time: ~datetime.datetime + :ivar last_renewed_time: Timestamp when the domain was renewed last time. + :vartype last_renewed_time: ~datetime.datetime + :param auto_renew: :code:`true` if the domain should be automatically renewed; + otherwise, :code:`false`. + :type auto_renew: bool + :ivar ready_for_dns_record_management: :code:`true` if Azure can assign this + domain to App Service apps; otherwise, :code:`false`. This value will be + :code:`true` if domain registration status is active and + it is hosted on name servers Azure has programmatic access to. + :vartype ready_for_dns_record_management: bool + :ivar managed_host_names: All hostnames derived from the domain and assigned to Azure + resources. + :vartype managed_host_names: list[~azure.mgmt.web.v2020_09_01.models.HostName] + :param consent: Legal agreement consent. + :type consent: ~azure.mgmt.web.v2020_09_01.models.DomainPurchaseConsent + :ivar domain_not_renewable_reasons: Reasons why domain is not renewable. + :vartype domain_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2020_09_01.models.DomainPatchResourcePropertiesDomainNotRenewableReasonsItem] + :param dns_type: Current DNS type. Possible values include: "AzureDns", + "DefaultDomainRegistrarDns". + :type dns_type: str or ~azure.mgmt.web.v2020_09_01.models.DnsType + :param dns_zone_id: Azure DNS Zone to use. + :type dns_zone_id: str + :param target_dns_type: Target DNS type (would be used for migration). Possible values include: + "AzureDns", "DefaultDomainRegistrarDns". + :type target_dns_type: str or ~azure.mgmt.web.v2020_09_01.models.DnsType + :param auth_code: + :type auth_code: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'registration_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'name_servers': {'readonly': True}, + 'created_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'last_renewed_time': {'readonly': True}, + 'ready_for_dns_record_management': {'readonly': True}, + 'managed_host_names': {'readonly': True}, + 'domain_not_renewable_reasons': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'contact_admin': {'key': 'properties.contactAdmin', 'type': 'Contact'}, + 'contact_billing': {'key': 'properties.contactBilling', 'type': 'Contact'}, + 'contact_registrant': {'key': 'properties.contactRegistrant', 'type': 'Contact'}, + 'contact_tech': {'key': 'properties.contactTech', 'type': 'Contact'}, + 'registration_status': {'key': 'properties.registrationStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name_servers': {'key': 'properties.nameServers', 'type': '[str]'}, + 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'last_renewed_time': {'key': 'properties.lastRenewedTime', 'type': 'iso-8601'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'ready_for_dns_record_management': {'key': 'properties.readyForDnsRecordManagement', 'type': 'bool'}, + 'managed_host_names': {'key': 'properties.managedHostNames', 'type': '[HostName]'}, + 'consent': {'key': 'properties.consent', 'type': 'DomainPurchaseConsent'}, + 'domain_not_renewable_reasons': {'key': 'properties.domainNotRenewableReasons', 'type': '[str]'}, + 'dns_type': {'key': 'properties.dnsType', 'type': 'str'}, + 'dns_zone_id': {'key': 'properties.dnsZoneId', 'type': 'str'}, + 'target_dns_type': {'key': 'properties.targetDnsType', 'type': 'str'}, + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainPatchResource, self).__init__(**kwargs) + self.contact_admin = kwargs.get('contact_admin', None) + self.contact_billing = kwargs.get('contact_billing', None) + self.contact_registrant = kwargs.get('contact_registrant', None) + self.contact_tech = kwargs.get('contact_tech', None) + self.registration_status = None + self.provisioning_state = None + self.name_servers = None + self.privacy = kwargs.get('privacy', None) + self.created_time = None + self.expiration_time = None + self.last_renewed_time = None + self.auto_renew = kwargs.get('auto_renew', True) + self.ready_for_dns_record_management = None + self.managed_host_names = None + self.consent = kwargs.get('consent', None) + self.domain_not_renewable_reasons = None + self.dns_type = kwargs.get('dns_type', None) + self.dns_zone_id = kwargs.get('dns_zone_id', None) + self.target_dns_type = kwargs.get('target_dns_type', None) + self.auth_code = kwargs.get('auth_code', None) + + +class DomainPurchaseConsent(msrest.serialization.Model): + """Domain purchase consent object, representing acceptance of applicable legal agreements. + + :param agreement_keys: List of applicable legal agreement keys. This list can be retrieved + using ListLegalAgreements API under :code:`TopLevelDomain` resource. + :type agreement_keys: list[str] + :param agreed_by: Client IP address. + :type agreed_by: str + :param agreed_at: Timestamp when the agreements were accepted. + :type agreed_at: ~datetime.datetime + """ + + _attribute_map = { + 'agreement_keys': {'key': 'agreementKeys', 'type': '[str]'}, + 'agreed_by': {'key': 'agreedBy', 'type': 'str'}, + 'agreed_at': {'key': 'agreedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainPurchaseConsent, self).__init__(**kwargs) + self.agreement_keys = kwargs.get('agreement_keys', None) + self.agreed_by = kwargs.get('agreed_by', None) + self.agreed_at = kwargs.get('agreed_at', None) + + +class DomainRecommendationSearchParameters(msrest.serialization.Model): + """Domain recommendation search parameters. + + :param keywords: Keywords to be used for generating domain recommendations. + :type keywords: str + :param max_domain_recommendations: Maximum number of recommendations. + :type max_domain_recommendations: int + """ + + _attribute_map = { + 'keywords': {'key': 'keywords', 'type': 'str'}, + 'max_domain_recommendations': {'key': 'maxDomainRecommendations', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainRecommendationSearchParameters, self).__init__(**kwargs) + self.keywords = kwargs.get('keywords', None) + self.max_domain_recommendations = kwargs.get('max_domain_recommendations', None) + + +class EnabledConfig(msrest.serialization.Model): + """Enabled configuration. + + :param enabled: True if configuration is enabled, false if it is disabled and null if + configuration is not set. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(EnabledConfig, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + + +class EndpointDependency(msrest.serialization.Model): + """A domain name that a service is reached at, including details of the current connection status. + + :param domain_name: The domain name of the dependency. + :type domain_name: str + :param endpoint_details: The IP Addresses and Ports used when connecting to DomainName. + :type endpoint_details: list[~azure.mgmt.web.v2020_09_01.models.EndpointDetail] + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'endpoint_details': {'key': 'endpointDetails', 'type': '[EndpointDetail]'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointDependency, self).__init__(**kwargs) + self.domain_name = kwargs.get('domain_name', None) + self.endpoint_details = kwargs.get('endpoint_details', None) + + +class EndpointDetail(msrest.serialization.Model): + """Current TCP connectivity information from the App Service Environment to a single endpoint. + + :param ip_address: An IP Address that Domain Name currently resolves to. + :type ip_address: str + :param port: The port an endpoint is connected to. + :type port: int + :param latency: The time in milliseconds it takes for a TCP connection to be created from the + App Service Environment to this IpAddress at this Port. + :type latency: float + :param is_accessible: Whether it is possible to create a TCP connection from the App Service + Environment to this IpAddress at this Port. + :type is_accessible: bool + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'latency': {'key': 'latency', 'type': 'float'}, + 'is_accessible': {'key': 'isAccessible', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointDetail, self).__init__(**kwargs) + self.ip_address = kwargs.get('ip_address', None) + self.port = kwargs.get('port', None) + self.latency = kwargs.get('latency', None) + self.is_accessible = kwargs.get('is_accessible', None) + + +class ErrorEntity(msrest.serialization.Model): + """Body of the error response returned from the API. + + :param extended_code: Type of error. + :type extended_code: str + :param message_template: Message template. + :type message_template: str + :param parameters: Parameters for the template. + :type parameters: list[str] + :param inner_errors: Inner errors. + :type inner_errors: list[~azure.mgmt.web.v2020_09_01.models.ErrorEntity] + :param code: Basic error code. + :type code: str + :param message: Any details of the error. + :type message: str + """ + + _attribute_map = { + 'extended_code': {'key': 'extendedCode', 'type': 'str'}, + 'message_template': {'key': 'messageTemplate', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '[str]'}, + 'inner_errors': {'key': 'innerErrors', 'type': '[ErrorEntity]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorEntity, self).__init__(**kwargs) + self.extended_code = kwargs.get('extended_code', None) + self.message_template = kwargs.get('message_template', None) + self.parameters = kwargs.get('parameters', None) + self.inner_errors = kwargs.get('inner_errors', None) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class Experiments(msrest.serialization.Model): + """Routing rules in production experiments. + + :param ramp_up_rules: List of ramp-up rules. + :type ramp_up_rules: list[~azure.mgmt.web.v2020_09_01.models.RampUpRule] + """ + + _attribute_map = { + 'ramp_up_rules': {'key': 'rampUpRules', 'type': '[RampUpRule]'}, + } + + def __init__( + self, + **kwargs + ): + super(Experiments, self).__init__(**kwargs) + self.ramp_up_rules = kwargs.get('ramp_up_rules', None) + + +class Facebook(ProxyOnlyResource): + """Facebook. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_09_01.models.AppRegistration + :param graph_api_version: + :type graph_api_version: str + :param login: + :type login: ~azure.mgmt.web.v2020_09_01.models.LoginScopes + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'AppRegistration'}, + 'graph_api_version': {'key': 'properties.graphApiVersion', 'type': 'str'}, + 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + } + + def __init__( + self, + **kwargs + ): + super(Facebook, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.registration = kwargs.get('registration', None) + self.graph_api_version = kwargs.get('graph_api_version', None) + self.login = kwargs.get('login', None) + + +class FileSystemApplicationLogsConfig(msrest.serialization.Model): + """Application logs to file system configuration. + + :param level: Log level. Possible values include: "Off", "Verbose", "Information", "Warning", + "Error". + :type level: str or ~azure.mgmt.web.v2020_09_01.models.LogLevel + """ + + _attribute_map = { + 'level': {'key': 'level', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FileSystemApplicationLogsConfig, self).__init__(**kwargs) + self.level = kwargs.get('level', None) + + +class FileSystemHttpLogsConfig(msrest.serialization.Model): + """Http logs to file system configuration. + + :param retention_in_mb: Maximum size in megabytes that http log files can use. + When reached old log files will be removed to make space for new ones. + Value can range between 25 and 100. + :type retention_in_mb: int + :param retention_in_days: Retention in days. + Remove files older than X days. + 0 or lower means no retention. + :type retention_in_days: int + :param enabled: True if configuration is enabled, false if it is disabled and null if + configuration is not set. + :type enabled: bool + """ + + _validation = { + 'retention_in_mb': {'maximum': 100, 'minimum': 25}, + } + + _attribute_map = { + 'retention_in_mb': {'key': 'retentionInMb', 'type': 'int'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(FileSystemHttpLogsConfig, self).__init__(**kwargs) + self.retention_in_mb = kwargs.get('retention_in_mb', None) + self.retention_in_days = kwargs.get('retention_in_days', None) + self.enabled = kwargs.get('enabled', None) + + +class FileSystemTokenStore(ProxyOnlyResource): + """FileSystemTokenStore. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param directory: + :type directory: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'directory': {'key': 'properties.directory', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FileSystemTokenStore, self).__init__(**kwargs) + self.directory = kwargs.get('directory', None) + + +class ForwardProxy(ProxyOnlyResource): + """ForwardProxy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param convention: Possible values include: "NoProxy", "Standard", "Custom". + :type convention: str or ~azure.mgmt.web.v2020_09_01.models.ForwardProxyConvention + :param custom_host_header_name: + :type custom_host_header_name: str + :param custom_proto_header_name: + :type custom_proto_header_name: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'convention': {'key': 'properties.convention', 'type': 'str'}, + 'custom_host_header_name': {'key': 'properties.customHostHeaderName', 'type': 'str'}, + 'custom_proto_header_name': {'key': 'properties.customProtoHeaderName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ForwardProxy, self).__init__(**kwargs) + self.convention = kwargs.get('convention', None) + self.custom_host_header_name = kwargs.get('custom_host_header_name', None) + self.custom_proto_header_name = kwargs.get('custom_proto_header_name', None) + + +class FunctionEnvelope(ProxyOnlyResource): + """Function information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param function_app_id: Function App ID. + :type function_app_id: str + :param script_root_path_href: Script root path URI. + :type script_root_path_href: str + :param script_href: Script URI. + :type script_href: str + :param config_href: Config URI. + :type config_href: str + :param test_data_href: Test data URI. + :type test_data_href: str + :param secrets_file_href: Secrets file URI. + :type secrets_file_href: str + :param href: Function URI. + :type href: str + :param config: Config information. + :type config: object + :param files: File list. + :type files: dict[str, str] + :param test_data: Test data used when testing via the Azure Portal. + :type test_data: str + :param invoke_url_template: The invocation URL. + :type invoke_url_template: str + :param language: The function language. + :type language: str + :param is_disabled: Gets or sets a value indicating whether the function is disabled. + :type is_disabled: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'function_app_id': {'key': 'properties.function_app_id', 'type': 'str'}, + 'script_root_path_href': {'key': 'properties.script_root_path_href', 'type': 'str'}, + 'script_href': {'key': 'properties.script_href', 'type': 'str'}, + 'config_href': {'key': 'properties.config_href', 'type': 'str'}, + 'test_data_href': {'key': 'properties.test_data_href', 'type': 'str'}, + 'secrets_file_href': {'key': 'properties.secrets_file_href', 'type': 'str'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'config': {'key': 'properties.config', 'type': 'object'}, + 'files': {'key': 'properties.files', 'type': '{str}'}, + 'test_data': {'key': 'properties.test_data', 'type': 'str'}, + 'invoke_url_template': {'key': 'properties.invoke_url_template', 'type': 'str'}, + 'language': {'key': 'properties.language', 'type': 'str'}, + 'is_disabled': {'key': 'properties.isDisabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(FunctionEnvelope, self).__init__(**kwargs) + self.function_app_id = kwargs.get('function_app_id', None) + self.script_root_path_href = kwargs.get('script_root_path_href', None) + self.script_href = kwargs.get('script_href', None) + self.config_href = kwargs.get('config_href', None) + self.test_data_href = kwargs.get('test_data_href', None) + self.secrets_file_href = kwargs.get('secrets_file_href', None) + self.href = kwargs.get('href', None) + self.config = kwargs.get('config', None) + self.files = kwargs.get('files', None) + self.test_data = kwargs.get('test_data', None) + self.invoke_url_template = kwargs.get('invoke_url_template', None) + self.language = kwargs.get('language', None) + self.is_disabled = kwargs.get('is_disabled', None) + + +class FunctionEnvelopeCollection(msrest.serialization.Model): + """Collection of Kudu function information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.FunctionEnvelope] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FunctionEnvelope]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FunctionEnvelopeCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class FunctionSecrets(msrest.serialization.Model): + """Function secrets. + + :param key: Secret key. + :type key: str + :param trigger_url: Trigger URL. + :type trigger_url: str + """ + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'trigger_url': {'key': 'trigger_url', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FunctionSecrets, self).__init__(**kwargs) + self.key = kwargs.get('key', None) + self.trigger_url = kwargs.get('trigger_url', None) + + +class GeoRegion(ProxyOnlyResource): + """Geographical region. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar description: Region description. + :vartype description: str + :ivar display_name: Display name for region. + :vartype display_name: str + :ivar org_domain: Display name for region. + :vartype org_domain: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'description': {'readonly': True}, + 'display_name': {'readonly': True}, + 'org_domain': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'org_domain': {'key': 'properties.orgDomain', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoRegion, self).__init__(**kwargs) + self.description = None + self.display_name = None + self.org_domain = None + + +class GeoRegionCollection(msrest.serialization.Model): + """Collection of geographical regions. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.GeoRegion] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GeoRegion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoRegionCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class GitHub(ProxyOnlyResource): + """GitHub. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_09_01.models.ClientRegistration + :param login: + :type login: ~azure.mgmt.web.v2020_09_01.models.LoginScopes + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + } + + def __init__( + self, + **kwargs + ): + super(GitHub, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.registration = kwargs.get('registration', None) + self.login = kwargs.get('login', None) + + +class GlobalCsmSkuDescription(msrest.serialization.Model): + """A Global SKU Description. + + :param name: Name of the resource SKU. + :type name: str + :param tier: Service Tier of the resource SKU. + :type tier: str + :param size: Size specifier of the resource SKU. + :type size: str + :param family: Family code of the resource SKU. + :type family: str + :param capacity: Min, max, and default scale values of the SKU. + :type capacity: ~azure.mgmt.web.v2020_09_01.models.SkuCapacity + :param locations: Locations of the SKU. + :type locations: list[str] + :param capabilities: Capabilities of the SKU, e.g., is traffic manager enabled?. + :type capabilities: list[~azure.mgmt.web.v2020_09_01.models.Capability] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[Capability]'}, + } + + def __init__( + self, + **kwargs + ): + super(GlobalCsmSkuDescription, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.capacity = kwargs.get('capacity', None) + self.locations = kwargs.get('locations', None) + self.capabilities = kwargs.get('capabilities', None) + + +class GlobalValidation(ProxyOnlyResource): + """GlobalValidation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param require_authentication: + :type require_authentication: bool + :param unauthenticated_client_action: Possible values include: "RedirectToLoginPage", + "AllowAnonymous", "Return401", "Return403". + :type unauthenticated_client_action: str or + ~azure.mgmt.web.v2020_09_01.models.UnauthenticatedClientActionV2 + :param redirect_to_provider: + :type redirect_to_provider: str + :param excluded_paths: + :type excluded_paths: list[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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'require_authentication': {'key': 'properties.requireAuthentication', 'type': 'bool'}, + 'unauthenticated_client_action': {'key': 'properties.unauthenticatedClientAction', 'type': 'str'}, + 'redirect_to_provider': {'key': 'properties.redirectToProvider', 'type': 'str'}, + 'excluded_paths': {'key': 'properties.excludedPaths', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(GlobalValidation, self).__init__(**kwargs) + self.require_authentication = kwargs.get('require_authentication', None) + self.unauthenticated_client_action = kwargs.get('unauthenticated_client_action', None) + self.redirect_to_provider = kwargs.get('redirect_to_provider', None) + self.excluded_paths = kwargs.get('excluded_paths', None) + + +class Google(ProxyOnlyResource): + """Google. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_09_01.models.ClientRegistration + :param login: + :type login: ~azure.mgmt.web.v2020_09_01.models.LoginScopes + :param validation: + :type validation: ~azure.mgmt.web.v2020_09_01.models.AllowedAudiencesValidation + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'validation': {'key': 'properties.validation', 'type': 'AllowedAudiencesValidation'}, + } + + def __init__( + self, + **kwargs + ): + super(Google, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.registration = kwargs.get('registration', None) + self.login = kwargs.get('login', None) + self.validation = kwargs.get('validation', None) + + +class HandlerMapping(msrest.serialization.Model): + """The IIS handler mappings used to define which handler processes HTTP requests with certain extension. +For example, it is used to configure php-cgi.exe process to handle all HTTP requests with *.php extension. + + :param extension: Requests with this extension will be handled using the specified FastCGI + application. + :type extension: str + :param script_processor: The absolute path to the FastCGI application. + :type script_processor: str + :param arguments: Command-line arguments to be passed to the script processor. + :type arguments: str + """ + + _attribute_map = { + 'extension': {'key': 'extension', 'type': 'str'}, + 'script_processor': {'key': 'scriptProcessor', 'type': 'str'}, + 'arguments': {'key': 'arguments', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HandlerMapping, self).__init__(**kwargs) + self.extension = kwargs.get('extension', None) + self.script_processor = kwargs.get('script_processor', None) + self.arguments = kwargs.get('arguments', None) + + +class HostingEnvironmentDeploymentInfo(msrest.serialization.Model): + """Information needed to create resources on an App Service Environment. + + :param name: Name of the App Service Environment. + :type name: str + :param location: Location of the App Service Environment. + :type location: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostingEnvironmentDeploymentInfo, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + + +class HostingEnvironmentDiagnostics(msrest.serialization.Model): + """Diagnostics for an App Service Environment. + + :param name: Name/identifier of the diagnostics. + :type name: str + :param diagnostics_output: Diagnostics output. + :type diagnostics_output: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'diagnostics_output': {'key': 'diagnosticsOutput', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostingEnvironmentDiagnostics, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.diagnostics_output = kwargs.get('diagnostics_output', None) + + +class HostingEnvironmentProfile(msrest.serialization.Model): + """Specification for an App Service Environment to use for this resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID of the App Service Environment. + :type id: str + :ivar name: Name of the App Service Environment. + :vartype name: str + :ivar type: Resource type of the App Service Environment. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostingEnvironmentProfile, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = None + self.type = None + + +class HostKeys(msrest.serialization.Model): + """Functions host level keys. + + :param master_key: Secret key. + :type master_key: str + :param function_keys: Host level function keys. + :type function_keys: dict[str, str] + :param system_keys: System keys. + :type system_keys: dict[str, str] + """ + + _attribute_map = { + 'master_key': {'key': 'masterKey', 'type': 'str'}, + 'function_keys': {'key': 'functionKeys', 'type': '{str}'}, + 'system_keys': {'key': 'systemKeys', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(HostKeys, self).__init__(**kwargs) + self.master_key = kwargs.get('master_key', None) + self.function_keys = kwargs.get('function_keys', None) + self.system_keys = kwargs.get('system_keys', None) + + +class HostName(msrest.serialization.Model): + """Details of a hostname derived from a domain. + + :param name: Name of the hostname. + :type name: str + :param site_names: List of apps the hostname is assigned to. This list will have more than one + app only if the hostname is pointing to a Traffic Manager. + :type site_names: list[str] + :param azure_resource_name: Name of the Azure resource the hostname is assigned to. If it is + assigned to a Traffic Manager then it will be the Traffic Manager name otherwise it will be the + app name. + :type azure_resource_name: str + :param azure_resource_type: Type of the Azure resource the hostname is assigned to. Possible + values include: "Website", "TrafficManager". + :type azure_resource_type: str or ~azure.mgmt.web.v2020_09_01.models.AzureResourceType + :param custom_host_name_dns_record_type: Type of the DNS record. Possible values include: + "CName", "A". + :type custom_host_name_dns_record_type: str or + ~azure.mgmt.web.v2020_09_01.models.CustomHostNameDnsRecordType + :param host_name_type: Type of the hostname. Possible values include: "Verified", "Managed". + :type host_name_type: str or ~azure.mgmt.web.v2020_09_01.models.HostNameType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'site_names': {'key': 'siteNames', 'type': '[str]'}, + 'azure_resource_name': {'key': 'azureResourceName', 'type': 'str'}, + 'azure_resource_type': {'key': 'azureResourceType', 'type': 'str'}, + 'custom_host_name_dns_record_type': {'key': 'customHostNameDnsRecordType', 'type': 'str'}, + 'host_name_type': {'key': 'hostNameType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostName, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.site_names = kwargs.get('site_names', None) + self.azure_resource_name = kwargs.get('azure_resource_name', None) + self.azure_resource_type = kwargs.get('azure_resource_type', None) + self.custom_host_name_dns_record_type = kwargs.get('custom_host_name_dns_record_type', None) + self.host_name_type = kwargs.get('host_name_type', None) + + +class HostNameBinding(ProxyOnlyResource): + """A hostname binding object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param site_name: App Service app name. + :type site_name: str + :param domain_id: Fully qualified ARM domain resource URI. + :type domain_id: str + :param azure_resource_name: Azure resource name. + :type azure_resource_name: str + :param azure_resource_type: Azure resource type. Possible values include: "Website", + "TrafficManager". + :type azure_resource_type: str or ~azure.mgmt.web.v2020_09_01.models.AzureResourceType + :param custom_host_name_dns_record_type: Custom DNS record type. Possible values include: + "CName", "A". + :type custom_host_name_dns_record_type: str or + ~azure.mgmt.web.v2020_09_01.models.CustomHostNameDnsRecordType + :param host_name_type: Hostname type. Possible values include: "Verified", "Managed". + :type host_name_type: str or ~azure.mgmt.web.v2020_09_01.models.HostNameType + :param ssl_state: SSL type. Possible values include: "Disabled", "SniEnabled", + "IpBasedEnabled". + :type ssl_state: str or ~azure.mgmt.web.v2020_09_01.models.SslState + :param thumbprint: SSL certificate thumbprint. + :type thumbprint: str + :ivar virtual_ip: Virtual IP address assigned to the hostname if IP based SSL is enabled. + :vartype virtual_ip: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'virtual_ip': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'domain_id': {'key': 'properties.domainId', 'type': 'str'}, + 'azure_resource_name': {'key': 'properties.azureResourceName', 'type': 'str'}, + 'azure_resource_type': {'key': 'properties.azureResourceType', 'type': 'str'}, + 'custom_host_name_dns_record_type': {'key': 'properties.customHostNameDnsRecordType', 'type': 'str'}, + 'host_name_type': {'key': 'properties.hostNameType', 'type': 'str'}, + 'ssl_state': {'key': 'properties.sslState', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'virtual_ip': {'key': 'properties.virtualIP', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostNameBinding, self).__init__(**kwargs) + self.site_name = kwargs.get('site_name', None) + self.domain_id = kwargs.get('domain_id', None) + self.azure_resource_name = kwargs.get('azure_resource_name', None) + self.azure_resource_type = kwargs.get('azure_resource_type', None) + self.custom_host_name_dns_record_type = kwargs.get('custom_host_name_dns_record_type', None) + self.host_name_type = kwargs.get('host_name_type', None) + self.ssl_state = kwargs.get('ssl_state', None) + self.thumbprint = kwargs.get('thumbprint', None) + self.virtual_ip = None + + +class HostNameBindingCollection(msrest.serialization.Model): + """Collection of hostname bindings. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.HostNameBinding] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HostNameBinding]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostNameBindingCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class HostNameSslState(msrest.serialization.Model): + """SSL-enabled hostname. + + :param name: Hostname. + :type name: str + :param ssl_state: SSL type. Possible values include: "Disabled", "SniEnabled", + "IpBasedEnabled". + :type ssl_state: str or ~azure.mgmt.web.v2020_09_01.models.SslState + :param virtual_ip: Virtual IP address assigned to the hostname if IP based SSL is enabled. + :type virtual_ip: str + :param thumbprint: SSL certificate thumbprint. + :type thumbprint: str + :param to_update: Set to :code:`true` to update existing hostname. + :type to_update: bool + :param host_type: Indicates whether the hostname is a standard or repository hostname. Possible + values include: "Standard", "Repository". + :type host_type: str or ~azure.mgmt.web.v2020_09_01.models.HostType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'ssl_state': {'key': 'sslState', 'type': 'str'}, + 'virtual_ip': {'key': 'virtualIP', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'to_update': {'key': 'toUpdate', 'type': 'bool'}, + 'host_type': {'key': 'hostType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostNameSslState, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.ssl_state = kwargs.get('ssl_state', None) + self.virtual_ip = kwargs.get('virtual_ip', None) + self.thumbprint = kwargs.get('thumbprint', None) + self.to_update = kwargs.get('to_update', None) + self.host_type = kwargs.get('host_type', None) + + +class HttpLogsConfig(msrest.serialization.Model): + """Http logs configuration. + + :param file_system: Http logs to file system configuration. + :type file_system: ~azure.mgmt.web.v2020_09_01.models.FileSystemHttpLogsConfig + :param azure_blob_storage: Http logs to azure blob storage configuration. + :type azure_blob_storage: ~azure.mgmt.web.v2020_09_01.models.AzureBlobStorageHttpLogsConfig + """ + + _attribute_map = { + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemHttpLogsConfig'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'AzureBlobStorageHttpLogsConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(HttpLogsConfig, self).__init__(**kwargs) + self.file_system = kwargs.get('file_system', None) + self.azure_blob_storage = kwargs.get('azure_blob_storage', None) + + +class HttpSettings(ProxyOnlyResource): + """HttpSettings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param require_https: + :type require_https: bool + :param routes: + :type routes: ~azure.mgmt.web.v2020_09_01.models.HttpSettingsRoutes + :param forward_proxy: + :type forward_proxy: ~azure.mgmt.web.v2020_09_01.models.ForwardProxy + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'require_https': {'key': 'properties.requireHttps', 'type': 'bool'}, + 'routes': {'key': 'properties.routes', 'type': 'HttpSettingsRoutes'}, + 'forward_proxy': {'key': 'properties.forwardProxy', 'type': 'ForwardProxy'}, + } + + def __init__( + self, + **kwargs + ): + super(HttpSettings, self).__init__(**kwargs) + self.require_https = kwargs.get('require_https', None) + self.routes = kwargs.get('routes', None) + self.forward_proxy = kwargs.get('forward_proxy', None) + + +class HttpSettingsRoutes(ProxyOnlyResource): + """HttpSettingsRoutes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param api_prefix: + :type api_prefix: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'api_prefix': {'key': 'properties.apiPrefix', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HttpSettingsRoutes, self).__init__(**kwargs) + self.api_prefix = kwargs.get('api_prefix', None) + + +class HybridConnection(ProxyOnlyResource): + """Hybrid Connection contract. This is used to configure a Hybrid Connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param service_bus_namespace: The name of the Service Bus namespace. + :type service_bus_namespace: str + :param relay_name: The name of the Service Bus relay. + :type relay_name: str + :param relay_arm_uri: The ARM URI to the Service Bus relay. + :type relay_arm_uri: str + :param hostname: The hostname of the endpoint. + :type hostname: str + :param port: The port of the endpoint. + :type port: int + :param send_key_name: The name of the Service Bus key which has Send permissions. This is used + to authenticate to Service Bus. + :type send_key_name: str + :param send_key_value: The value of the Service Bus key. This is used to authenticate to + Service Bus. In ARM this key will not be returned + normally, use the POST /listKeys API instead. + :type send_key_value: str + :param service_bus_suffix: The suffix for the service bus endpoint. By default this is + .servicebus.windows.net. + :type service_bus_suffix: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'service_bus_namespace': {'key': 'properties.serviceBusNamespace', 'type': 'str'}, + 'relay_name': {'key': 'properties.relayName', 'type': 'str'}, + 'relay_arm_uri': {'key': 'properties.relayArmUri', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'send_key_name': {'key': 'properties.sendKeyName', 'type': 'str'}, + 'send_key_value': {'key': 'properties.sendKeyValue', 'type': 'str'}, + 'service_bus_suffix': {'key': 'properties.serviceBusSuffix', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridConnection, self).__init__(**kwargs) + self.service_bus_namespace = kwargs.get('service_bus_namespace', None) + self.relay_name = kwargs.get('relay_name', None) + self.relay_arm_uri = kwargs.get('relay_arm_uri', None) + self.hostname = kwargs.get('hostname', None) + self.port = kwargs.get('port', None) + self.send_key_name = kwargs.get('send_key_name', None) + self.send_key_value = kwargs.get('send_key_value', None) + self.service_bus_suffix = kwargs.get('service_bus_suffix', None) + + +class HybridConnectionCollection(msrest.serialization.Model): + """Collection of hostname bindings. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.HybridConnection] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HybridConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridConnectionCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class HybridConnectionKey(ProxyOnlyResource): + """Hybrid Connection key contract. This has the send key name and value for a Hybrid Connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar send_key_name: The name of the send key. + :vartype send_key_name: str + :ivar send_key_value: The value of the send key. + :vartype send_key_value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'send_key_name': {'readonly': True}, + 'send_key_value': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'send_key_name': {'key': 'properties.sendKeyName', 'type': 'str'}, + 'send_key_value': {'key': 'properties.sendKeyValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridConnectionKey, self).__init__(**kwargs) + self.send_key_name = None + self.send_key_value = None + + +class HybridConnectionLimits(ProxyOnlyResource): + """Hybrid Connection limits contract. This is used to return the plan limits of Hybrid Connections. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar current: The current number of Hybrid Connections. + :vartype current: int + :ivar maximum: The maximum number of Hybrid Connections allowed. + :vartype maximum: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'current': {'readonly': True}, + 'maximum': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'current': {'key': 'properties.current', 'type': 'int'}, + 'maximum': {'key': 'properties.maximum', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridConnectionLimits, self).__init__(**kwargs) + self.current = None + self.maximum = None + + +class Identifier(ProxyOnlyResource): + """A domain specific resource identifier. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param value: String representation of the identity. + :type value: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'value': {'key': 'properties.id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Identifier, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class IdentifierCollection(msrest.serialization.Model): + """Collection of identifiers. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.Identifier] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Identifier]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IdentifierCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class IdentityProviders(ProxyOnlyResource): + """IdentityProviders. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param azure_active_directory: + :type azure_active_directory: ~azure.mgmt.web.v2020_09_01.models.AzureActiveDirectory + :param facebook: + :type facebook: ~azure.mgmt.web.v2020_09_01.models.Facebook + :param git_hub: + :type git_hub: ~azure.mgmt.web.v2020_09_01.models.GitHub + :param google: + :type google: ~azure.mgmt.web.v2020_09_01.models.Google + :param twitter: + :type twitter: ~azure.mgmt.web.v2020_09_01.models.Twitter + :param custom_open_id_connect_providers: Dictionary of :code:``. + :type custom_open_id_connect_providers: dict[str, + ~azure.mgmt.web.v2020_09_01.models.CustomOpenIdConnectProvider] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'azure_active_directory': {'key': 'properties.azureActiveDirectory', 'type': 'AzureActiveDirectory'}, + 'facebook': {'key': 'properties.facebook', 'type': 'Facebook'}, + 'git_hub': {'key': 'properties.gitHub', 'type': 'GitHub'}, + 'google': {'key': 'properties.google', 'type': 'Google'}, + 'twitter': {'key': 'properties.twitter', 'type': 'Twitter'}, + 'custom_open_id_connect_providers': {'key': 'properties.customOpenIdConnectProviders', 'type': '{CustomOpenIdConnectProvider}'}, + } + + def __init__( + self, + **kwargs + ): + super(IdentityProviders, self).__init__(**kwargs) + self.azure_active_directory = kwargs.get('azure_active_directory', None) + self.facebook = kwargs.get('facebook', None) + self.git_hub = kwargs.get('git_hub', None) + self.google = kwargs.get('google', None) + self.twitter = kwargs.get('twitter', None) + self.custom_open_id_connect_providers = kwargs.get('custom_open_id_connect_providers', None) + + +class InboundEnvironmentEndpoint(msrest.serialization.Model): + """The IP Addresses and Ports that require inbound network access to and within the subnet of the App Service Environment. + + :param description: Short text describing the purpose of the network traffic. + :type description: str + :param endpoints: The IP addresses that network traffic will originate from in cidr notation. + :type endpoints: list[str] + :param ports: The ports that network traffic will arrive to the App Service Environment at. + :type ports: list[str] + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[str]'}, + 'ports': {'key': 'ports', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(InboundEnvironmentEndpoint, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.endpoints = kwargs.get('endpoints', None) + self.ports = kwargs.get('ports', None) + + +class InboundEnvironmentEndpointCollection(msrest.serialization.Model): + """Collection of Inbound Environment Endpoints. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.InboundEnvironmentEndpoint] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InboundEnvironmentEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(InboundEnvironmentEndpointCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class IpSecurityRestriction(msrest.serialization.Model): + """IP security restriction on an app. + + :param ip_address: IP address the security restriction is valid for. + It can be in form of pure ipv4 address (required SubnetMask property) or + CIDR notation such as ipv4/mask (leading bit match). For CIDR, + SubnetMask property must not be specified. + :type ip_address: str + :param subnet_mask: Subnet mask for the range of IP addresses the restriction is valid for. + :type subnet_mask: str + :param vnet_subnet_resource_id: Virtual network resource id. + :type vnet_subnet_resource_id: str + :param vnet_traffic_tag: (internal) Vnet traffic tag. + :type vnet_traffic_tag: int + :param subnet_traffic_tag: (internal) Subnet traffic tag. + :type subnet_traffic_tag: int + :param action: Allow or Deny access for this IP range. + :type action: str + :param tag: Defines what this IP filter will be used for. This is to support IP filtering on + proxies. Possible values include: "Default", "XffProxy", "ServiceTag". + :type tag: str or ~azure.mgmt.web.v2020_09_01.models.IpFilterTag + :param priority: Priority of IP restriction rule. + :type priority: int + :param name: IP restriction rule name. + :type name: str + :param description: IP restriction rule description. + :type description: str + :param headers: IP restriction rule headers. + X-Forwarded-Host (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded- + Host#Examples). + The matching logic is .. + + + * If the property is null or empty (default), all hosts(or lack of) are allowed. + * A value is compared using ordinal-ignore-case (excluding port number). + * Subdomain wildcards are permitted but don't match the root domain. For example, + *.contoso.com matches the subdomain foo.contoso.com + but not the root domain contoso.com or multi-level foo.bar.contoso.com + * Unicode host names are allowed but are converted to Punycode for matching. + + X-Forwarded-For (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded- + For#Examples). + The matching logic is .. + + + * If the property is null or empty (default), any forwarded-for chains (or lack of) are + allowed. + * If any address (excluding port number) in the chain (comma separated) matches the CIDR + defined by the property. + + X-Azure-FDID and X-FD-HealthProbe. + The matching logic is exact match. + :type headers: dict[str, list[str]] + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet_mask': {'key': 'subnetMask', 'type': 'str'}, + 'vnet_subnet_resource_id': {'key': 'vnetSubnetResourceId', 'type': 'str'}, + 'vnet_traffic_tag': {'key': 'vnetTrafficTag', 'type': 'int'}, + 'subnet_traffic_tag': {'key': 'subnetTrafficTag', 'type': 'int'}, + 'action': {'key': 'action', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '{[str]}'}, + } + + def __init__( + self, + **kwargs + ): + super(IpSecurityRestriction, self).__init__(**kwargs) + self.ip_address = kwargs.get('ip_address', None) + self.subnet_mask = kwargs.get('subnet_mask', None) + self.vnet_subnet_resource_id = kwargs.get('vnet_subnet_resource_id', None) + self.vnet_traffic_tag = kwargs.get('vnet_traffic_tag', None) + self.subnet_traffic_tag = kwargs.get('subnet_traffic_tag', None) + self.action = kwargs.get('action', None) + self.tag = kwargs.get('tag', None) + self.priority = kwargs.get('priority', None) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.headers = kwargs.get('headers', None) + + +class JwtClaimChecks(ProxyOnlyResource): + """JwtClaimChecks. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param allowed_groups: + :type allowed_groups: list[str] + :param allowed_client_applications: + :type allowed_client_applications: list[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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'allowed_groups': {'key': 'properties.allowedGroups', 'type': '[str]'}, + 'allowed_client_applications': {'key': 'properties.allowedClientApplications', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(JwtClaimChecks, self).__init__(**kwargs) + self.allowed_groups = kwargs.get('allowed_groups', None) + self.allowed_client_applications = kwargs.get('allowed_client_applications', None) + + +class KeyInfo(msrest.serialization.Model): + """Function key info. + + :param name: Key name. + :type name: str + :param value: Key value. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyInfo, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class LocalizableString(msrest.serialization.Model): + """Localizable string object containing the name and a localized value. + + :param value: Non-localized name. + :type value: str + :param localized_value: Localized name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LocalizableString, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) + + +class Login(ProxyOnlyResource): + """Login. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param routes: + :type routes: ~azure.mgmt.web.v2020_09_01.models.LoginRoutes + :param token_store: + :type token_store: ~azure.mgmt.web.v2020_09_01.models.TokenStore + :param preserve_url_fragments_for_logins: + :type preserve_url_fragments_for_logins: bool + :param allowed_external_redirect_urls: + :type allowed_external_redirect_urls: list[str] + :param cookie_expiration: + :type cookie_expiration: ~azure.mgmt.web.v2020_09_01.models.CookieExpiration + :param nonce: + :type nonce: ~azure.mgmt.web.v2020_09_01.models.Nonce + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'routes': {'key': 'properties.routes', 'type': 'LoginRoutes'}, + 'token_store': {'key': 'properties.tokenStore', 'type': 'TokenStore'}, + 'preserve_url_fragments_for_logins': {'key': 'properties.preserveUrlFragmentsForLogins', 'type': 'bool'}, + 'allowed_external_redirect_urls': {'key': 'properties.allowedExternalRedirectUrls', 'type': '[str]'}, + 'cookie_expiration': {'key': 'properties.cookieExpiration', 'type': 'CookieExpiration'}, + 'nonce': {'key': 'properties.nonce', 'type': 'Nonce'}, + } + + def __init__( + self, + **kwargs + ): + super(Login, self).__init__(**kwargs) + self.routes = kwargs.get('routes', None) + self.token_store = kwargs.get('token_store', None) + self.preserve_url_fragments_for_logins = kwargs.get('preserve_url_fragments_for_logins', None) + self.allowed_external_redirect_urls = kwargs.get('allowed_external_redirect_urls', None) + self.cookie_expiration = kwargs.get('cookie_expiration', None) + self.nonce = kwargs.get('nonce', None) + + +class LoginRoutes(ProxyOnlyResource): + """LoginRoutes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param logout_endpoint: + :type logout_endpoint: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'logout_endpoint': {'key': 'properties.logoutEndpoint', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoginRoutes, self).__init__(**kwargs) + self.logout_endpoint = kwargs.get('logout_endpoint', None) + + +class LoginScopes(ProxyOnlyResource): + """LoginScopes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param scopes: + :type scopes: list[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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(LoginScopes, self).__init__(**kwargs) + self.scopes = kwargs.get('scopes', None) + + +class LogSpecification(msrest.serialization.Model): + """Log Definition of a single resource metric. + + :param name: + :type name: str + :param display_name: + :type display_name: str + :param blob_duration: + :type blob_duration: str + :param log_filter_pattern: + :type log_filter_pattern: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + 'log_filter_pattern': {'key': 'logFilterPattern', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LogSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.blob_duration = kwargs.get('blob_duration', None) + self.log_filter_pattern = kwargs.get('log_filter_pattern', None) + + +class ManagedServiceIdentity(msrest.serialization.Model): + """Managed service identity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Type of managed service identity. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type: str or ~azure.mgmt.web.v2020_09_01.models.ManagedServiceIdentityType + :ivar tenant_id: Tenant of managed service identity. + :vartype tenant_id: str + :ivar principal_id: Principal Id of managed service identity. + :vartype principal_id: str + :param user_assigned_identities: The list of user assigned identities associated with the + resource. The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + :type user_assigned_identities: dict[str, + ~azure.mgmt.web.v2020_09_01.models.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties] + """ + + _validation = { + 'tenant_id': {'readonly': True}, + 'principal_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedServiceIdentity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.tenant_id = None + self.principal_id = None + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class MetricAvailability(msrest.serialization.Model): + """Retention policy of a resource metric. + + :param time_grain: + :type time_grain: str + :param blob_duration: + :type blob_duration: str + """ + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricAvailability, self).__init__(**kwargs) + self.time_grain = kwargs.get('time_grain', None) + self.blob_duration = kwargs.get('blob_duration', None) + + +class MetricSpecification(msrest.serialization.Model): + """Definition of a single resource metric. + + :param name: + :type name: str + :param display_name: + :type display_name: str + :param display_description: + :type display_description: str + :param unit: + :type unit: str + :param aggregation_type: + :type aggregation_type: str + :param supports_instance_level_aggregation: + :type supports_instance_level_aggregation: bool + :param enable_regional_mdm_account: + :type enable_regional_mdm_account: bool + :param source_mdm_account: + :type source_mdm_account: str + :param source_mdm_namespace: + :type source_mdm_namespace: str + :param metric_filter_pattern: + :type metric_filter_pattern: str + :param fill_gap_with_zero: + :type fill_gap_with_zero: bool + :param is_internal: + :type is_internal: bool + :param dimensions: + :type dimensions: list[~azure.mgmt.web.v2020_09_01.models.Dimension] + :param category: + :type category: str + :param availabilities: + :type availabilities: list[~azure.mgmt.web.v2020_09_01.models.MetricAvailability] + :param supported_time_grain_types: + :type supported_time_grain_types: list[str] + :param supported_aggregation_types: + :type supported_aggregation_types: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'supports_instance_level_aggregation': {'key': 'supportsInstanceLevelAggregation', 'type': 'bool'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'bool'}, + 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'metric_filter_pattern': {'key': 'metricFilterPattern', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'is_internal': {'key': 'isInternal', 'type': 'bool'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'category': {'key': 'category', 'type': 'str'}, + 'availabilities': {'key': 'availabilities', 'type': '[MetricAvailability]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.supports_instance_level_aggregation = kwargs.get('supports_instance_level_aggregation', None) + self.enable_regional_mdm_account = kwargs.get('enable_regional_mdm_account', None) + self.source_mdm_account = kwargs.get('source_mdm_account', None) + self.source_mdm_namespace = kwargs.get('source_mdm_namespace', None) + self.metric_filter_pattern = kwargs.get('metric_filter_pattern', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.is_internal = kwargs.get('is_internal', None) + self.dimensions = kwargs.get('dimensions', None) + self.category = kwargs.get('category', None) + self.availabilities = kwargs.get('availabilities', None) + self.supported_time_grain_types = kwargs.get('supported_time_grain_types', None) + self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) + + +class MigrateMySqlRequest(ProxyOnlyResource): + """MySQL migration request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param connection_string: Connection string to the remote MySQL database. + :type connection_string: str + :param migration_type: The type of migration operation to be done. Possible values include: + "LocalToRemote", "RemoteToLocal". + :type migration_type: str or ~azure.mgmt.web.v2020_09_01.models.MySqlMigrationType + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'migration_type': {'key': 'properties.migrationType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MigrateMySqlRequest, self).__init__(**kwargs) + self.connection_string = kwargs.get('connection_string', None) + self.migration_type = kwargs.get('migration_type', None) + + +class MigrateMySqlStatus(ProxyOnlyResource): + """MySQL migration status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar migration_operation_status: Status of the migration task. Possible values include: + "InProgress", "Failed", "Succeeded", "TimedOut", "Created". + :vartype migration_operation_status: str or ~azure.mgmt.web.v2020_09_01.models.OperationStatus + :ivar operation_id: Operation ID for the migration task. + :vartype operation_id: str + :ivar local_my_sql_enabled: True if the web app has in app MySql enabled. + :vartype local_my_sql_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'migration_operation_status': {'readonly': True}, + 'operation_id': {'readonly': True}, + 'local_my_sql_enabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'migration_operation_status': {'key': 'properties.migrationOperationStatus', 'type': 'str'}, + 'operation_id': {'key': 'properties.operationId', 'type': 'str'}, + 'local_my_sql_enabled': {'key': 'properties.localMySqlEnabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(MigrateMySqlStatus, self).__init__(**kwargs) + self.migration_operation_status = None + self.operation_id = None + self.local_my_sql_enabled = None + + +class MSDeploy(ProxyOnlyResource): + """MSDeploy ARM PUT information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param package_uri: Package URI. + :type package_uri: str + :param connection_string: SQL Connection String. + :type connection_string: str + :param db_type: Database Type. + :type db_type: str + :param set_parameters_xml_file_uri: URI of MSDeploy Parameters file. Must not be set if + SetParameters is used. + :type set_parameters_xml_file_uri: str + :param set_parameters: MSDeploy Parameters. Must not be set if SetParametersXmlFileUri is used. + :type set_parameters: dict[str, str] + :param skip_app_data: Controls whether the MSDeploy operation skips the App_Data directory. + If set to :code:`true`, the existing App_Data directory on the destination + will not be deleted, and any App_Data directory in the source will be ignored. + Setting is :code:`false` by default. + :type skip_app_data: bool + :param app_offline: Sets the AppOffline rule while the MSDeploy operation executes. + Setting is :code:`false` by default. + :type app_offline: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'package_uri': {'key': 'properties.packageUri', 'type': 'str'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'db_type': {'key': 'properties.dbType', 'type': 'str'}, + 'set_parameters_xml_file_uri': {'key': 'properties.setParametersXmlFileUri', 'type': 'str'}, + 'set_parameters': {'key': 'properties.setParameters', 'type': '{str}'}, + 'skip_app_data': {'key': 'properties.skipAppData', 'type': 'bool'}, + 'app_offline': {'key': 'properties.appOffline', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(MSDeploy, self).__init__(**kwargs) + self.package_uri = kwargs.get('package_uri', None) + self.connection_string = kwargs.get('connection_string', None) + self.db_type = kwargs.get('db_type', None) + self.set_parameters_xml_file_uri = kwargs.get('set_parameters_xml_file_uri', None) + self.set_parameters = kwargs.get('set_parameters', None) + self.skip_app_data = kwargs.get('skip_app_data', None) + self.app_offline = kwargs.get('app_offline', None) + + +class MSDeployLog(ProxyOnlyResource): + """MSDeploy log. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar entries: List of log entry messages. + :vartype entries: list[~azure.mgmt.web.v2020_09_01.models.MSDeployLogEntry] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'entries': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'entries': {'key': 'properties.entries', 'type': '[MSDeployLogEntry]'}, + } + + def __init__( + self, + **kwargs + ): + super(MSDeployLog, self).__init__(**kwargs) + self.entries = None + + +class MSDeployLogEntry(msrest.serialization.Model): + """MSDeploy log entry. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar time: Timestamp of log entry. + :vartype time: ~datetime.datetime + :ivar type: Log entry type. Possible values include: "Message", "Warning", "Error". + :vartype type: str or ~azure.mgmt.web.v2020_09_01.models.MSDeployLogEntryType + :ivar message: Log entry message. + :vartype message: str + """ + + _validation = { + 'time': {'readonly': True}, + 'type': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MSDeployLogEntry, self).__init__(**kwargs) + self.time = None + self.type = None + self.message = None + + +class MSDeployStatus(ProxyOnlyResource): + """MSDeploy ARM response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar deployer: Username of deployer. + :vartype deployer: str + :ivar provisioning_state: Provisioning state. Possible values include: "accepted", "running", + "succeeded", "failed", "canceled". + :vartype provisioning_state: str or + ~azure.mgmt.web.v2020_09_01.models.MSDeployProvisioningState + :ivar start_time: Start time of deploy operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: End time of deploy operation. + :vartype end_time: ~datetime.datetime + :ivar complete: Whether the deployment operation has completed. + :vartype complete: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'deployer': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'complete': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'deployer': {'key': 'properties.deployer', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'complete': {'key': 'properties.complete', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(MSDeployStatus, self).__init__(**kwargs) + self.deployer = None + self.provisioning_state = None + self.start_time = None + self.end_time = None + self.complete = None + + +class NameIdentifier(msrest.serialization.Model): + """Identifies an object. + + :param name: Name of the object. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NameIdentifier, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class NameIdentifierCollection(msrest.serialization.Model): + """Collection of domain name identifiers. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.NameIdentifier] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NameIdentifier]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NameIdentifierCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class NameValuePair(msrest.serialization.Model): + """Name value pair. + + :param name: Pair name. + :type name: str + :param value: Pair value. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NameValuePair, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class NetworkAccessControlEntry(msrest.serialization.Model): + """Network access control entry. + + :param action: Action object. Possible values include: "Permit", "Deny". + :type action: str or ~azure.mgmt.web.v2020_09_01.models.AccessControlEntryAction + :param description: Description of network access control entry. + :type description: str + :param order: Order of precedence. + :type order: int + :param remote_subnet: Remote subnet. + :type remote_subnet: str + """ + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'int'}, + 'remote_subnet': {'key': 'remoteSubnet', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkAccessControlEntry, self).__init__(**kwargs) + self.action = kwargs.get('action', None) + self.description = kwargs.get('description', None) + self.order = kwargs.get('order', None) + self.remote_subnet = kwargs.get('remote_subnet', None) + + +class NetworkFeatures(ProxyOnlyResource): + """Full view of network features for an app (presently VNET integration and Hybrid Connections). + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar virtual_network_name: The Virtual Network name. + :vartype virtual_network_name: str + :ivar virtual_network_connection: The Virtual Network summary view. + :vartype virtual_network_connection: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :ivar hybrid_connections: The Hybrid Connections summary view. + :vartype hybrid_connections: + list[~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity] + :ivar hybrid_connections_v2: The Hybrid Connection V2 (Service Bus) view. + :vartype hybrid_connections_v2: list[~azure.mgmt.web.v2020_09_01.models.HybridConnection] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'virtual_network_name': {'readonly': True}, + 'virtual_network_connection': {'readonly': True}, + 'hybrid_connections': {'readonly': True}, + 'hybrid_connections_v2': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'virtual_network_name': {'key': 'properties.virtualNetworkName', 'type': 'str'}, + 'virtual_network_connection': {'key': 'properties.virtualNetworkConnection', 'type': 'VnetInfo'}, + 'hybrid_connections': {'key': 'properties.hybridConnections', 'type': '[RelayServiceConnectionEntity]'}, + 'hybrid_connections_v2': {'key': 'properties.hybridConnectionsV2', 'type': '[HybridConnection]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkFeatures, self).__init__(**kwargs) + self.virtual_network_name = None + self.virtual_network_connection = None + self.hybrid_connections = None + self.hybrid_connections_v2 = None + + +class NetworkTrace(msrest.serialization.Model): + """Network trace. + + :param path: Local file path for the captured network trace file. + :type path: str + :param status: Current status of the network trace operation, same as Operation.Status + (InProgress/Succeeded/Failed). + :type status: str + :param message: Detailed message of a network trace operation, e.g. error message in case of + failure. + :type message: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkTrace, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.status = kwargs.get('status', None) + self.message = kwargs.get('message', None) + + +class Nonce(ProxyOnlyResource): + """Nonce. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param validate_nonce: + :type validate_nonce: bool + :param nonce_expiration_interval: + :type nonce_expiration_interval: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'validate_nonce': {'key': 'properties.validateNonce', 'type': 'bool'}, + 'nonce_expiration_interval': {'key': 'properties.nonceExpirationInterval', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Nonce, self).__init__(**kwargs) + self.validate_nonce = kwargs.get('validate_nonce', None) + self.nonce_expiration_interval = kwargs.get('nonce_expiration_interval', None) + + +class OpenIdConnectClientCredential(ProxyOnlyResource): + """OpenIdConnectClientCredential. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar method: Default value: "ClientSecretPost". + :vartype method: str + :param client_secret_setting_name: + :type client_secret_setting_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'method': {'constant': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'method': {'key': 'properties.method', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + } + + method = "ClientSecretPost" + + def __init__( + self, + **kwargs + ): + super(OpenIdConnectClientCredential, self).__init__(**kwargs) + self.client_secret_setting_name = kwargs.get('client_secret_setting_name', None) + + +class OpenIdConnectConfig(ProxyOnlyResource): + """OpenIdConnectConfig. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param authorization_endpoint: + :type authorization_endpoint: str + :param token_endpoint: + :type token_endpoint: str + :param issuer: + :type issuer: str + :param certification_uri: + :type certification_uri: str + :param well_known_open_id_configuration: + :type well_known_open_id_configuration: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'authorization_endpoint': {'key': 'properties.authorizationEndpoint', 'type': 'str'}, + 'token_endpoint': {'key': 'properties.tokenEndpoint', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'certification_uri': {'key': 'properties.certificationUri', 'type': 'str'}, + 'well_known_open_id_configuration': {'key': 'properties.wellKnownOpenIdConfiguration', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OpenIdConnectConfig, self).__init__(**kwargs) + self.authorization_endpoint = kwargs.get('authorization_endpoint', None) + self.token_endpoint = kwargs.get('token_endpoint', None) + self.issuer = kwargs.get('issuer', None) + self.certification_uri = kwargs.get('certification_uri', None) + self.well_known_open_id_configuration = kwargs.get('well_known_open_id_configuration', None) + + +class OpenIdConnectLogin(ProxyOnlyResource): + """OpenIdConnectLogin. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param name_claim_type: + :type name_claim_type: str + :param scopes: + :type scopes: list[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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'name_claim_type': {'key': 'properties.nameClaimType', 'type': 'str'}, + 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(OpenIdConnectLogin, self).__init__(**kwargs) + self.name_claim_type = kwargs.get('name_claim_type', None) + self.scopes = kwargs.get('scopes', None) + + +class OpenIdConnectRegistration(ProxyOnlyResource): + """OpenIdConnectRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param client_id: + :type client_id: str + :param client_credential: + :type client_credential: ~azure.mgmt.web.v2020_09_01.models.OpenIdConnectClientCredential + :param open_id_connect_configuration: + :type open_id_connect_configuration: ~azure.mgmt.web.v2020_09_01.models.OpenIdConnectConfig + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_credential': {'key': 'properties.clientCredential', 'type': 'OpenIdConnectClientCredential'}, + 'open_id_connect_configuration': {'key': 'properties.openIdConnectConfiguration', 'type': 'OpenIdConnectConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(OpenIdConnectRegistration, self).__init__(**kwargs) + self.client_id = kwargs.get('client_id', None) + self.client_credential = kwargs.get('client_credential', None) + self.open_id_connect_configuration = kwargs.get('open_id_connect_configuration', None) + + +class Operation(msrest.serialization.Model): + """An operation on a resource. + + :param id: Operation ID. + :type id: str + :param name: Operation name. + :type name: str + :param status: The current status of the operation. Possible values include: "InProgress", + "Failed", "Succeeded", "TimedOut", "Created". + :type status: str or ~azure.mgmt.web.v2020_09_01.models.OperationStatus + :param errors: Any errors associate with the operation. + :type errors: list[~azure.mgmt.web.v2020_09_01.models.ErrorEntity] + :param created_time: Time when operation has started. + :type created_time: ~datetime.datetime + :param modified_time: Time when operation has been updated. + :type modified_time: ~datetime.datetime + :param expiration_time: Time when operation will expire. + :type expiration_time: ~datetime.datetime + :param geo_master_operation_id: Applicable only for stamp operation ids. + :type geo_master_operation_id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[ErrorEntity]'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'modified_time': {'key': 'modifiedTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'expirationTime', 'type': 'iso-8601'}, + 'geo_master_operation_id': {'key': 'geoMasterOperationId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.status = kwargs.get('status', None) + self.errors = kwargs.get('errors', None) + self.created_time = kwargs.get('created_time', None) + self.modified_time = kwargs.get('modified_time', None) + self.expiration_time = kwargs.get('expiration_time', None) + self.geo_master_operation_id = kwargs.get('geo_master_operation_id', None) + + +class OutboundEnvironmentEndpoint(msrest.serialization.Model): + """Endpoints accessed for a common purpose that the App Service Environment requires outbound network access to. + + :param category: The type of service accessed by the App Service Environment, e.g., Azure + Storage, Azure SQL Database, and Azure Active Directory. + :type category: str + :param endpoints: The endpoints that the App Service Environment reaches the service at. + :type endpoints: list[~azure.mgmt.web.v2020_09_01.models.EndpointDependency] + """ + + _attribute_map = { + 'category': {'key': 'category', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[EndpointDependency]'}, + } + + def __init__( + self, + **kwargs + ): + super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) + self.category = kwargs.get('category', None) + self.endpoints = kwargs.get('endpoints', None) + + +class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): + """Collection of Outbound Environment Endpoints. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.OutboundEnvironmentEndpoint] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OutboundEnvironmentEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class PerfMonCounterCollection(msrest.serialization.Model): + """Collection of performance monitor counters. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.PerfMonResponse] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PerfMonResponse]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PerfMonCounterCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class PerfMonResponse(msrest.serialization.Model): + """Performance monitor API response. + + :param code: The response code. + :type code: str + :param message: The message. + :type message: str + :param data: The performance monitor counters. + :type data: ~azure.mgmt.web.v2020_09_01.models.PerfMonSet + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'PerfMonSet'}, + } + + def __init__( + self, + **kwargs + ): + super(PerfMonResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.data = kwargs.get('data', None) + + +class PerfMonSample(msrest.serialization.Model): + """Performance monitor sample in a set. + + :param time: Point in time for which counter was measured. + :type time: ~datetime.datetime + :param instance_name: Name of the server on which the measurement is made. + :type instance_name: str + :param value: Value of counter at a certain time. + :type value: float + """ + + _attribute_map = { + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'instance_name': {'key': 'instanceName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(PerfMonSample, self).__init__(**kwargs) + self.time = kwargs.get('time', None) + self.instance_name = kwargs.get('instance_name', None) + self.value = kwargs.get('value', None) + + +class PerfMonSet(msrest.serialization.Model): + """Metric information. + + :param name: Unique key name of the counter. + :type name: str + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param time_grain: Presented time grain. + :type time_grain: str + :param values: Collection of workers that are active during this time. + :type values: list[~azure.mgmt.web.v2020_09_01.models.PerfMonSample] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[PerfMonSample]'}, + } + + def __init__( + self, + **kwargs + ): + super(PerfMonSet, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.time_grain = kwargs.get('time_grain', None) + self.values = kwargs.get('values', None) + + +class PremierAddOn(Resource): + """Premier add-on. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param sku: Premier add on SKU. + :type sku: str + :param product: Premier add on Product. + :type product: str + :param vendor: Premier add on Vendor. + :type vendor: str + :param marketplace_publisher: Premier add on Marketplace publisher. + :type marketplace_publisher: str + :param marketplace_offer: Premier add on Marketplace offer. + :type marketplace_offer: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'marketplace_publisher': {'key': 'properties.marketplacePublisher', 'type': 'str'}, + 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PremierAddOn, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.product = kwargs.get('product', None) + self.vendor = kwargs.get('vendor', None) + self.marketplace_publisher = kwargs.get('marketplace_publisher', None) + self.marketplace_offer = kwargs.get('marketplace_offer', None) + + +class PremierAddOnOffer(ProxyOnlyResource): + """Premier add-on offer. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param sku: Premier add on SKU. + :type sku: str + :param product: Premier add on offer Product. + :type product: str + :param vendor: Premier add on offer Vendor. + :type vendor: str + :param promo_code_required: :code:`true` if promotion code is required; otherwise, + :code:`false`. + :type promo_code_required: bool + :param quota: Premier add on offer Quota. + :type quota: int + :param web_hosting_plan_restrictions: App Service plans this offer is restricted to. Possible + values include: "None", "Free", "Shared", "Basic", "Standard", "Premium". + :type web_hosting_plan_restrictions: str or + ~azure.mgmt.web.v2020_09_01.models.AppServicePlanRestrictions + :param privacy_policy_url: Privacy policy URL. + :type privacy_policy_url: str + :param legal_terms_url: Legal terms URL. + :type legal_terms_url: str + :param marketplace_publisher: Marketplace publisher. + :type marketplace_publisher: str + :param marketplace_offer: Marketplace offer. + :type marketplace_offer: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'promo_code_required': {'key': 'properties.promoCodeRequired', 'type': 'bool'}, + 'quota': {'key': 'properties.quota', 'type': 'int'}, + 'web_hosting_plan_restrictions': {'key': 'properties.webHostingPlanRestrictions', 'type': 'str'}, + 'privacy_policy_url': {'key': 'properties.privacyPolicyUrl', 'type': 'str'}, + 'legal_terms_url': {'key': 'properties.legalTermsUrl', 'type': 'str'}, + 'marketplace_publisher': {'key': 'properties.marketplacePublisher', 'type': 'str'}, + 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PremierAddOnOffer, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.product = kwargs.get('product', None) + self.vendor = kwargs.get('vendor', None) + self.promo_code_required = kwargs.get('promo_code_required', None) + self.quota = kwargs.get('quota', None) + self.web_hosting_plan_restrictions = kwargs.get('web_hosting_plan_restrictions', None) + self.privacy_policy_url = kwargs.get('privacy_policy_url', None) + self.legal_terms_url = kwargs.get('legal_terms_url', None) + self.marketplace_publisher = kwargs.get('marketplace_publisher', None) + self.marketplace_offer = kwargs.get('marketplace_offer', None) + + +class PremierAddOnOfferCollection(msrest.serialization.Model): + """Collection of premier add-on offers. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.PremierAddOnOffer] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PremierAddOnOffer]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PremierAddOnOfferCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class PremierAddOnPatchResource(ProxyOnlyResource): + """ARM resource for a PremierAddOn. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param sku: Premier add on SKU. + :type sku: str + :param product: Premier add on Product. + :type product: str + :param vendor: Premier add on Vendor. + :type vendor: str + :param marketplace_publisher: Premier add on Marketplace publisher. + :type marketplace_publisher: str + :param marketplace_offer: Premier add on Marketplace offer. + :type marketplace_offer: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'marketplace_publisher': {'key': 'properties.marketplacePublisher', 'type': 'str'}, + 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PremierAddOnPatchResource, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.product = kwargs.get('product', None) + self.vendor = kwargs.get('vendor', None) + self.marketplace_publisher = kwargs.get('marketplace_publisher', None) + self.marketplace_offer = kwargs.get('marketplace_offer', None) + + +class PrivateAccess(ProxyOnlyResource): + """Description of the parameters of Private Access for a Web Site. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param enabled: Whether private access is enabled or not. + :type enabled: bool + :param virtual_networks: The Virtual Networks (and subnets) allowed to access the site + privately. + :type virtual_networks: list[~azure.mgmt.web.v2020_09_01.models.PrivateAccessVirtualNetwork] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'virtual_networks': {'key': 'properties.virtualNetworks', 'type': '[PrivateAccessVirtualNetwork]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateAccess, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.virtual_networks = kwargs.get('virtual_networks', None) + + +class PrivateAccessSubnet(msrest.serialization.Model): + """Description of a Virtual Network subnet that is useable for private site access. + + :param name: The name of the subnet. + :type name: str + :param key: The key (ID) of the subnet. + :type key: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateAccessSubnet, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.key = kwargs.get('key', None) + + +class PrivateAccessVirtualNetwork(msrest.serialization.Model): + """Description of a Virtual Network that is useable for private site access. + + :param name: The name of the Virtual Network. + :type name: str + :param key: The key (ID) of the Virtual Network. + :type key: int + :param resource_id: The ARM uri of the Virtual Network. + :type resource_id: str + :param subnets: A List of subnets that access is allowed to on this Virtual Network. An empty + array (but not null) is interpreted to mean that all subnets are allowed within this Virtual + Network. + :type subnets: list[~azure.mgmt.web.v2020_09_01.models.PrivateAccessSubnet] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'int'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'subnets': {'key': 'subnets', 'type': '[PrivateAccessSubnet]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateAccessVirtualNetwork, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.key = kwargs.get('key', None) + self.resource_id = kwargs.get('resource_id', None) + self.subnets = kwargs.get('subnets', None) + + +class PrivateEndpointConnectionResource(ProxyOnlyResource): + """Private Endpoint Connection ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar provisioning_state: + :vartype provisioning_state: str + :param private_endpoint: PrivateEndpoint of a remote private endpoint connection. + :type private_endpoint: ~azure.mgmt.web.v2020_09_01.models.ArmIdWrapper + :param private_link_service_connection_state: The state of a private link connection. + :type private_link_service_connection_state: + ~azure.mgmt.web.v2020_09_01.models.PrivateLinkConnectionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'ArmIdWrapper'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkConnectionState'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionResource, self).__init__(**kwargs) + self.provisioning_state = None + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + + +class PrivateLinkConnectionApprovalRequestResource(ProxyOnlyResource): + """Private Endpoint Connection Approval ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param private_link_service_connection_state: The state of a private link connection. + :type private_link_service_connection_state: + ~azure.mgmt.web.v2020_09_01.models.PrivateLinkConnectionState + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkConnectionState'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkConnectionApprovalRequestResource, self).__init__(**kwargs) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + + +class PrivateLinkConnectionState(msrest.serialization.Model): + """The state of a private link connection. + + :param status: Status of a private link connection. + :type status: str + :param description: Description of a private link connection. + :type description: str + :param actions_required: ActionsRequired for a private link connection. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = kwargs.get('actions_required', None) + + +class PrivateLinkResource(msrest.serialization.Model): + """A private link resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. + :type id: str + :param name: Required. Name of a private link resource. + :type name: str + :param type: Required. + :type type: str + :param properties: Required. Properties of a private link resource. + :type properties: ~azure.mgmt.web.v2020_09_01.models.PrivateLinkResourceProperties + """ + + _validation = { + 'id': {'required': True}, + 'name': {'required': True}, + 'type': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateLinkResourceProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.id = kwargs['id'] + self.name = kwargs['name'] + self.type = kwargs['type'] + self.properties = kwargs['properties'] + + +class PrivateLinkResourceProperties(msrest.serialization.Model): + """Properties of a private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar group_id: GroupId of a private link resource. + :vartype group_id: str + :ivar required_members: RequiredMembers of a private link resource. + :vartype required_members: list[str] + :ivar required_zone_names: RequiredZoneNames of a private link resource. + :vartype required_zone_names: list[str] + """ + + _validation = { + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + 'required_zone_names': {'readonly': True}, + } + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourceProperties, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = None + + +class PrivateLinkResourcesWrapper(msrest.serialization.Model): + """Wrapper for a collection of private link resources. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. + :type value: list[~azure.mgmt.web.v2020_09_01.models.PrivateLinkResource] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourcesWrapper, self).__init__(**kwargs) + self.value = kwargs['value'] + + +class ProcessInfo(ProxyOnlyResource): + """Process Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar identifier: ARM Identifier for deployment. + :vartype identifier: int + :param deployment_name: Deployment name. + :type deployment_name: str + :param href: HRef URI. + :type href: str + :param minidump: Minidump URI. + :type minidump: str + :param is_profile_running: Is profile running?. + :type is_profile_running: bool + :param is_iis_profile_running: Is the IIS Profile running?. + :type is_iis_profile_running: bool + :param iis_profile_timeout_in_seconds: IIS Profile timeout (seconds). + :type iis_profile_timeout_in_seconds: float + :param parent: Parent process. + :type parent: str + :param children: Child process list. + :type children: list[str] + :param threads: Thread list. + :type threads: list[~azure.mgmt.web.v2020_09_01.models.ProcessThreadInfo] + :param open_file_handles: List of open files. + :type open_file_handles: list[str] + :param modules: List of modules. + :type modules: list[~azure.mgmt.web.v2020_09_01.models.ProcessModuleInfo] + :param file_name: File name of this process. + :type file_name: str + :param command_line: Command line. + :type command_line: str + :param user_name: User name. + :type user_name: str + :param handle_count: Handle count. + :type handle_count: int + :param module_count: Module count. + :type module_count: int + :param thread_count: Thread count. + :type thread_count: int + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param total_cpu_time: Total CPU time. + :type total_cpu_time: str + :param user_cpu_time: User CPU time. + :type user_cpu_time: str + :param privileged_cpu_time: Privileged CPU time. + :type privileged_cpu_time: str + :param working_set: Working set. + :type working_set: long + :param peak_working_set: Peak working set. + :type peak_working_set: long + :param private_memory: Private memory size. + :type private_memory: long + :param virtual_memory: Virtual memory size. + :type virtual_memory: long + :param peak_virtual_memory: Peak virtual memory usage. + :type peak_virtual_memory: long + :param paged_system_memory: Paged system memory. + :type paged_system_memory: long + :param non_paged_system_memory: Non-paged system memory. + :type non_paged_system_memory: long + :param paged_memory: Paged memory. + :type paged_memory: long + :param peak_paged_memory: Peak paged memory. + :type peak_paged_memory: long + :param time_stamp: Time stamp. + :type time_stamp: ~datetime.datetime + :param environment_variables: List of environment variables. + :type environment_variables: dict[str, str] + :param is_scm_site: Is this the SCM site?. + :type is_scm_site: bool + :param is_webjob: Is this a Web Job?. + :type is_webjob: bool + :param description: Description of process. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'identifier': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'identifier': {'key': 'properties.identifier', 'type': 'int'}, + 'deployment_name': {'key': 'properties.deployment_name', 'type': 'str'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'minidump': {'key': 'properties.minidump', 'type': 'str'}, + 'is_profile_running': {'key': 'properties.is_profile_running', 'type': 'bool'}, + 'is_iis_profile_running': {'key': 'properties.is_iis_profile_running', 'type': 'bool'}, + 'iis_profile_timeout_in_seconds': {'key': 'properties.iis_profile_timeout_in_seconds', 'type': 'float'}, + 'parent': {'key': 'properties.parent', 'type': 'str'}, + 'children': {'key': 'properties.children', 'type': '[str]'}, + 'threads': {'key': 'properties.threads', 'type': '[ProcessThreadInfo]'}, + 'open_file_handles': {'key': 'properties.open_file_handles', 'type': '[str]'}, + 'modules': {'key': 'properties.modules', 'type': '[ProcessModuleInfo]'}, + 'file_name': {'key': 'properties.file_name', 'type': 'str'}, + 'command_line': {'key': 'properties.command_line', 'type': 'str'}, + 'user_name': {'key': 'properties.user_name', 'type': 'str'}, + 'handle_count': {'key': 'properties.handle_count', 'type': 'int'}, + 'module_count': {'key': 'properties.module_count', 'type': 'int'}, + 'thread_count': {'key': 'properties.thread_count', 'type': 'int'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'total_cpu_time': {'key': 'properties.total_cpu_time', 'type': 'str'}, + 'user_cpu_time': {'key': 'properties.user_cpu_time', 'type': 'str'}, + 'privileged_cpu_time': {'key': 'properties.privileged_cpu_time', 'type': 'str'}, + 'working_set': {'key': 'properties.working_set', 'type': 'long'}, + 'peak_working_set': {'key': 'properties.peak_working_set', 'type': 'long'}, + 'private_memory': {'key': 'properties.private_memory', 'type': 'long'}, + 'virtual_memory': {'key': 'properties.virtual_memory', 'type': 'long'}, + 'peak_virtual_memory': {'key': 'properties.peak_virtual_memory', 'type': 'long'}, + 'paged_system_memory': {'key': 'properties.paged_system_memory', 'type': 'long'}, + 'non_paged_system_memory': {'key': 'properties.non_paged_system_memory', 'type': 'long'}, + 'paged_memory': {'key': 'properties.paged_memory', 'type': 'long'}, + 'peak_paged_memory': {'key': 'properties.peak_paged_memory', 'type': 'long'}, + 'time_stamp': {'key': 'properties.time_stamp', 'type': 'iso-8601'}, + 'environment_variables': {'key': 'properties.environment_variables', 'type': '{str}'}, + 'is_scm_site': {'key': 'properties.is_scm_site', 'type': 'bool'}, + 'is_webjob': {'key': 'properties.is_webjob', 'type': 'bool'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProcessInfo, self).__init__(**kwargs) + self.identifier = None + self.deployment_name = kwargs.get('deployment_name', None) + self.href = kwargs.get('href', None) + self.minidump = kwargs.get('minidump', None) + self.is_profile_running = kwargs.get('is_profile_running', None) + self.is_iis_profile_running = kwargs.get('is_iis_profile_running', None) + self.iis_profile_timeout_in_seconds = kwargs.get('iis_profile_timeout_in_seconds', None) + self.parent = kwargs.get('parent', None) + self.children = kwargs.get('children', None) + self.threads = kwargs.get('threads', None) + self.open_file_handles = kwargs.get('open_file_handles', None) + self.modules = kwargs.get('modules', None) + self.file_name = kwargs.get('file_name', None) + self.command_line = kwargs.get('command_line', None) + self.user_name = kwargs.get('user_name', None) + self.handle_count = kwargs.get('handle_count', None) + self.module_count = kwargs.get('module_count', None) + self.thread_count = kwargs.get('thread_count', None) + self.start_time = kwargs.get('start_time', None) + self.total_cpu_time = kwargs.get('total_cpu_time', None) + self.user_cpu_time = kwargs.get('user_cpu_time', None) + self.privileged_cpu_time = kwargs.get('privileged_cpu_time', None) + self.working_set = kwargs.get('working_set', None) + self.peak_working_set = kwargs.get('peak_working_set', None) + self.private_memory = kwargs.get('private_memory', None) + self.virtual_memory = kwargs.get('virtual_memory', None) + self.peak_virtual_memory = kwargs.get('peak_virtual_memory', None) + self.paged_system_memory = kwargs.get('paged_system_memory', None) + self.non_paged_system_memory = kwargs.get('non_paged_system_memory', None) + self.paged_memory = kwargs.get('paged_memory', None) + self.peak_paged_memory = kwargs.get('peak_paged_memory', None) + self.time_stamp = kwargs.get('time_stamp', None) + self.environment_variables = kwargs.get('environment_variables', None) + self.is_scm_site = kwargs.get('is_scm_site', None) + self.is_webjob = kwargs.get('is_webjob', None) + self.description = kwargs.get('description', None) + + +class ProcessInfoCollection(msrest.serialization.Model): + """Collection of Kudu process information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.ProcessInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProcessInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProcessInfoCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class ProcessModuleInfo(ProxyOnlyResource): + """Process Module Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param base_address: Base address. Used as module identifier in ARM resource URI. + :type base_address: str + :param file_name: File name. + :type file_name: str + :param href: HRef URI. + :type href: str + :param file_path: File path. + :type file_path: str + :param module_memory_size: Module memory size. + :type module_memory_size: int + :param file_version: File version. + :type file_version: str + :param file_description: File description. + :type file_description: str + :param product: Product name. + :type product: str + :param product_version: Product version. + :type product_version: str + :param is_debug: Is debug?. + :type is_debug: bool + :param language: Module language (locale). + :type language: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'base_address': {'key': 'properties.base_address', 'type': 'str'}, + 'file_name': {'key': 'properties.file_name', 'type': 'str'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'file_path': {'key': 'properties.file_path', 'type': 'str'}, + 'module_memory_size': {'key': 'properties.module_memory_size', 'type': 'int'}, + 'file_version': {'key': 'properties.file_version', 'type': 'str'}, + 'file_description': {'key': 'properties.file_description', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'product_version': {'key': 'properties.product_version', 'type': 'str'}, + 'is_debug': {'key': 'properties.is_debug', 'type': 'bool'}, + 'language': {'key': 'properties.language', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProcessModuleInfo, self).__init__(**kwargs) + self.base_address = kwargs.get('base_address', None) + self.file_name = kwargs.get('file_name', None) + self.href = kwargs.get('href', None) + self.file_path = kwargs.get('file_path', None) + self.module_memory_size = kwargs.get('module_memory_size', None) + self.file_version = kwargs.get('file_version', None) + self.file_description = kwargs.get('file_description', None) + self.product = kwargs.get('product', None) + self.product_version = kwargs.get('product_version', None) + self.is_debug = kwargs.get('is_debug', None) + self.language = kwargs.get('language', None) + + +class ProcessModuleInfoCollection(msrest.serialization.Model): + """Collection of Kudu thread information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.ProcessModuleInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProcessModuleInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProcessModuleInfoCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class ProcessThreadInfo(ProxyOnlyResource): + """Process Thread Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar identifier: Site extension ID. + :vartype identifier: int + :param href: HRef URI. + :type href: str + :param process: Process URI. + :type process: str + :param start_address: Start address. + :type start_address: str + :param current_priority: Current thread priority. + :type current_priority: int + :param priority_level: Thread priority level. + :type priority_level: str + :param base_priority: Base priority. + :type base_priority: int + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param total_processor_time: Total processor time. + :type total_processor_time: str + :param user_processor_time: User processor time. + :type user_processor_time: str + :param state: Thread state. + :type state: str + :param wait_reason: Wait reason. + :type wait_reason: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'identifier': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'identifier': {'key': 'properties.identifier', 'type': 'int'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'process': {'key': 'properties.process', 'type': 'str'}, + 'start_address': {'key': 'properties.start_address', 'type': 'str'}, + 'current_priority': {'key': 'properties.current_priority', 'type': 'int'}, + 'priority_level': {'key': 'properties.priority_level', 'type': 'str'}, + 'base_priority': {'key': 'properties.base_priority', 'type': 'int'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'total_processor_time': {'key': 'properties.total_processor_time', 'type': 'str'}, + 'user_processor_time': {'key': 'properties.user_processor_time', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'wait_reason': {'key': 'properties.wait_reason', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProcessThreadInfo, self).__init__(**kwargs) + self.identifier = None + self.href = kwargs.get('href', None) + self.process = kwargs.get('process', None) + self.start_address = kwargs.get('start_address', None) + self.current_priority = kwargs.get('current_priority', None) + self.priority_level = kwargs.get('priority_level', None) + self.base_priority = kwargs.get('base_priority', None) + self.start_time = kwargs.get('start_time', None) + self.total_processor_time = kwargs.get('total_processor_time', None) + self.user_processor_time = kwargs.get('user_processor_time', None) + self.state = kwargs.get('state', None) + self.wait_reason = kwargs.get('wait_reason', None) + + +class ProcessThreadInfoCollection(msrest.serialization.Model): + """Collection of Kudu thread information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.ProcessThreadInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProcessThreadInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProcessThreadInfoCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class PublicCertificate(ProxyOnlyResource): + """Public certificate object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param blob: Public Certificate byte array. + :type blob: bytearray + :param public_certificate_location: Public Certificate Location. Possible values include: + "CurrentUserMy", "LocalMachineMy", "Unknown". + :type public_certificate_location: str or + ~azure.mgmt.web.v2020_09_01.models.PublicCertificateLocation + :ivar thumbprint: Certificate Thumbprint. + :vartype thumbprint: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'thumbprint': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'blob': {'key': 'properties.blob', 'type': 'bytearray'}, + 'public_certificate_location': {'key': 'properties.publicCertificateLocation', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PublicCertificate, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.public_certificate_location = kwargs.get('public_certificate_location', None) + self.thumbprint = None + + +class PublicCertificateCollection(msrest.serialization.Model): + """Collection of public certificates. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.PublicCertificate] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PublicCertificate]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PublicCertificateCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class PushSettings(ProxyOnlyResource): + """Push settings for the App. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param is_push_enabled: Gets or sets a flag indicating whether the Push endpoint is enabled. + :type is_push_enabled: bool + :param tag_whitelist_json: Gets or sets a JSON string containing a list of tags that are + whitelisted for use by the push registration endpoint. + :type tag_whitelist_json: str + :param tags_requiring_auth: Gets or sets a JSON string containing a list of tags that require + user authentication to be used in the push registration endpoint. + Tags can consist of alphanumeric characters and the following: + '_', '@', '#', '.', ':', '-'. + Validation should be performed at the PushRequestHandler. + :type tags_requiring_auth: str + :param dynamic_tags_json: Gets or sets a JSON string containing a list of dynamic tags that + will be evaluated from user claims in the push registration endpoint. + :type dynamic_tags_json: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'is_push_enabled': {'key': 'properties.isPushEnabled', 'type': 'bool'}, + 'tag_whitelist_json': {'key': 'properties.tagWhitelistJson', 'type': 'str'}, + 'tags_requiring_auth': {'key': 'properties.tagsRequiringAuth', 'type': 'str'}, + 'dynamic_tags_json': {'key': 'properties.dynamicTagsJson', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PushSettings, self).__init__(**kwargs) + self.is_push_enabled = kwargs.get('is_push_enabled', None) + self.tag_whitelist_json = kwargs.get('tag_whitelist_json', None) + self.tags_requiring_auth = kwargs.get('tags_requiring_auth', None) + self.dynamic_tags_json = kwargs.get('dynamic_tags_json', None) + + +class RampUpRule(msrest.serialization.Model): + """Routing rules for ramp up testing. This rule allows to redirect static traffic % to a slot or to gradually change routing % based on performance. + + :param action_host_name: Hostname of a slot to which the traffic will be redirected if decided + to. E.g. myapp-stage.azurewebsites.net. + :type action_host_name: str + :param reroute_percentage: Percentage of the traffic which will be redirected to + :code:`ActionHostName`. + :type reroute_percentage: float + :param change_step: In auto ramp up scenario this is the step to add/remove from + :code:`ReroutePercentage` until it reaches + \n:code:`MinReroutePercentage` or + :code:`MaxReroutePercentage`. Site metrics are checked every N minutes specified + in :code:`ChangeIntervalInMinutes`.\nCustom decision algorithm + can be provided in TiPCallback site extension which URL can be specified in + :code:`ChangeDecisionCallbackUrl`. + :type change_step: float + :param change_interval_in_minutes: Specifies interval in minutes to reevaluate + ReroutePercentage. + :type change_interval_in_minutes: int + :param min_reroute_percentage: Specifies lower boundary above which ReroutePercentage will + stay. + :type min_reroute_percentage: float + :param max_reroute_percentage: Specifies upper boundary below which ReroutePercentage will + stay. + :type max_reroute_percentage: float + :param change_decision_callback_url: Custom decision algorithm can be provided in TiPCallback + site extension which URL can be specified. See TiPCallback site extension for the scaffold and + contracts. + https://www.siteextensions.net/packages/TiPCallback/. + :type change_decision_callback_url: str + :param name: Name of the routing rule. The recommended name would be to point to the slot which + will receive the traffic in the experiment. + :type name: str + """ + + _attribute_map = { + 'action_host_name': {'key': 'actionHostName', 'type': 'str'}, + 'reroute_percentage': {'key': 'reroutePercentage', 'type': 'float'}, + 'change_step': {'key': 'changeStep', 'type': 'float'}, + 'change_interval_in_minutes': {'key': 'changeIntervalInMinutes', 'type': 'int'}, + 'min_reroute_percentage': {'key': 'minReroutePercentage', 'type': 'float'}, + 'max_reroute_percentage': {'key': 'maxReroutePercentage', 'type': 'float'}, + 'change_decision_callback_url': {'key': 'changeDecisionCallbackUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RampUpRule, self).__init__(**kwargs) + self.action_host_name = kwargs.get('action_host_name', None) + self.reroute_percentage = kwargs.get('reroute_percentage', None) + self.change_step = kwargs.get('change_step', None) + self.change_interval_in_minutes = kwargs.get('change_interval_in_minutes', None) + self.min_reroute_percentage = kwargs.get('min_reroute_percentage', None) + self.max_reroute_percentage = kwargs.get('max_reroute_percentage', None) + self.change_decision_callback_url = kwargs.get('change_decision_callback_url', None) + self.name = kwargs.get('name', None) + + +class Recommendation(ProxyOnlyResource): + """Represents a recommendation result generated by the recommendation engine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param creation_time: Timestamp when this instance was created. + :type creation_time: ~datetime.datetime + :param recommendation_id: A GUID value that each recommendation object is associated with. + :type recommendation_id: str + :param resource_id: Full ARM resource ID string that this recommendation object is associated + with. + :type resource_id: str + :param resource_scope: Name of a resource type this recommendation applies, e.g. Subscription, + ServerFarm, Site. Possible values include: "ServerFarm", "Subscription", "WebSite". + :type resource_scope: str or ~azure.mgmt.web.v2020_09_01.models.ResourceScopeType + :param rule_name: Unique name of the rule. + :type rule_name: str + :param display_name: UI friendly name of the rule (may not be unique). + :type display_name: str + :param message: Recommendation text. + :type message: str + :param level: Level indicating how critical this recommendation can impact. Possible values + include: "Critical", "Warning", "Information", "NonUrgentSuggestion". + :type level: str or ~azure.mgmt.web.v2020_09_01.models.NotificationLevel + :param channels: List of channels that this recommendation can apply. Possible values include: + "Notification", "Api", "Email", "Webhook", "All". + :type channels: str or ~azure.mgmt.web.v2020_09_01.models.Channels + :ivar category_tags: The list of category tags that this recommendation belongs to. + :vartype category_tags: list[str] + :param action_name: Name of action recommended by this object. + :type action_name: str + :param enabled: True if this recommendation is still valid (i.e. "actionable"). False if it is + invalid. + :type enabled: int + :param states: The list of states of this recommendation. If it's null then it should be + considered "Active". + :type states: list[str] + :param start_time: The beginning time in UTC of a range that the recommendation refers to. + :type start_time: ~datetime.datetime + :param end_time: The end time in UTC of a range that the recommendation refers to. + :type end_time: ~datetime.datetime + :param next_notification_time: When to notify this recommendation next in UTC. Null means that + this will never be notified anymore. + :type next_notification_time: ~datetime.datetime + :param notification_expiration_time: Date and time in UTC when this notification expires. + :type notification_expiration_time: ~datetime.datetime + :param notified_time: Last timestamp in UTC this instance was actually notified. Null means + that this recommendation hasn't been notified yet. + :type notified_time: ~datetime.datetime + :param score: A metric value measured by the rule. + :type score: float + :param is_dynamic: True if this is associated with a dynamically added rule. + :type is_dynamic: bool + :param extension_name: Extension name of the portal if exists. + :type extension_name: str + :param blade_name: Deep link to a blade on the portal. + :type blade_name: str + :param forward_link: Forward link to an external document associated with the rule. + :type forward_link: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'category_tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'recommendation_id': {'key': 'properties.recommendationId', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'resource_scope': {'key': 'properties.resourceScope', 'type': 'str'}, + 'rule_name': {'key': 'properties.ruleName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'level': {'key': 'properties.level', 'type': 'str'}, + 'channels': {'key': 'properties.channels', 'type': 'str'}, + 'category_tags': {'key': 'properties.categoryTags', 'type': '[str]'}, + 'action_name': {'key': 'properties.actionName', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'int'}, + 'states': {'key': 'properties.states', 'type': '[str]'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'next_notification_time': {'key': 'properties.nextNotificationTime', 'type': 'iso-8601'}, + 'notification_expiration_time': {'key': 'properties.notificationExpirationTime', 'type': 'iso-8601'}, + 'notified_time': {'key': 'properties.notifiedTime', 'type': 'iso-8601'}, + 'score': {'key': 'properties.score', 'type': 'float'}, + 'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'}, + 'extension_name': {'key': 'properties.extensionName', 'type': 'str'}, + 'blade_name': {'key': 'properties.bladeName', 'type': 'str'}, + 'forward_link': {'key': 'properties.forwardLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Recommendation, self).__init__(**kwargs) + self.creation_time = kwargs.get('creation_time', None) + self.recommendation_id = kwargs.get('recommendation_id', None) + self.resource_id = kwargs.get('resource_id', None) + self.resource_scope = kwargs.get('resource_scope', None) + self.rule_name = kwargs.get('rule_name', None) + self.display_name = kwargs.get('display_name', None) + self.message = kwargs.get('message', None) + self.level = kwargs.get('level', None) + self.channels = kwargs.get('channels', None) + self.category_tags = None + self.action_name = kwargs.get('action_name', None) + self.enabled = kwargs.get('enabled', None) + self.states = kwargs.get('states', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.next_notification_time = kwargs.get('next_notification_time', None) + self.notification_expiration_time = kwargs.get('notification_expiration_time', None) + self.notified_time = kwargs.get('notified_time', None) + self.score = kwargs.get('score', None) + self.is_dynamic = kwargs.get('is_dynamic', None) + self.extension_name = kwargs.get('extension_name', None) + self.blade_name = kwargs.get('blade_name', None) + self.forward_link = kwargs.get('forward_link', None) + + +class RecommendationCollection(msrest.serialization.Model): + """Collection of recommendations. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.Recommendation] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Recommendation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RecommendationCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class RecommendationRule(ProxyOnlyResource): + """Represents a recommendation rule that the recommendation engine can perform. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param recommendation_name: Unique name of the rule. + :type recommendation_name: str + :param display_name: UI friendly name of the rule. + :type display_name: str + :param message: Localized name of the rule (Good for UI). + :type message: str + :param recommendation_id: Recommendation ID of an associated recommendation object tied to the + rule, if exists. + If such an object doesn't exist, it is set to null. + :type recommendation_id: str + :param description: Localized detailed description of the rule. + :type description: str + :param action_name: Name of action that is recommended by this rule in string. + :type action_name: str + :param level: Level of impact indicating how critical this rule is. Possible values include: + "Critical", "Warning", "Information", "NonUrgentSuggestion". + :type level: str or ~azure.mgmt.web.v2020_09_01.models.NotificationLevel + :param channels: List of available channels that this rule applies. Possible values include: + "Notification", "Api", "Email", "Webhook", "All". + :type channels: str or ~azure.mgmt.web.v2020_09_01.models.Channels + :ivar category_tags: The list of category tags that this recommendation rule belongs to. + :vartype category_tags: list[str] + :param is_dynamic: True if this is associated with a dynamically added rule. + :type is_dynamic: bool + :param extension_name: Extension name of the portal if exists. Applicable to dynamic rule only. + :type extension_name: str + :param blade_name: Deep link to a blade on the portal. Applicable to dynamic rule only. + :type blade_name: str + :param forward_link: Forward link to an external document associated with the rule. Applicable + to dynamic rule only. + :type forward_link: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'category_tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'recommendation_name': {'key': 'properties.recommendationName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'recommendation_id': {'key': 'properties.recommendationId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'action_name': {'key': 'properties.actionName', 'type': 'str'}, + 'level': {'key': 'properties.level', 'type': 'str'}, + 'channels': {'key': 'properties.channels', 'type': 'str'}, + 'category_tags': {'key': 'properties.categoryTags', 'type': '[str]'}, + 'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'}, + 'extension_name': {'key': 'properties.extensionName', 'type': 'str'}, + 'blade_name': {'key': 'properties.bladeName', 'type': 'str'}, + 'forward_link': {'key': 'properties.forwardLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RecommendationRule, self).__init__(**kwargs) + self.recommendation_name = kwargs.get('recommendation_name', None) + self.display_name = kwargs.get('display_name', None) + self.message = kwargs.get('message', None) + self.recommendation_id = kwargs.get('recommendation_id', None) + self.description = kwargs.get('description', None) + self.action_name = kwargs.get('action_name', None) + self.level = kwargs.get('level', None) + self.channels = kwargs.get('channels', None) + self.category_tags = None + self.is_dynamic = kwargs.get('is_dynamic', None) + self.extension_name = kwargs.get('extension_name', None) + self.blade_name = kwargs.get('blade_name', None) + self.forward_link = kwargs.get('forward_link', None) + + +class ReissueCertificateOrderRequest(ProxyOnlyResource): + """Class representing certificate reissue request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param key_size: Certificate Key Size. + :type key_size: int + :param delay_existing_revoke_in_hours: Delay in hours to revoke existing certificate after the + new certificate is issued. + :type delay_existing_revoke_in_hours: int + :param csr: Csr to be used for re-key operation. + :type csr: str + :param is_private_key_external: Should we change the ASC type (from managed private key to + external private key and vice versa). + :type is_private_key_external: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'delay_existing_revoke_in_hours': {'key': 'properties.delayExistingRevokeInHours', 'type': 'int'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ReissueCertificateOrderRequest, self).__init__(**kwargs) + self.key_size = kwargs.get('key_size', None) + self.delay_existing_revoke_in_hours = kwargs.get('delay_existing_revoke_in_hours', None) + self.csr = kwargs.get('csr', None) + self.is_private_key_external = kwargs.get('is_private_key_external', None) + + +class RelayServiceConnectionEntity(ProxyOnlyResource): + """Hybrid Connection for an App Service app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param entity_name: + :type entity_name: str + :param entity_connection_string: + :type entity_connection_string: str + :param resource_type: + :type resource_type: str + :param resource_connection_string: + :type resource_connection_string: str + :param hostname: + :type hostname: str + :param port: + :type port: int + :param biztalk_uri: + :type biztalk_uri: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'entity_name': {'key': 'properties.entityName', 'type': 'str'}, + 'entity_connection_string': {'key': 'properties.entityConnectionString', 'type': 'str'}, + 'resource_type': {'key': 'properties.resourceType', 'type': 'str'}, + 'resource_connection_string': {'key': 'properties.resourceConnectionString', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'biztalk_uri': {'key': 'properties.biztalkUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RelayServiceConnectionEntity, self).__init__(**kwargs) + self.entity_name = kwargs.get('entity_name', None) + self.entity_connection_string = kwargs.get('entity_connection_string', None) + self.resource_type = kwargs.get('resource_type', None) + self.resource_connection_string = kwargs.get('resource_connection_string', None) + self.hostname = kwargs.get('hostname', None) + self.port = kwargs.get('port', None) + self.biztalk_uri = kwargs.get('biztalk_uri', None) + + +class Rendering(msrest.serialization.Model): + """Instructions for rendering the data. + + :param type: Rendering Type. Possible values include: "NoGraph", "Table", "TimeSeries", + "TimeSeriesPerInstance". + :type type: str or ~azure.mgmt.web.v2020_09_01.models.RenderingType + :param title: Title of data. + :type title: str + :param description: Description of the data that will help it be interpreted. + :type description: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Rendering, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.title = kwargs.get('title', None) + self.description = kwargs.get('description', None) + + +class RenewCertificateOrderRequest(ProxyOnlyResource): + """Class representing certificate renew request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param key_size: Certificate Key Size. + :type key_size: int + :param csr: Csr to be used for re-key operation. + :type csr: str + :param is_private_key_external: Should we change the ASC type (from managed private key to + external private key and vice versa). + :type is_private_key_external: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(RenewCertificateOrderRequest, self).__init__(**kwargs) + self.key_size = kwargs.get('key_size', None) + self.csr = kwargs.get('csr', None) + self.is_private_key_external = kwargs.get('is_private_key_external', None) + + +class RequestsBasedTrigger(msrest.serialization.Model): + """Trigger based on total requests. + + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RequestsBasedTrigger, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.time_interval = kwargs.get('time_interval', None) + + +class ResourceCollection(msrest.serialization.Model): + """Collection of resources. + + 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. + + :param value: Required. Collection of resources. + :type value: list[str] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[str]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class ResourceHealthMetadata(ProxyOnlyResource): + """Used for getting ResourceHealthCheck settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param category: The category that the resource matches in the RHC Policy File. + :type category: str + :param signal_availability: Is there a health signal for the resource. + :type signal_availability: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'signal_availability': {'key': 'properties.signalAvailability', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceHealthMetadata, self).__init__(**kwargs) + self.category = kwargs.get('category', None) + self.signal_availability = kwargs.get('signal_availability', None) + + +class ResourceHealthMetadataCollection(msrest.serialization.Model): + """Collection of resource health metadata. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.ResourceHealthMetadata] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceHealthMetadata]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceHealthMetadataCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class ResourceMetricAvailability(msrest.serialization.Model): + """Metrics availability and retention. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar time_grain: Time grain . + :vartype time_grain: str + :ivar retention: Retention period for the current time grain. + :vartype retention: str + """ + + _validation = { + 'time_grain': {'readonly': True}, + 'retention': {'readonly': True}, + } + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'retention': {'key': 'retention', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceMetricAvailability, self).__init__(**kwargs) + self.time_grain = None + self.retention = None + + +class ResourceMetricDefinition(ProxyOnlyResource): + """Metadata for the metrics. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar unit: Unit of the metric. + :vartype unit: str + :ivar primary_aggregation_type: Primary aggregation type. + :vartype primary_aggregation_type: str + :ivar metric_availabilities: List of time grains supported for the metric together with + retention period. + :vartype metric_availabilities: + list[~azure.mgmt.web.v2020_09_01.models.ResourceMetricAvailability] + :ivar resource_uri: Resource URI. + :vartype resource_uri: str + :ivar properties: Resource metric definition properties. + :vartype properties: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'unit': {'readonly': True}, + 'primary_aggregation_type': {'readonly': True}, + 'metric_availabilities': {'readonly': True}, + 'resource_uri': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'unit': {'key': 'properties.unit', 'type': 'str'}, + 'primary_aggregation_type': {'key': 'properties.primaryAggregationType', 'type': 'str'}, + 'metric_availabilities': {'key': 'properties.metricAvailabilities', 'type': '[ResourceMetricAvailability]'}, + 'resource_uri': {'key': 'properties.resourceUri', 'type': 'str'}, + 'properties': {'key': 'properties.properties', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceMetricDefinition, self).__init__(**kwargs) + self.unit = None + self.primary_aggregation_type = None + self.metric_availabilities = None + self.resource_uri = None + self.properties = None + + +class ResourceMetricDefinitionCollection(msrest.serialization.Model): + """Collection of metric definitions. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.ResourceMetricDefinition] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceMetricDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceMetricDefinitionCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class ResourceNameAvailability(msrest.serialization.Model): + """Information regarding availability of a resource name. + + :param name_available: :code:`true` indicates name is valid and available. + :code:`false` indicates the name is invalid, unavailable, or both. + :type name_available: bool + :param reason: :code:`Invalid` indicates the name provided does not match Azure + App Service naming requirements. :code:`AlreadyExists` indicates that the name is + already in use and is therefore unavailable. Possible values include: "Invalid", + "AlreadyExists". + :type reason: str or ~azure.mgmt.web.v2020_09_01.models.InAvailabilityReasonType + :param message: If reason == invalid, provide the user with the reason why the given name is + invalid, and provide the resource naming requirements so that the user can select a valid name. + If reason == AlreadyExists, explain that resource name is already in use, and direct them to + select a different name. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceNameAvailability, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) + + +class ResourceNameAvailabilityRequest(msrest.serialization.Model): + """Resource name availability request content. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name to verify. + :type name: str + :param type: Required. Resource type used for verification. Possible values include: "Site", + "Slot", "HostingEnvironment", "PublishingUser", "Microsoft.Web/sites", + "Microsoft.Web/sites/slots", "Microsoft.Web/hostingEnvironments", + "Microsoft.Web/publishingUsers". + :type type: str or ~azure.mgmt.web.v2020_09_01.models.CheckNameResourceTypes + :param is_fqdn: Is fully qualified domain name. + :type is_fqdn: bool + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_fqdn': {'key': 'isFqdn', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceNameAvailabilityRequest, self).__init__(**kwargs) + self.name = kwargs['name'] + self.type = kwargs['type'] + self.is_fqdn = kwargs.get('is_fqdn', None) + + +class ResponseMetaData(msrest.serialization.Model): + """ResponseMetaData. + + :param data_source: Source of the Data. + :type data_source: ~azure.mgmt.web.v2020_09_01.models.DataSource + """ + + _attribute_map = { + 'data_source': {'key': 'dataSource', 'type': 'DataSource'}, + } + + def __init__( + self, + **kwargs + ): + super(ResponseMetaData, self).__init__(**kwargs) + self.data_source = kwargs.get('data_source', None) + + +class RestoreRequest(ProxyOnlyResource): + """Description of a restore request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param storage_account_url: SAS URL to the container. + :type storage_account_url: str + :param blob_name: Name of a blob which contains the backup. + :type blob_name: str + :param overwrite: :code:`true` if the restore operation can overwrite target app; + otherwise, :code:`false`. :code:`true` is needed if trying to restore + over an existing app. + :type overwrite: bool + :param site_name: Name of an app. + :type site_name: str + :param databases: Collection of databases which should be restored. This list has to match the + list of databases included in the backup. + :type databases: list[~azure.mgmt.web.v2020_09_01.models.DatabaseBackupSetting] + :param ignore_conflicting_host_names: Changes a logic when restoring an app with custom + domains. :code:`true` to remove custom domains automatically. If + :code:`false`, custom domains are added to + the app's object when it is being restored, but that might fail due to conflicts during the + operation. + :type ignore_conflicting_host_names: bool + :param ignore_databases: Ignore the databases and only restore the site content. + :type ignore_databases: bool + :param app_service_plan: Specify app service plan that will own restored site. + :type app_service_plan: str + :param operation_type: Operation type. Possible values include: "Default", "Clone", + "Relocation", "Snapshot", "CloudFS". Default value: "Default". + :type operation_type: str or ~azure.mgmt.web.v2020_09_01.models.BackupRestoreOperationType + :param adjust_connection_strings: :code:`true` if SiteConfig.ConnectionStrings + should be set in new app; otherwise, :code:`false`. + :type adjust_connection_strings: bool + :param hosting_environment: App Service Environment name, if needed (only when restoring an app + to an App Service Environment). + :type hosting_environment: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'storage_account_url': {'key': 'properties.storageAccountUrl', 'type': 'str'}, + 'blob_name': {'key': 'properties.blobName', 'type': 'str'}, + 'overwrite': {'key': 'properties.overwrite', 'type': 'bool'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'databases': {'key': 'properties.databases', 'type': '[DatabaseBackupSetting]'}, + 'ignore_conflicting_host_names': {'key': 'properties.ignoreConflictingHostNames', 'type': 'bool'}, + 'ignore_databases': {'key': 'properties.ignoreDatabases', 'type': 'bool'}, + 'app_service_plan': {'key': 'properties.appServicePlan', 'type': 'str'}, + 'operation_type': {'key': 'properties.operationType', 'type': 'str'}, + 'adjust_connection_strings': {'key': 'properties.adjustConnectionStrings', 'type': 'bool'}, + 'hosting_environment': {'key': 'properties.hostingEnvironment', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RestoreRequest, self).__init__(**kwargs) + self.storage_account_url = kwargs.get('storage_account_url', None) + self.blob_name = kwargs.get('blob_name', None) + self.overwrite = kwargs.get('overwrite', None) + self.site_name = kwargs.get('site_name', None) + self.databases = kwargs.get('databases', None) + self.ignore_conflicting_host_names = kwargs.get('ignore_conflicting_host_names', False) + self.ignore_databases = kwargs.get('ignore_databases', False) + self.app_service_plan = kwargs.get('app_service_plan', None) + self.operation_type = kwargs.get('operation_type', "Default") + self.adjust_connection_strings = kwargs.get('adjust_connection_strings', None) + self.hosting_environment = kwargs.get('hosting_environment', None) + + +class ServiceSpecification(msrest.serialization.Model): + """Resource metrics service provided by Microsoft.Insights resource provider. + + :param metric_specifications: + :type metric_specifications: list[~azure.mgmt.web.v2020_09_01.models.MetricSpecification] + :param log_specifications: + :type log_specifications: list[~azure.mgmt.web.v2020_09_01.models.LogSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + self.log_specifications = kwargs.get('log_specifications', None) + + +class Site(Resource): + """A web app, a mobile app backend, or an API app. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param identity: Managed service identity. + :type identity: ~azure.mgmt.web.v2020_09_01.models.ManagedServiceIdentity + :ivar state: Current state of the app. + :vartype state: str + :ivar host_names: Hostnames associated with the app. + :vartype host_names: list[str] + :ivar repository_site_name: Name of the repository site. + :vartype repository_site_name: str + :ivar usage_state: State indicating whether the app has exceeded its quota usage. Read-only. + Possible values include: "Normal", "Exceeded". + :vartype usage_state: str or ~azure.mgmt.web.v2020_09_01.models.UsageState + :param enabled: :code:`true` if the app is enabled; otherwise, + :code:`false`. Setting this value to false disables the app (takes the app + offline). + :type enabled: bool + :ivar enabled_host_names: Enabled hostnames for the app.Hostnames need to be assigned (see + HostNames) AND enabled. Otherwise, + the app is not served on those hostnames. + :vartype enabled_host_names: list[str] + :ivar availability_state: Management information availability state for the app. Possible + values include: "Normal", "Limited", "DisasterRecoveryMode". + :vartype availability_state: str or ~azure.mgmt.web.v2020_09_01.models.SiteAvailabilityState + :param host_name_ssl_states: Hostname SSL states are used to manage the SSL bindings for app's + hostnames. + :type host_name_ssl_states: list[~azure.mgmt.web.v2020_09_01.models.HostNameSslState] + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param reserved: :code:`true` if reserved; otherwise, :code:`false`. + :type reserved: bool + :param is_xenon: Obsolete: Hyper-V sandbox. + :type is_xenon: bool + :param hyper_v: Hyper-V sandbox. + :type hyper_v: bool + :ivar last_modified_time_utc: Last time the app was modified, in UTC. Read-only. + :vartype last_modified_time_utc: ~datetime.datetime + :param site_config: Configuration of the app. + :type site_config: ~azure.mgmt.web.v2020_09_01.models.SiteConfig + :ivar traffic_manager_host_names: Azure Traffic Manager hostnames associated with the app. + Read-only. + :vartype traffic_manager_host_names: list[str] + :param scm_site_also_stopped: :code:`true` to stop SCM (KUDU) site when the app is + stopped; otherwise, :code:`false`. The default is :code:`false`. + :type scm_site_also_stopped: bool + :ivar target_swap_slot: Specifies which deployment slot this app will swap into. Read-only. + :vartype target_swap_slot: str + :param hosting_environment_profile: App Service Environment to use for the app. + :type hosting_environment_profile: ~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentProfile + :param client_affinity_enabled: :code:`true` to enable client affinity; + :code:`false` to stop sending session affinity cookies, which route client + requests in the same session to the same instance. Default is :code:`true`. + :type client_affinity_enabled: bool + :param client_cert_enabled: :code:`true` to enable client certificate + authentication (TLS mutual authentication); otherwise, :code:`false`. Default is + :code:`false`. + :type client_cert_enabled: bool + :param client_cert_mode: This composes with ClientCertEnabled setting. + + + * ClientCertEnabled: false means ClientCert is ignored. + * ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + * ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or + accepted. Possible values include: "Required", "Optional". + :type client_cert_mode: str or ~azure.mgmt.web.v2020_09_01.models.ClientCertMode + :param client_cert_exclusion_paths: client certificate authentication comma-separated exclusion + paths. + :type client_cert_exclusion_paths: str + :param host_names_disabled: :code:`true` to disable the public hostnames of the + app; otherwise, :code:`false`. + If :code:`true`, the app is only accessible via API management process. + :type host_names_disabled: bool + :param custom_domain_verification_id: Unique identifier that verifies the custom domains + assigned to the app. Customer will add this id to a txt record for verification. + :type custom_domain_verification_id: str + :ivar outbound_ip_addresses: List of IP addresses that the app uses for outbound connections + (e.g. database access). Includes VIPs from tenants that site can be hosted with current + settings. Read-only. + :vartype outbound_ip_addresses: str + :ivar possible_outbound_ip_addresses: List of IP addresses that the app uses for outbound + connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read- + only. + :vartype possible_outbound_ip_addresses: str + :param container_size: Size of the function container. + :type container_size: int + :param daily_memory_time_quota: Maximum allowed daily memory-time quota (applicable on dynamic + apps only). + :type daily_memory_time_quota: int + :ivar suspended_till: App suspended till in case memory-time quota is exceeded. + :vartype suspended_till: ~datetime.datetime + :ivar max_number_of_workers: Maximum number of workers. + This only applies to Functions container. + :vartype max_number_of_workers: int + :param cloning_info: If specified during app creation, the app is cloned from a source app. + :type cloning_info: ~azure.mgmt.web.v2020_09_01.models.CloningInfo + :ivar resource_group: Name of the resource group the app belongs to. Read-only. + :vartype resource_group: str + :ivar is_default_container: :code:`true` if the app is a default container; + otherwise, :code:`false`. + :vartype is_default_container: bool + :ivar default_host_name: Default hostname of the app. Read-only. + :vartype default_host_name: str + :ivar slot_swap_status: Status of the last deployment slot swap operation. + :vartype slot_swap_status: ~azure.mgmt.web.v2020_09_01.models.SlotSwapStatus + :param https_only: HttpsOnly: configures a web site to accept only https requests. Issues + redirect for + http requests. + :type https_only: bool + :param redundancy_mode: Site redundancy mode. Possible values include: "None", "Manual", + "Failover", "ActiveActive", "GeoRedundant". + :type redundancy_mode: str or ~azure.mgmt.web.v2020_09_01.models.RedundancyMode + :ivar in_progress_operation_id: Specifies an operation id if this site has a pending operation. + :vartype in_progress_operation_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'state': {'readonly': True}, + 'host_names': {'readonly': True}, + 'repository_site_name': {'readonly': True}, + 'usage_state': {'readonly': True}, + 'enabled_host_names': {'readonly': True}, + 'availability_state': {'readonly': True}, + 'last_modified_time_utc': {'readonly': True}, + 'traffic_manager_host_names': {'readonly': True}, + 'target_swap_slot': {'readonly': True}, + 'outbound_ip_addresses': {'readonly': True}, + 'possible_outbound_ip_addresses': {'readonly': True}, + 'suspended_till': {'readonly': True}, + 'max_number_of_workers': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'is_default_container': {'readonly': True}, + 'default_host_name': {'readonly': True}, + 'slot_swap_status': {'readonly': True}, + 'in_progress_operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'repository_site_name': {'key': 'properties.repositorySiteName', 'type': 'str'}, + 'usage_state': {'key': 'properties.usageState', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'enabled_host_names': {'key': 'properties.enabledHostNames', 'type': '[str]'}, + 'availability_state': {'key': 'properties.availabilityState', 'type': 'str'}, + 'host_name_ssl_states': {'key': 'properties.hostNameSslStates', 'type': '[HostNameSslState]'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'last_modified_time_utc': {'key': 'properties.lastModifiedTimeUtc', 'type': 'iso-8601'}, + 'site_config': {'key': 'properties.siteConfig', 'type': 'SiteConfig'}, + 'traffic_manager_host_names': {'key': 'properties.trafficManagerHostNames', 'type': '[str]'}, + 'scm_site_also_stopped': {'key': 'properties.scmSiteAlsoStopped', 'type': 'bool'}, + 'target_swap_slot': {'key': 'properties.targetSwapSlot', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'client_affinity_enabled': {'key': 'properties.clientAffinityEnabled', 'type': 'bool'}, + 'client_cert_enabled': {'key': 'properties.clientCertEnabled', 'type': 'bool'}, + 'client_cert_mode': {'key': 'properties.clientCertMode', 'type': 'str'}, + 'client_cert_exclusion_paths': {'key': 'properties.clientCertExclusionPaths', 'type': 'str'}, + 'host_names_disabled': {'key': 'properties.hostNamesDisabled', 'type': 'bool'}, + 'custom_domain_verification_id': {'key': 'properties.customDomainVerificationId', 'type': 'str'}, + 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': 'str'}, + 'possible_outbound_ip_addresses': {'key': 'properties.possibleOutboundIpAddresses', 'type': 'str'}, + 'container_size': {'key': 'properties.containerSize', 'type': 'int'}, + 'daily_memory_time_quota': {'key': 'properties.dailyMemoryTimeQuota', 'type': 'int'}, + 'suspended_till': {'key': 'properties.suspendedTill', 'type': 'iso-8601'}, + 'max_number_of_workers': {'key': 'properties.maxNumberOfWorkers', 'type': 'int'}, + 'cloning_info': {'key': 'properties.cloningInfo', 'type': 'CloningInfo'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'is_default_container': {'key': 'properties.isDefaultContainer', 'type': 'bool'}, + 'default_host_name': {'key': 'properties.defaultHostName', 'type': 'str'}, + 'slot_swap_status': {'key': 'properties.slotSwapStatus', 'type': 'SlotSwapStatus'}, + 'https_only': {'key': 'properties.httpsOnly', 'type': 'bool'}, + 'redundancy_mode': {'key': 'properties.redundancyMode', 'type': 'str'}, + 'in_progress_operation_id': {'key': 'properties.inProgressOperationId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Site, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.state = None + self.host_names = None + self.repository_site_name = None + self.usage_state = None + self.enabled = kwargs.get('enabled', None) + self.enabled_host_names = None + self.availability_state = None + self.host_name_ssl_states = kwargs.get('host_name_ssl_states', None) + self.server_farm_id = kwargs.get('server_farm_id', None) + self.reserved = kwargs.get('reserved', False) + self.is_xenon = kwargs.get('is_xenon', False) + self.hyper_v = kwargs.get('hyper_v', False) + self.last_modified_time_utc = None + self.site_config = kwargs.get('site_config', None) + self.traffic_manager_host_names = None + self.scm_site_also_stopped = kwargs.get('scm_site_also_stopped', False) + self.target_swap_slot = None + self.hosting_environment_profile = kwargs.get('hosting_environment_profile', None) + self.client_affinity_enabled = kwargs.get('client_affinity_enabled', None) + self.client_cert_enabled = kwargs.get('client_cert_enabled', None) + self.client_cert_mode = kwargs.get('client_cert_mode', None) + self.client_cert_exclusion_paths = kwargs.get('client_cert_exclusion_paths', None) + self.host_names_disabled = kwargs.get('host_names_disabled', None) + self.custom_domain_verification_id = kwargs.get('custom_domain_verification_id', None) + self.outbound_ip_addresses = None + self.possible_outbound_ip_addresses = None + self.container_size = kwargs.get('container_size', None) + self.daily_memory_time_quota = kwargs.get('daily_memory_time_quota', None) + self.suspended_till = None + self.max_number_of_workers = None + self.cloning_info = kwargs.get('cloning_info', None) + self.resource_group = None + self.is_default_container = None + self.default_host_name = None + self.slot_swap_status = None + self.https_only = kwargs.get('https_only', None) + self.redundancy_mode = kwargs.get('redundancy_mode', None) + self.in_progress_operation_id = None + + +class SiteAuthSettings(ProxyOnlyResource): + """Configuration settings for the Azure App Service Authentication / Authorization feature. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param enabled: :code:`true` if the Authentication / Authorization feature is + enabled for the current app; otherwise, :code:`false`. + :type enabled: bool + :param runtime_version: The RuntimeVersion of the Authentication / Authorization feature in use + for the current app. + The setting in this value can control the behavior of certain features in the Authentication / + Authorization module. + :type runtime_version: str + :param unauthenticated_client_action: The action to take when an unauthenticated client + attempts to access the app. Possible values include: "RedirectToLoginPage", "AllowAnonymous". + :type unauthenticated_client_action: str or + ~azure.mgmt.web.v2020_09_01.models.UnauthenticatedClientAction + :param token_store_enabled: :code:`true` to durably store platform-specific + security tokens that are obtained during login flows; otherwise, :code:`false`. + The default is :code:`false`. + :type token_store_enabled: bool + :param allowed_external_redirect_urls: External URLs that can be redirected to as part of + logging in or logging out of the app. Note that the query string part of the URL is ignored. + This is an advanced setting typically only needed by Windows Store application backends. + Note that URLs within the current domain are always implicitly allowed. + :type allowed_external_redirect_urls: list[str] + :param default_provider: The default authentication provider to use when multiple providers are + configured. + This setting is only needed if multiple providers are configured and the unauthenticated + client + action is set to "RedirectToLoginPage". Possible values include: "AzureActiveDirectory", + "Facebook", "Google", "MicrosoftAccount", "Twitter", "Github". + :type default_provider: str or ~azure.mgmt.web.v2020_09_01.models.BuiltInAuthenticationProvider + :param token_refresh_extension_hours: The number of hours after session token expiration that a + session token can be used to + call the token refresh API. The default is 72 hours. + :type token_refresh_extension_hours: float + :param client_id: The Client ID of this relying party application, known as the client_id. + This setting is required for enabling OpenID Connection authentication with Azure Active + Directory or + other 3rd party OpenID Connect providers. + More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. + :type client_id: str + :param client_secret: The Client Secret of this relying party application (in Azure Active + Directory, this is also referred to as the Key). + This setting is optional. If no client secret is configured, the OpenID Connect implicit auth + flow is used to authenticate end users. + Otherwise, the OpenID Connect Authorization Code Flow is used to authenticate end users. + More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. + :type client_secret: str + :param client_secret_setting_name: The app setting name that contains the client secret of the + relying party application. + :type client_secret_setting_name: str + :param client_secret_certificate_thumbprint: An alternative to the client secret, that is the + thumbprint of a certificate used for signing purposes. This property acts as + a replacement for the Client Secret. It is also optional. + :type client_secret_certificate_thumbprint: str + :param issuer: The OpenID Connect Issuer URI that represents the entity which issues access + tokens for this application. + When using Azure Active Directory, this value is the URI of the directory tenant, e.g. + https://sts.windows.net/{tenant-guid}/. + This URI is a case-sensitive identifier for the token issuer. + More information on OpenID Connect Discovery: http://openid.net/specs/openid-connect- + discovery-1_0.html. + :type issuer: str + :param validate_issuer: Gets a value indicating whether the issuer should be a valid HTTPS url + and be validated as such. + :type validate_issuer: bool + :param allowed_audiences: Allowed audience values to consider when validating JWTs issued by + Azure Active Directory. Note that the :code:`ClientID` value is always considered + an + allowed audience, regardless of this setting. + :type allowed_audiences: list[str] + :param additional_login_params: Login parameters to send to the OpenID Connect authorization + endpoint when + a user logs in. Each parameter must be in the form "key=value". + :type additional_login_params: list[str] + :param aad_claims_authorization: Gets a JSON string containing the Azure AD Acl settings. + :type aad_claims_authorization: str + :param google_client_id: The OpenID Connect Client ID for the Google web application. + This setting is required for enabling Google Sign-In. + Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + :type google_client_id: str + :param google_client_secret: The client secret associated with the Google web application. + This setting is required for enabling Google Sign-In. + Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + :type google_client_secret: str + :param google_client_secret_setting_name: The app setting name that contains the client secret + associated with + the Google web application. + :type google_client_secret_setting_name: str + :param google_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of Google + Sign-In authentication. + This setting is optional. If not specified, "openid", "profile", and "email" are used as + default scopes. + Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + :type google_o_auth_scopes: list[str] + :param facebook_app_id: The App ID of the Facebook app used for login. + This setting is required for enabling Facebook Login. + Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + :type facebook_app_id: str + :param facebook_app_secret: The App Secret of the Facebook app used for Facebook Login. + This setting is required for enabling Facebook Login. + Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + :type facebook_app_secret: str + :param facebook_app_secret_setting_name: The app setting name that contains the app secret used + for Facebook Login. + :type facebook_app_secret_setting_name: str + :param facebook_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of Facebook + Login authentication. + This setting is optional. + Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + :type facebook_o_auth_scopes: list[str] + :param git_hub_client_id: The Client Id of the GitHub app used for login. + This setting is required for enabling Github login. + :type git_hub_client_id: str + :param git_hub_client_secret: The Client Secret of the GitHub app used for Github Login. + This setting is required for enabling Github login. + :type git_hub_client_secret: str + :param git_hub_client_secret_setting_name: The app setting name that contains the client secret + of the Github + app used for GitHub Login. + :type git_hub_client_secret_setting_name: str + :param git_hub_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of GitHub + Login authentication. + This setting is optional. + :type git_hub_o_auth_scopes: list[str] + :param twitter_consumer_key: The OAuth 1.0a consumer key of the Twitter application used for + sign-in. + This setting is required for enabling Twitter Sign-In. + Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. + :type twitter_consumer_key: str + :param twitter_consumer_secret: The OAuth 1.0a consumer secret of the Twitter application used + for sign-in. + This setting is required for enabling Twitter Sign-In. + Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. + :type twitter_consumer_secret: str + :param twitter_consumer_secret_setting_name: The app setting name that contains the OAuth 1.0a + consumer secret of the Twitter + application used for sign-in. + :type twitter_consumer_secret_setting_name: str + :param microsoft_account_client_id: The OAuth 2.0 client ID that was created for the app used + for authentication. + This setting is required for enabling Microsoft Account authentication. + Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm. + :type microsoft_account_client_id: str + :param microsoft_account_client_secret: The OAuth 2.0 client secret that was created for the + app used for authentication. + This setting is required for enabling Microsoft Account authentication. + Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm. + :type microsoft_account_client_secret: str + :param microsoft_account_client_secret_setting_name: The app setting name containing the OAuth + 2.0 client secret that was created for the + app used for authentication. + :type microsoft_account_client_secret_setting_name: str + :param microsoft_account_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of + Microsoft Account authentication. + This setting is optional. If not specified, "wl.basic" is used as the default scope. + Microsoft Account Scopes and permissions documentation: https://msdn.microsoft.com/en- + us/library/dn631845.aspx. + :type microsoft_account_o_auth_scopes: list[str] + :param is_auth_from_file: "true" if the auth config settings should be read from a file, + "false" otherwise. + :type is_auth_from_file: str + :param auth_file_path: The path of the config file containing auth settings. + If the path is relative, base will the site's root directory. + :type auth_file_path: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'runtime_version': {'key': 'properties.runtimeVersion', 'type': 'str'}, + 'unauthenticated_client_action': {'key': 'properties.unauthenticatedClientAction', 'type': 'str'}, + 'token_store_enabled': {'key': 'properties.tokenStoreEnabled', 'type': 'bool'}, + 'allowed_external_redirect_urls': {'key': 'properties.allowedExternalRedirectUrls', 'type': '[str]'}, + 'default_provider': {'key': 'properties.defaultProvider', 'type': 'str'}, + 'token_refresh_extension_hours': {'key': 'properties.tokenRefreshExtensionHours', 'type': 'float'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_secret_certificate_thumbprint': {'key': 'properties.clientSecretCertificateThumbprint', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'validate_issuer': {'key': 'properties.validateIssuer', 'type': 'bool'}, + 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + 'additional_login_params': {'key': 'properties.additionalLoginParams', 'type': '[str]'}, + 'aad_claims_authorization': {'key': 'properties.aadClaimsAuthorization', 'type': 'str'}, + 'google_client_id': {'key': 'properties.googleClientId', 'type': 'str'}, + 'google_client_secret': {'key': 'properties.googleClientSecret', 'type': 'str'}, + 'google_client_secret_setting_name': {'key': 'properties.googleClientSecretSettingName', 'type': 'str'}, + 'google_o_auth_scopes': {'key': 'properties.googleOAuthScopes', 'type': '[str]'}, + 'facebook_app_id': {'key': 'properties.facebookAppId', 'type': 'str'}, + 'facebook_app_secret': {'key': 'properties.facebookAppSecret', 'type': 'str'}, + 'facebook_app_secret_setting_name': {'key': 'properties.facebookAppSecretSettingName', 'type': 'str'}, + 'facebook_o_auth_scopes': {'key': 'properties.facebookOAuthScopes', 'type': '[str]'}, + 'git_hub_client_id': {'key': 'properties.gitHubClientId', 'type': 'str'}, + 'git_hub_client_secret': {'key': 'properties.gitHubClientSecret', 'type': 'str'}, + 'git_hub_client_secret_setting_name': {'key': 'properties.gitHubClientSecretSettingName', 'type': 'str'}, + 'git_hub_o_auth_scopes': {'key': 'properties.gitHubOAuthScopes', 'type': '[str]'}, + 'twitter_consumer_key': {'key': 'properties.twitterConsumerKey', 'type': 'str'}, + 'twitter_consumer_secret': {'key': 'properties.twitterConsumerSecret', 'type': 'str'}, + 'twitter_consumer_secret_setting_name': {'key': 'properties.twitterConsumerSecretSettingName', 'type': 'str'}, + 'microsoft_account_client_id': {'key': 'properties.microsoftAccountClientId', 'type': 'str'}, + 'microsoft_account_client_secret': {'key': 'properties.microsoftAccountClientSecret', 'type': 'str'}, + 'microsoft_account_client_secret_setting_name': {'key': 'properties.microsoftAccountClientSecretSettingName', 'type': 'str'}, + 'microsoft_account_o_auth_scopes': {'key': 'properties.microsoftAccountOAuthScopes', 'type': '[str]'}, + 'is_auth_from_file': {'key': 'properties.isAuthFromFile', 'type': 'str'}, + 'auth_file_path': {'key': 'properties.authFilePath', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteAuthSettings, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.runtime_version = kwargs.get('runtime_version', None) + self.unauthenticated_client_action = kwargs.get('unauthenticated_client_action', None) + self.token_store_enabled = kwargs.get('token_store_enabled', None) + self.allowed_external_redirect_urls = kwargs.get('allowed_external_redirect_urls', None) + self.default_provider = kwargs.get('default_provider', None) + self.token_refresh_extension_hours = kwargs.get('token_refresh_extension_hours', None) + self.client_id = kwargs.get('client_id', None) + self.client_secret = kwargs.get('client_secret', None) + self.client_secret_setting_name = kwargs.get('client_secret_setting_name', None) + self.client_secret_certificate_thumbprint = kwargs.get('client_secret_certificate_thumbprint', None) + self.issuer = kwargs.get('issuer', None) + self.validate_issuer = kwargs.get('validate_issuer', None) + self.allowed_audiences = kwargs.get('allowed_audiences', None) + self.additional_login_params = kwargs.get('additional_login_params', None) + self.aad_claims_authorization = kwargs.get('aad_claims_authorization', None) + self.google_client_id = kwargs.get('google_client_id', None) + self.google_client_secret = kwargs.get('google_client_secret', None) + self.google_client_secret_setting_name = kwargs.get('google_client_secret_setting_name', None) + self.google_o_auth_scopes = kwargs.get('google_o_auth_scopes', None) + self.facebook_app_id = kwargs.get('facebook_app_id', None) + self.facebook_app_secret = kwargs.get('facebook_app_secret', None) + self.facebook_app_secret_setting_name = kwargs.get('facebook_app_secret_setting_name', None) + self.facebook_o_auth_scopes = kwargs.get('facebook_o_auth_scopes', None) + self.git_hub_client_id = kwargs.get('git_hub_client_id', None) + self.git_hub_client_secret = kwargs.get('git_hub_client_secret', None) + self.git_hub_client_secret_setting_name = kwargs.get('git_hub_client_secret_setting_name', None) + self.git_hub_o_auth_scopes = kwargs.get('git_hub_o_auth_scopes', None) + self.twitter_consumer_key = kwargs.get('twitter_consumer_key', None) + self.twitter_consumer_secret = kwargs.get('twitter_consumer_secret', None) + self.twitter_consumer_secret_setting_name = kwargs.get('twitter_consumer_secret_setting_name', None) + self.microsoft_account_client_id = kwargs.get('microsoft_account_client_id', None) + self.microsoft_account_client_secret = kwargs.get('microsoft_account_client_secret', None) + self.microsoft_account_client_secret_setting_name = kwargs.get('microsoft_account_client_secret_setting_name', None) + self.microsoft_account_o_auth_scopes = kwargs.get('microsoft_account_o_auth_scopes', None) + self.is_auth_from_file = kwargs.get('is_auth_from_file', None) + self.auth_file_path = kwargs.get('auth_file_path', None) + + +class SiteAuthSettingsV2(ProxyOnlyResource): + """SiteAuthSettingsV2. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param platform: + :type platform: ~azure.mgmt.web.v2020_09_01.models.AuthPlatform + :param global_validation: + :type global_validation: ~azure.mgmt.web.v2020_09_01.models.GlobalValidation + :param identity_providers: + :type identity_providers: ~azure.mgmt.web.v2020_09_01.models.IdentityProviders + :param login: + :type login: ~azure.mgmt.web.v2020_09_01.models.Login + :param http_settings: + :type http_settings: ~azure.mgmt.web.v2020_09_01.models.HttpSettings + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'platform': {'key': 'properties.platform', 'type': 'AuthPlatform'}, + 'global_validation': {'key': 'properties.globalValidation', 'type': 'GlobalValidation'}, + 'identity_providers': {'key': 'properties.identityProviders', 'type': 'IdentityProviders'}, + 'login': {'key': 'properties.login', 'type': 'Login'}, + 'http_settings': {'key': 'properties.httpSettings', 'type': 'HttpSettings'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteAuthSettingsV2, self).__init__(**kwargs) + self.platform = kwargs.get('platform', None) + self.global_validation = kwargs.get('global_validation', None) + self.identity_providers = kwargs.get('identity_providers', None) + self.login = kwargs.get('login', None) + self.http_settings = kwargs.get('http_settings', None) + + +class SiteCloneability(msrest.serialization.Model): + """Represents whether or not an app is cloneable. + + :param result: Name of app. Possible values include: "Cloneable", "PartiallyCloneable", + "NotCloneable". + :type result: str or ~azure.mgmt.web.v2020_09_01.models.CloneAbilityResult + :param blocking_features: List of features enabled on app that prevent cloning. + :type blocking_features: list[~azure.mgmt.web.v2020_09_01.models.SiteCloneabilityCriterion] + :param unsupported_features: List of features enabled on app that are non-blocking but cannot + be cloned. The app can still be cloned + but the features in this list will not be set up on cloned app. + :type unsupported_features: list[~azure.mgmt.web.v2020_09_01.models.SiteCloneabilityCriterion] + :param blocking_characteristics: List of blocking application characteristics. + :type blocking_characteristics: + list[~azure.mgmt.web.v2020_09_01.models.SiteCloneabilityCriterion] + """ + + _attribute_map = { + 'result': {'key': 'result', 'type': 'str'}, + 'blocking_features': {'key': 'blockingFeatures', 'type': '[SiteCloneabilityCriterion]'}, + 'unsupported_features': {'key': 'unsupportedFeatures', 'type': '[SiteCloneabilityCriterion]'}, + 'blocking_characteristics': {'key': 'blockingCharacteristics', 'type': '[SiteCloneabilityCriterion]'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteCloneability, self).__init__(**kwargs) + self.result = kwargs.get('result', None) + self.blocking_features = kwargs.get('blocking_features', None) + self.unsupported_features = kwargs.get('unsupported_features', None) + self.blocking_characteristics = kwargs.get('blocking_characteristics', None) + + +class SiteCloneabilityCriterion(msrest.serialization.Model): + """An app cloneability criterion. + + :param name: Name of criterion. + :type name: str + :param description: Description of criterion. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteCloneabilityCriterion, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + + +class SiteConfig(msrest.serialization.Model): + """Configuration of an App Service app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param number_of_workers: Number of workers. + :type number_of_workers: int + :param default_documents: Default documents. + :type default_documents: list[str] + :param net_framework_version: .NET Framework version. + :type net_framework_version: str + :param php_version: Version of PHP. + :type php_version: str + :param python_version: Version of Python. + :type python_version: str + :param node_version: Version of Node.js. + :type node_version: str + :param power_shell_version: Version of PowerShell. + :type power_shell_version: str + :param linux_fx_version: Linux App Framework and version. + :type linux_fx_version: str + :param windows_fx_version: Xenon App Framework and version. + :type windows_fx_version: str + :param request_tracing_enabled: :code:`true` if request tracing is enabled; + otherwise, :code:`false`. + :type request_tracing_enabled: bool + :param request_tracing_expiration_time: Request tracing expiration time. + :type request_tracing_expiration_time: ~datetime.datetime + :param remote_debugging_enabled: :code:`true` if remote debugging is enabled; + otherwise, :code:`false`. + :type remote_debugging_enabled: bool + :param remote_debugging_version: Remote debugging version. + :type remote_debugging_version: str + :param http_logging_enabled: :code:`true` if HTTP logging is enabled; otherwise, + :code:`false`. + :type http_logging_enabled: bool + :param logs_directory_size_limit: HTTP logs directory size limit. + :type logs_directory_size_limit: int + :param detailed_error_logging_enabled: :code:`true` if detailed error logging is + enabled; otherwise, :code:`false`. + :type detailed_error_logging_enabled: bool + :param publishing_username: Publishing user name. + :type publishing_username: str + :param app_settings: Application settings. + :type app_settings: list[~azure.mgmt.web.v2020_09_01.models.NameValuePair] + :param connection_strings: Connection strings. + :type connection_strings: list[~azure.mgmt.web.v2020_09_01.models.ConnStringInfo] + :ivar machine_key: Site MachineKey. + :vartype machine_key: ~azure.mgmt.web.v2020_09_01.models.SiteMachineKey + :param handler_mappings: Handler mappings. + :type handler_mappings: list[~azure.mgmt.web.v2020_09_01.models.HandlerMapping] + :param document_root: Document root. + :type document_root: str + :param scm_type: SCM type. Possible values include: "None", "Dropbox", "Tfs", "LocalGit", + "GitHub", "CodePlexGit", "CodePlexHg", "BitbucketGit", "BitbucketHg", "ExternalGit", + "ExternalHg", "OneDrive", "VSO", "VSTSRM". + :type scm_type: str or ~azure.mgmt.web.v2020_09_01.models.ScmType + :param use32_bit_worker_process: :code:`true` to use 32-bit worker process; + otherwise, :code:`false`. + :type use32_bit_worker_process: bool + :param web_sockets_enabled: :code:`true` if WebSocket is enabled; otherwise, + :code:`false`. + :type web_sockets_enabled: bool + :param always_on: :code:`true` if Always On is enabled; otherwise, + :code:`false`. + :type always_on: bool + :param java_version: Java version. + :type java_version: str + :param java_container: Java container. + :type java_container: str + :param java_container_version: Java container version. + :type java_container_version: str + :param app_command_line: App command line to launch. + :type app_command_line: str + :param managed_pipeline_mode: Managed pipeline mode. Possible values include: "Integrated", + "Classic". + :type managed_pipeline_mode: str or ~azure.mgmt.web.v2020_09_01.models.ManagedPipelineMode + :param virtual_applications: Virtual applications. + :type virtual_applications: list[~azure.mgmt.web.v2020_09_01.models.VirtualApplication] + :param load_balancing: Site load balancing. Possible values include: "WeightedRoundRobin", + "LeastRequests", "LeastResponseTime", "WeightedTotalTraffic", "RequestHash". + :type load_balancing: str or ~azure.mgmt.web.v2020_09_01.models.SiteLoadBalancing + :param experiments: This is work around for polymorphic types. + :type experiments: ~azure.mgmt.web.v2020_09_01.models.Experiments + :param limits: Site limits. + :type limits: ~azure.mgmt.web.v2020_09_01.models.SiteLimits + :param auto_heal_enabled: :code:`true` if Auto Heal is enabled; otherwise, + :code:`false`. + :type auto_heal_enabled: bool + :param auto_heal_rules: Auto Heal rules. + :type auto_heal_rules: ~azure.mgmt.web.v2020_09_01.models.AutoHealRules + :param tracing_options: Tracing options. + :type tracing_options: str + :param vnet_name: Virtual Network name. + :type vnet_name: str + :param vnet_route_all_enabled: Virtual Network Route All enabled. This causes all outbound + traffic to have Virtual Network Security Groups and User Defined Routes applied. + :type vnet_route_all_enabled: bool + :param vnet_private_ports_count: The number of private ports assigned to this app. These will + be assigned dynamically on runtime. + :type vnet_private_ports_count: int + :param cors: Cross-Origin Resource Sharing (CORS) settings. + :type cors: ~azure.mgmt.web.v2020_09_01.models.CorsSettings + :param push: Push endpoint settings. + :type push: ~azure.mgmt.web.v2020_09_01.models.PushSettings + :param api_definition: Information about the formal API definition for the app. + :type api_definition: ~azure.mgmt.web.v2020_09_01.models.ApiDefinitionInfo + :param api_management_config: Azure API management settings linked to the app. + :type api_management_config: ~azure.mgmt.web.v2020_09_01.models.ApiManagementConfig + :param auto_swap_slot_name: Auto-swap slot name. + :type auto_swap_slot_name: str + :param local_my_sql_enabled: :code:`true` to enable local MySQL; otherwise, + :code:`false`. + :type local_my_sql_enabled: bool + :param managed_service_identity_id: Managed Service Identity Id. + :type managed_service_identity_id: int + :param x_managed_service_identity_id: Explicit Managed Service Identity Id. + :type x_managed_service_identity_id: int + :param ip_security_restrictions: IP security restrictions for main. + :type ip_security_restrictions: list[~azure.mgmt.web.v2020_09_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions: IP security restrictions for scm. + :type scm_ip_security_restrictions: + list[~azure.mgmt.web.v2020_09_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions_use_main: IP security restrictions for scm to use main. + :type scm_ip_security_restrictions_use_main: bool + :param http20_enabled: Http20Enabled: configures a web site to allow clients to connect over + http2.0. + :type http20_enabled: bool + :param min_tls_version: MinTlsVersion: configures the minimum version of TLS required for SSL + requests. Possible values include: "1.0", "1.1", "1.2". + :type min_tls_version: str or ~azure.mgmt.web.v2020_09_01.models.SupportedTlsVersions + :param scm_min_tls_version: ScmMinTlsVersion: configures the minimum version of TLS required + for SSL requests for SCM site. Possible values include: "1.0", "1.1", "1.2". + :type scm_min_tls_version: str or ~azure.mgmt.web.v2020_09_01.models.SupportedTlsVersions + :param ftps_state: State of FTP / FTPS service. Possible values include: "AllAllowed", + "FtpsOnly", "Disabled". + :type ftps_state: str or ~azure.mgmt.web.v2020_09_01.models.FtpsState + :param pre_warmed_instance_count: Number of preWarmed instances. + This setting only applies to the Consumption and Elastic Plans. + :type pre_warmed_instance_count: int + :param health_check_path: Health check path. + :type health_check_path: str + """ + + _validation = { + 'machine_key': {'readonly': True}, + 'pre_warmed_instance_count': {'maximum': 10, 'minimum': 0}, + } + + _attribute_map = { + 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, + 'default_documents': {'key': 'defaultDocuments', 'type': '[str]'}, + 'net_framework_version': {'key': 'netFrameworkVersion', 'type': 'str'}, + 'php_version': {'key': 'phpVersion', 'type': 'str'}, + 'python_version': {'key': 'pythonVersion', 'type': 'str'}, + 'node_version': {'key': 'nodeVersion', 'type': 'str'}, + 'power_shell_version': {'key': 'powerShellVersion', 'type': 'str'}, + 'linux_fx_version': {'key': 'linuxFxVersion', 'type': 'str'}, + 'windows_fx_version': {'key': 'windowsFxVersion', 'type': 'str'}, + 'request_tracing_enabled': {'key': 'requestTracingEnabled', 'type': 'bool'}, + 'request_tracing_expiration_time': {'key': 'requestTracingExpirationTime', 'type': 'iso-8601'}, + 'remote_debugging_enabled': {'key': 'remoteDebuggingEnabled', 'type': 'bool'}, + 'remote_debugging_version': {'key': 'remoteDebuggingVersion', 'type': 'str'}, + 'http_logging_enabled': {'key': 'httpLoggingEnabled', 'type': 'bool'}, + 'logs_directory_size_limit': {'key': 'logsDirectorySizeLimit', 'type': 'int'}, + 'detailed_error_logging_enabled': {'key': 'detailedErrorLoggingEnabled', 'type': 'bool'}, + 'publishing_username': {'key': 'publishingUsername', 'type': 'str'}, + 'app_settings': {'key': 'appSettings', 'type': '[NameValuePair]'}, + 'connection_strings': {'key': 'connectionStrings', 'type': '[ConnStringInfo]'}, + 'machine_key': {'key': 'machineKey', 'type': 'SiteMachineKey'}, + 'handler_mappings': {'key': 'handlerMappings', 'type': '[HandlerMapping]'}, + 'document_root': {'key': 'documentRoot', 'type': 'str'}, + 'scm_type': {'key': 'scmType', 'type': 'str'}, + 'use32_bit_worker_process': {'key': 'use32BitWorkerProcess', 'type': 'bool'}, + 'web_sockets_enabled': {'key': 'webSocketsEnabled', 'type': 'bool'}, + 'always_on': {'key': 'alwaysOn', 'type': 'bool'}, + 'java_version': {'key': 'javaVersion', 'type': 'str'}, + 'java_container': {'key': 'javaContainer', 'type': 'str'}, + 'java_container_version': {'key': 'javaContainerVersion', 'type': 'str'}, + 'app_command_line': {'key': 'appCommandLine', 'type': 'str'}, + 'managed_pipeline_mode': {'key': 'managedPipelineMode', 'type': 'str'}, + 'virtual_applications': {'key': 'virtualApplications', 'type': '[VirtualApplication]'}, + 'load_balancing': {'key': 'loadBalancing', 'type': 'str'}, + 'experiments': {'key': 'experiments', 'type': 'Experiments'}, + 'limits': {'key': 'limits', 'type': 'SiteLimits'}, + 'auto_heal_enabled': {'key': 'autoHealEnabled', 'type': 'bool'}, + 'auto_heal_rules': {'key': 'autoHealRules', 'type': 'AutoHealRules'}, + 'tracing_options': {'key': 'tracingOptions', 'type': 'str'}, + 'vnet_name': {'key': 'vnetName', 'type': 'str'}, + 'vnet_route_all_enabled': {'key': 'vnetRouteAllEnabled', 'type': 'bool'}, + 'vnet_private_ports_count': {'key': 'vnetPrivatePortsCount', 'type': 'int'}, + 'cors': {'key': 'cors', 'type': 'CorsSettings'}, + 'push': {'key': 'push', 'type': 'PushSettings'}, + 'api_definition': {'key': 'apiDefinition', 'type': 'ApiDefinitionInfo'}, + 'api_management_config': {'key': 'apiManagementConfig', 'type': 'ApiManagementConfig'}, + 'auto_swap_slot_name': {'key': 'autoSwapSlotName', 'type': 'str'}, + 'local_my_sql_enabled': {'key': 'localMySqlEnabled', 'type': 'bool'}, + 'managed_service_identity_id': {'key': 'managedServiceIdentityId', 'type': 'int'}, + 'x_managed_service_identity_id': {'key': 'xManagedServiceIdentityId', 'type': 'int'}, + 'ip_security_restrictions': {'key': 'ipSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions': {'key': 'scmIpSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions_use_main': {'key': 'scmIpSecurityRestrictionsUseMain', 'type': 'bool'}, + 'http20_enabled': {'key': 'http20Enabled', 'type': 'bool'}, + 'min_tls_version': {'key': 'minTlsVersion', 'type': 'str'}, + 'scm_min_tls_version': {'key': 'scmMinTlsVersion', 'type': 'str'}, + 'ftps_state': {'key': 'ftpsState', 'type': 'str'}, + 'pre_warmed_instance_count': {'key': 'preWarmedInstanceCount', 'type': 'int'}, + 'health_check_path': {'key': 'healthCheckPath', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteConfig, self).__init__(**kwargs) + self.number_of_workers = kwargs.get('number_of_workers', None) + self.default_documents = kwargs.get('default_documents', None) + self.net_framework_version = kwargs.get('net_framework_version', "v4.6") + self.php_version = kwargs.get('php_version', None) + self.python_version = kwargs.get('python_version', None) + self.node_version = kwargs.get('node_version', None) + self.power_shell_version = kwargs.get('power_shell_version', None) + self.linux_fx_version = kwargs.get('linux_fx_version', None) + self.windows_fx_version = kwargs.get('windows_fx_version', None) + self.request_tracing_enabled = kwargs.get('request_tracing_enabled', None) + self.request_tracing_expiration_time = kwargs.get('request_tracing_expiration_time', None) + self.remote_debugging_enabled = kwargs.get('remote_debugging_enabled', None) + self.remote_debugging_version = kwargs.get('remote_debugging_version', None) + self.http_logging_enabled = kwargs.get('http_logging_enabled', None) + self.logs_directory_size_limit = kwargs.get('logs_directory_size_limit', None) + self.detailed_error_logging_enabled = kwargs.get('detailed_error_logging_enabled', None) + self.publishing_username = kwargs.get('publishing_username', None) + self.app_settings = kwargs.get('app_settings', None) + self.connection_strings = kwargs.get('connection_strings', None) + self.machine_key = None + self.handler_mappings = kwargs.get('handler_mappings', None) + self.document_root = kwargs.get('document_root', None) + self.scm_type = kwargs.get('scm_type', None) + self.use32_bit_worker_process = kwargs.get('use32_bit_worker_process', None) + self.web_sockets_enabled = kwargs.get('web_sockets_enabled', None) + self.always_on = kwargs.get('always_on', None) + self.java_version = kwargs.get('java_version', None) + self.java_container = kwargs.get('java_container', None) + self.java_container_version = kwargs.get('java_container_version', None) + self.app_command_line = kwargs.get('app_command_line', None) + self.managed_pipeline_mode = kwargs.get('managed_pipeline_mode', None) + self.virtual_applications = kwargs.get('virtual_applications', None) + self.load_balancing = kwargs.get('load_balancing', None) + self.experiments = kwargs.get('experiments', None) + self.limits = kwargs.get('limits', None) + self.auto_heal_enabled = kwargs.get('auto_heal_enabled', None) + self.auto_heal_rules = kwargs.get('auto_heal_rules', None) + self.tracing_options = kwargs.get('tracing_options', None) + self.vnet_name = kwargs.get('vnet_name', None) + self.vnet_route_all_enabled = kwargs.get('vnet_route_all_enabled', None) + self.vnet_private_ports_count = kwargs.get('vnet_private_ports_count', None) + self.cors = kwargs.get('cors', None) + self.push = kwargs.get('push', None) + self.api_definition = kwargs.get('api_definition', None) + self.api_management_config = kwargs.get('api_management_config', None) + self.auto_swap_slot_name = kwargs.get('auto_swap_slot_name', None) + self.local_my_sql_enabled = kwargs.get('local_my_sql_enabled', False) + self.managed_service_identity_id = kwargs.get('managed_service_identity_id', None) + self.x_managed_service_identity_id = kwargs.get('x_managed_service_identity_id', None) + self.ip_security_restrictions = kwargs.get('ip_security_restrictions', None) + self.scm_ip_security_restrictions = kwargs.get('scm_ip_security_restrictions', None) + self.scm_ip_security_restrictions_use_main = kwargs.get('scm_ip_security_restrictions_use_main', None) + self.http20_enabled = kwargs.get('http20_enabled', True) + self.min_tls_version = kwargs.get('min_tls_version', None) + self.scm_min_tls_version = kwargs.get('scm_min_tls_version', None) + self.ftps_state = kwargs.get('ftps_state', None) + self.pre_warmed_instance_count = kwargs.get('pre_warmed_instance_count', None) + self.health_check_path = kwargs.get('health_check_path', None) + + +class SiteConfigResource(ProxyOnlyResource): + """Web app configuration ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param number_of_workers: Number of workers. + :type number_of_workers: int + :param default_documents: Default documents. + :type default_documents: list[str] + :param net_framework_version: .NET Framework version. + :type net_framework_version: str + :param php_version: Version of PHP. + :type php_version: str + :param python_version: Version of Python. + :type python_version: str + :param node_version: Version of Node.js. + :type node_version: str + :param power_shell_version: Version of PowerShell. + :type power_shell_version: str + :param linux_fx_version: Linux App Framework and version. + :type linux_fx_version: str + :param windows_fx_version: Xenon App Framework and version. + :type windows_fx_version: str + :param request_tracing_enabled: :code:`true` if request tracing is enabled; + otherwise, :code:`false`. + :type request_tracing_enabled: bool + :param request_tracing_expiration_time: Request tracing expiration time. + :type request_tracing_expiration_time: ~datetime.datetime + :param remote_debugging_enabled: :code:`true` if remote debugging is enabled; + otherwise, :code:`false`. + :type remote_debugging_enabled: bool + :param remote_debugging_version: Remote debugging version. + :type remote_debugging_version: str + :param http_logging_enabled: :code:`true` if HTTP logging is enabled; otherwise, + :code:`false`. + :type http_logging_enabled: bool + :param logs_directory_size_limit: HTTP logs directory size limit. + :type logs_directory_size_limit: int + :param detailed_error_logging_enabled: :code:`true` if detailed error logging is + enabled; otherwise, :code:`false`. + :type detailed_error_logging_enabled: bool + :param publishing_username: Publishing user name. + :type publishing_username: str + :param app_settings: Application settings. + :type app_settings: list[~azure.mgmt.web.v2020_09_01.models.NameValuePair] + :param connection_strings: Connection strings. + :type connection_strings: list[~azure.mgmt.web.v2020_09_01.models.ConnStringInfo] + :ivar machine_key: Site MachineKey. + :vartype machine_key: ~azure.mgmt.web.v2020_09_01.models.SiteMachineKey + :param handler_mappings: Handler mappings. + :type handler_mappings: list[~azure.mgmt.web.v2020_09_01.models.HandlerMapping] + :param document_root: Document root. + :type document_root: str + :param scm_type: SCM type. Possible values include: "None", "Dropbox", "Tfs", "LocalGit", + "GitHub", "CodePlexGit", "CodePlexHg", "BitbucketGit", "BitbucketHg", "ExternalGit", + "ExternalHg", "OneDrive", "VSO", "VSTSRM". + :type scm_type: str or ~azure.mgmt.web.v2020_09_01.models.ScmType + :param use32_bit_worker_process: :code:`true` to use 32-bit worker process; + otherwise, :code:`false`. + :type use32_bit_worker_process: bool + :param web_sockets_enabled: :code:`true` if WebSocket is enabled; otherwise, + :code:`false`. + :type web_sockets_enabled: bool + :param always_on: :code:`true` if Always On is enabled; otherwise, + :code:`false`. + :type always_on: bool + :param java_version: Java version. + :type java_version: str + :param java_container: Java container. + :type java_container: str + :param java_container_version: Java container version. + :type java_container_version: str + :param app_command_line: App command line to launch. + :type app_command_line: str + :param managed_pipeline_mode: Managed pipeline mode. Possible values include: "Integrated", + "Classic". + :type managed_pipeline_mode: str or ~azure.mgmt.web.v2020_09_01.models.ManagedPipelineMode + :param virtual_applications: Virtual applications. + :type virtual_applications: list[~azure.mgmt.web.v2020_09_01.models.VirtualApplication] + :param load_balancing: Site load balancing. Possible values include: "WeightedRoundRobin", + "LeastRequests", "LeastResponseTime", "WeightedTotalTraffic", "RequestHash". + :type load_balancing: str or ~azure.mgmt.web.v2020_09_01.models.SiteLoadBalancing + :param experiments: This is work around for polymorphic types. + :type experiments: ~azure.mgmt.web.v2020_09_01.models.Experiments + :param limits: Site limits. + :type limits: ~azure.mgmt.web.v2020_09_01.models.SiteLimits + :param auto_heal_enabled: :code:`true` if Auto Heal is enabled; otherwise, + :code:`false`. + :type auto_heal_enabled: bool + :param auto_heal_rules: Auto Heal rules. + :type auto_heal_rules: ~azure.mgmt.web.v2020_09_01.models.AutoHealRules + :param tracing_options: Tracing options. + :type tracing_options: str + :param vnet_name: Virtual Network name. + :type vnet_name: str + :param vnet_route_all_enabled: Virtual Network Route All enabled. This causes all outbound + traffic to have Virtual Network Security Groups and User Defined Routes applied. + :type vnet_route_all_enabled: bool + :param vnet_private_ports_count: The number of private ports assigned to this app. These will + be assigned dynamically on runtime. + :type vnet_private_ports_count: int + :param cors: Cross-Origin Resource Sharing (CORS) settings. + :type cors: ~azure.mgmt.web.v2020_09_01.models.CorsSettings + :param push: Push endpoint settings. + :type push: ~azure.mgmt.web.v2020_09_01.models.PushSettings + :param api_definition: Information about the formal API definition for the app. + :type api_definition: ~azure.mgmt.web.v2020_09_01.models.ApiDefinitionInfo + :param api_management_config: Azure API management settings linked to the app. + :type api_management_config: ~azure.mgmt.web.v2020_09_01.models.ApiManagementConfig + :param auto_swap_slot_name: Auto-swap slot name. + :type auto_swap_slot_name: str + :param local_my_sql_enabled: :code:`true` to enable local MySQL; otherwise, + :code:`false`. + :type local_my_sql_enabled: bool + :param managed_service_identity_id: Managed Service Identity Id. + :type managed_service_identity_id: int + :param x_managed_service_identity_id: Explicit Managed Service Identity Id. + :type x_managed_service_identity_id: int + :param ip_security_restrictions: IP security restrictions for main. + :type ip_security_restrictions: list[~azure.mgmt.web.v2020_09_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions: IP security restrictions for scm. + :type scm_ip_security_restrictions: + list[~azure.mgmt.web.v2020_09_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions_use_main: IP security restrictions for scm to use main. + :type scm_ip_security_restrictions_use_main: bool + :param http20_enabled: Http20Enabled: configures a web site to allow clients to connect over + http2.0. + :type http20_enabled: bool + :param min_tls_version: MinTlsVersion: configures the minimum version of TLS required for SSL + requests. Possible values include: "1.0", "1.1", "1.2". + :type min_tls_version: str or ~azure.mgmt.web.v2020_09_01.models.SupportedTlsVersions + :param scm_min_tls_version: ScmMinTlsVersion: configures the minimum version of TLS required + for SSL requests for SCM site. Possible values include: "1.0", "1.1", "1.2". + :type scm_min_tls_version: str or ~azure.mgmt.web.v2020_09_01.models.SupportedTlsVersions + :param ftps_state: State of FTP / FTPS service. Possible values include: "AllAllowed", + "FtpsOnly", "Disabled". + :type ftps_state: str or ~azure.mgmt.web.v2020_09_01.models.FtpsState + :param pre_warmed_instance_count: Number of preWarmed instances. + This setting only applies to the Consumption and Elastic Plans. + :type pre_warmed_instance_count: int + :param health_check_path: Health check path. + :type health_check_path: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'machine_key': {'readonly': True}, + 'pre_warmed_instance_count': {'maximum': 10, 'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'number_of_workers': {'key': 'properties.numberOfWorkers', 'type': 'int'}, + 'default_documents': {'key': 'properties.defaultDocuments', 'type': '[str]'}, + 'net_framework_version': {'key': 'properties.netFrameworkVersion', 'type': 'str'}, + 'php_version': {'key': 'properties.phpVersion', 'type': 'str'}, + 'python_version': {'key': 'properties.pythonVersion', 'type': 'str'}, + 'node_version': {'key': 'properties.nodeVersion', 'type': 'str'}, + 'power_shell_version': {'key': 'properties.powerShellVersion', 'type': 'str'}, + 'linux_fx_version': {'key': 'properties.linuxFxVersion', 'type': 'str'}, + 'windows_fx_version': {'key': 'properties.windowsFxVersion', 'type': 'str'}, + 'request_tracing_enabled': {'key': 'properties.requestTracingEnabled', 'type': 'bool'}, + 'request_tracing_expiration_time': {'key': 'properties.requestTracingExpirationTime', 'type': 'iso-8601'}, + 'remote_debugging_enabled': {'key': 'properties.remoteDebuggingEnabled', 'type': 'bool'}, + 'remote_debugging_version': {'key': 'properties.remoteDebuggingVersion', 'type': 'str'}, + 'http_logging_enabled': {'key': 'properties.httpLoggingEnabled', 'type': 'bool'}, + 'logs_directory_size_limit': {'key': 'properties.logsDirectorySizeLimit', 'type': 'int'}, + 'detailed_error_logging_enabled': {'key': 'properties.detailedErrorLoggingEnabled', 'type': 'bool'}, + 'publishing_username': {'key': 'properties.publishingUsername', 'type': 'str'}, + 'app_settings': {'key': 'properties.appSettings', 'type': '[NameValuePair]'}, + 'connection_strings': {'key': 'properties.connectionStrings', 'type': '[ConnStringInfo]'}, + 'machine_key': {'key': 'properties.machineKey', 'type': 'SiteMachineKey'}, + 'handler_mappings': {'key': 'properties.handlerMappings', 'type': '[HandlerMapping]'}, + 'document_root': {'key': 'properties.documentRoot', 'type': 'str'}, + 'scm_type': {'key': 'properties.scmType', 'type': 'str'}, + 'use32_bit_worker_process': {'key': 'properties.use32BitWorkerProcess', 'type': 'bool'}, + 'web_sockets_enabled': {'key': 'properties.webSocketsEnabled', 'type': 'bool'}, + 'always_on': {'key': 'properties.alwaysOn', 'type': 'bool'}, + 'java_version': {'key': 'properties.javaVersion', 'type': 'str'}, + 'java_container': {'key': 'properties.javaContainer', 'type': 'str'}, + 'java_container_version': {'key': 'properties.javaContainerVersion', 'type': 'str'}, + 'app_command_line': {'key': 'properties.appCommandLine', 'type': 'str'}, + 'managed_pipeline_mode': {'key': 'properties.managedPipelineMode', 'type': 'str'}, + 'virtual_applications': {'key': 'properties.virtualApplications', 'type': '[VirtualApplication]'}, + 'load_balancing': {'key': 'properties.loadBalancing', 'type': 'str'}, + 'experiments': {'key': 'properties.experiments', 'type': 'Experiments'}, + 'limits': {'key': 'properties.limits', 'type': 'SiteLimits'}, + 'auto_heal_enabled': {'key': 'properties.autoHealEnabled', 'type': 'bool'}, + 'auto_heal_rules': {'key': 'properties.autoHealRules', 'type': 'AutoHealRules'}, + 'tracing_options': {'key': 'properties.tracingOptions', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_route_all_enabled': {'key': 'properties.vnetRouteAllEnabled', 'type': 'bool'}, + 'vnet_private_ports_count': {'key': 'properties.vnetPrivatePortsCount', 'type': 'int'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsSettings'}, + 'push': {'key': 'properties.push', 'type': 'PushSettings'}, + 'api_definition': {'key': 'properties.apiDefinition', 'type': 'ApiDefinitionInfo'}, + 'api_management_config': {'key': 'properties.apiManagementConfig', 'type': 'ApiManagementConfig'}, + 'auto_swap_slot_name': {'key': 'properties.autoSwapSlotName', 'type': 'str'}, + 'local_my_sql_enabled': {'key': 'properties.localMySqlEnabled', 'type': 'bool'}, + 'managed_service_identity_id': {'key': 'properties.managedServiceIdentityId', 'type': 'int'}, + 'x_managed_service_identity_id': {'key': 'properties.xManagedServiceIdentityId', 'type': 'int'}, + 'ip_security_restrictions': {'key': 'properties.ipSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions': {'key': 'properties.scmIpSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions_use_main': {'key': 'properties.scmIpSecurityRestrictionsUseMain', 'type': 'bool'}, + 'http20_enabled': {'key': 'properties.http20Enabled', 'type': 'bool'}, + 'min_tls_version': {'key': 'properties.minTlsVersion', 'type': 'str'}, + 'scm_min_tls_version': {'key': 'properties.scmMinTlsVersion', 'type': 'str'}, + 'ftps_state': {'key': 'properties.ftpsState', 'type': 'str'}, + 'pre_warmed_instance_count': {'key': 'properties.preWarmedInstanceCount', 'type': 'int'}, + 'health_check_path': {'key': 'properties.healthCheckPath', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteConfigResource, self).__init__(**kwargs) + self.number_of_workers = kwargs.get('number_of_workers', None) + self.default_documents = kwargs.get('default_documents', None) + self.net_framework_version = kwargs.get('net_framework_version', "v4.6") + self.php_version = kwargs.get('php_version', None) + self.python_version = kwargs.get('python_version', None) + self.node_version = kwargs.get('node_version', None) + self.power_shell_version = kwargs.get('power_shell_version', None) + self.linux_fx_version = kwargs.get('linux_fx_version', None) + self.windows_fx_version = kwargs.get('windows_fx_version', None) + self.request_tracing_enabled = kwargs.get('request_tracing_enabled', None) + self.request_tracing_expiration_time = kwargs.get('request_tracing_expiration_time', None) + self.remote_debugging_enabled = kwargs.get('remote_debugging_enabled', None) + self.remote_debugging_version = kwargs.get('remote_debugging_version', None) + self.http_logging_enabled = kwargs.get('http_logging_enabled', None) + self.logs_directory_size_limit = kwargs.get('logs_directory_size_limit', None) + self.detailed_error_logging_enabled = kwargs.get('detailed_error_logging_enabled', None) + self.publishing_username = kwargs.get('publishing_username', None) + self.app_settings = kwargs.get('app_settings', None) + self.connection_strings = kwargs.get('connection_strings', None) + self.machine_key = None + self.handler_mappings = kwargs.get('handler_mappings', None) + self.document_root = kwargs.get('document_root', None) + self.scm_type = kwargs.get('scm_type', None) + self.use32_bit_worker_process = kwargs.get('use32_bit_worker_process', None) + self.web_sockets_enabled = kwargs.get('web_sockets_enabled', None) + self.always_on = kwargs.get('always_on', None) + self.java_version = kwargs.get('java_version', None) + self.java_container = kwargs.get('java_container', None) + self.java_container_version = kwargs.get('java_container_version', None) + self.app_command_line = kwargs.get('app_command_line', None) + self.managed_pipeline_mode = kwargs.get('managed_pipeline_mode', None) + self.virtual_applications = kwargs.get('virtual_applications', None) + self.load_balancing = kwargs.get('load_balancing', None) + self.experiments = kwargs.get('experiments', None) + self.limits = kwargs.get('limits', None) + self.auto_heal_enabled = kwargs.get('auto_heal_enabled', None) + self.auto_heal_rules = kwargs.get('auto_heal_rules', None) + self.tracing_options = kwargs.get('tracing_options', None) + self.vnet_name = kwargs.get('vnet_name', None) + self.vnet_route_all_enabled = kwargs.get('vnet_route_all_enabled', None) + self.vnet_private_ports_count = kwargs.get('vnet_private_ports_count', None) + self.cors = kwargs.get('cors', None) + self.push = kwargs.get('push', None) + self.api_definition = kwargs.get('api_definition', None) + self.api_management_config = kwargs.get('api_management_config', None) + self.auto_swap_slot_name = kwargs.get('auto_swap_slot_name', None) + self.local_my_sql_enabled = kwargs.get('local_my_sql_enabled', False) + self.managed_service_identity_id = kwargs.get('managed_service_identity_id', None) + self.x_managed_service_identity_id = kwargs.get('x_managed_service_identity_id', None) + self.ip_security_restrictions = kwargs.get('ip_security_restrictions', None) + self.scm_ip_security_restrictions = kwargs.get('scm_ip_security_restrictions', None) + self.scm_ip_security_restrictions_use_main = kwargs.get('scm_ip_security_restrictions_use_main', None) + self.http20_enabled = kwargs.get('http20_enabled', True) + self.min_tls_version = kwargs.get('min_tls_version', None) + self.scm_min_tls_version = kwargs.get('scm_min_tls_version', None) + self.ftps_state = kwargs.get('ftps_state', None) + self.pre_warmed_instance_count = kwargs.get('pre_warmed_instance_count', None) + self.health_check_path = kwargs.get('health_check_path', None) + + +class SiteConfigResourceCollection(msrest.serialization.Model): + """Collection of site configurations. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.SiteConfigResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SiteConfigResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteConfigResourceCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class SiteConfigurationSnapshotInfo(ProxyOnlyResource): + """A snapshot of a web app configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar time: The time the snapshot was taken. + :vartype time: ~datetime.datetime + :ivar snapshot_id: The id of the snapshot. + :vartype snapshot_id: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'time': {'readonly': True}, + 'snapshot_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'time': {'key': 'properties.time', 'type': 'iso-8601'}, + 'snapshot_id': {'key': 'properties.snapshotId', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteConfigurationSnapshotInfo, self).__init__(**kwargs) + self.time = None + self.snapshot_id = None + + +class SiteConfigurationSnapshotInfoCollection(msrest.serialization.Model): + """Collection of metadata for the app configuration snapshots that can be restored. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.SiteConfigurationSnapshotInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SiteConfigurationSnapshotInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteConfigurationSnapshotInfoCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class SiteExtensionInfo(ProxyOnlyResource): + """Site Extension Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param extension_id: Site extension ID. + :type extension_id: str + :param title: + :type title: str + :param extension_type: Site extension type. Possible values include: "Gallery", "WebRoot". + :type extension_type: str or ~azure.mgmt.web.v2020_09_01.models.SiteExtensionType + :param summary: Summary description. + :type summary: str + :param description: Detailed description. + :type description: str + :param version: Version information. + :type version: str + :param extension_url: Extension URL. + :type extension_url: str + :param project_url: Project URL. + :type project_url: str + :param icon_url: Icon URL. + :type icon_url: str + :param license_url: License URL. + :type license_url: str + :param feed_url: Feed URL. + :type feed_url: str + :param authors: List of authors. + :type authors: list[str] + :param installer_command_line_params: Installer command line parameters. + :type installer_command_line_params: str + :param published_date_time: Published timestamp. + :type published_date_time: ~datetime.datetime + :param download_count: Count of downloads. + :type download_count: int + :param local_is_latest_version: :code:`true` if the local version is the latest + version; :code:`false` otherwise. + :type local_is_latest_version: bool + :param local_path: Local path. + :type local_path: str + :param installed_date_time: Installed timestamp. + :type installed_date_time: ~datetime.datetime + :param provisioning_state: Provisioning state. + :type provisioning_state: str + :param comment: Site Extension comment. + :type comment: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extension_id': {'key': 'properties.extension_id', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'extension_type': {'key': 'properties.extension_type', 'type': 'str'}, + 'summary': {'key': 'properties.summary', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'extension_url': {'key': 'properties.extension_url', 'type': 'str'}, + 'project_url': {'key': 'properties.project_url', 'type': 'str'}, + 'icon_url': {'key': 'properties.icon_url', 'type': 'str'}, + 'license_url': {'key': 'properties.license_url', 'type': 'str'}, + 'feed_url': {'key': 'properties.feed_url', 'type': 'str'}, + 'authors': {'key': 'properties.authors', 'type': '[str]'}, + 'installer_command_line_params': {'key': 'properties.installer_command_line_params', 'type': 'str'}, + 'published_date_time': {'key': 'properties.published_date_time', 'type': 'iso-8601'}, + 'download_count': {'key': 'properties.download_count', 'type': 'int'}, + 'local_is_latest_version': {'key': 'properties.local_is_latest_version', 'type': 'bool'}, + 'local_path': {'key': 'properties.local_path', 'type': 'str'}, + 'installed_date_time': {'key': 'properties.installed_date_time', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'comment': {'key': 'properties.comment', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteExtensionInfo, self).__init__(**kwargs) + self.extension_id = kwargs.get('extension_id', None) + self.title = kwargs.get('title', None) + self.extension_type = kwargs.get('extension_type', None) + self.summary = kwargs.get('summary', None) + self.description = kwargs.get('description', None) + self.version = kwargs.get('version', None) + self.extension_url = kwargs.get('extension_url', None) + self.project_url = kwargs.get('project_url', None) + self.icon_url = kwargs.get('icon_url', None) + self.license_url = kwargs.get('license_url', None) + self.feed_url = kwargs.get('feed_url', None) + self.authors = kwargs.get('authors', None) + self.installer_command_line_params = kwargs.get('installer_command_line_params', None) + self.published_date_time = kwargs.get('published_date_time', None) + self.download_count = kwargs.get('download_count', None) + self.local_is_latest_version = kwargs.get('local_is_latest_version', None) + self.local_path = kwargs.get('local_path', None) + self.installed_date_time = kwargs.get('installed_date_time', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.comment = kwargs.get('comment', None) + + +class SiteExtensionInfoCollection(msrest.serialization.Model): + """Collection of Kudu site extension information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.SiteExtensionInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SiteExtensionInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteExtensionInfoCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class SiteLimits(msrest.serialization.Model): + """Metric limits set on an app. + + :param max_percentage_cpu: Maximum allowed CPU usage percentage. + :type max_percentage_cpu: float + :param max_memory_in_mb: Maximum allowed memory usage in MB. + :type max_memory_in_mb: long + :param max_disk_size_in_mb: Maximum allowed disk size usage in MB. + :type max_disk_size_in_mb: long + """ + + _attribute_map = { + 'max_percentage_cpu': {'key': 'maxPercentageCpu', 'type': 'float'}, + 'max_memory_in_mb': {'key': 'maxMemoryInMb', 'type': 'long'}, + 'max_disk_size_in_mb': {'key': 'maxDiskSizeInMb', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteLimits, self).__init__(**kwargs) + self.max_percentage_cpu = kwargs.get('max_percentage_cpu', None) + self.max_memory_in_mb = kwargs.get('max_memory_in_mb', None) + self.max_disk_size_in_mb = kwargs.get('max_disk_size_in_mb', None) + + +class SiteLogsConfig(ProxyOnlyResource): + """Configuration of App Service site logs. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param application_logs: Application logs configuration. + :type application_logs: ~azure.mgmt.web.v2020_09_01.models.ApplicationLogsConfig + :param http_logs: HTTP logs configuration. + :type http_logs: ~azure.mgmt.web.v2020_09_01.models.HttpLogsConfig + :param failed_requests_tracing: Failed requests tracing configuration. + :type failed_requests_tracing: ~azure.mgmt.web.v2020_09_01.models.EnabledConfig + :param detailed_error_messages: Detailed error messages configuration. + :type detailed_error_messages: ~azure.mgmt.web.v2020_09_01.models.EnabledConfig + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'application_logs': {'key': 'properties.applicationLogs', 'type': 'ApplicationLogsConfig'}, + 'http_logs': {'key': 'properties.httpLogs', 'type': 'HttpLogsConfig'}, + 'failed_requests_tracing': {'key': 'properties.failedRequestsTracing', 'type': 'EnabledConfig'}, + 'detailed_error_messages': {'key': 'properties.detailedErrorMessages', 'type': 'EnabledConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteLogsConfig, self).__init__(**kwargs) + self.application_logs = kwargs.get('application_logs', None) + self.http_logs = kwargs.get('http_logs', None) + self.failed_requests_tracing = kwargs.get('failed_requests_tracing', None) + self.detailed_error_messages = kwargs.get('detailed_error_messages', None) + + +class SiteMachineKey(msrest.serialization.Model): + """MachineKey of an app. + + :param validation: MachineKey validation. + :type validation: str + :param validation_key: Validation key. + :type validation_key: str + :param decryption: Algorithm used for decryption. + :type decryption: str + :param decryption_key: Decryption key. + :type decryption_key: str + """ + + _attribute_map = { + 'validation': {'key': 'validation', 'type': 'str'}, + 'validation_key': {'key': 'validationKey', 'type': 'str'}, + 'decryption': {'key': 'decryption', 'type': 'str'}, + 'decryption_key': {'key': 'decryptionKey', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteMachineKey, self).__init__(**kwargs) + self.validation = kwargs.get('validation', None) + self.validation_key = kwargs.get('validation_key', None) + self.decryption = kwargs.get('decryption', None) + self.decryption_key = kwargs.get('decryption_key', None) + + +class SitePatchResource(ProxyOnlyResource): + """ARM resource for a site. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param identity: Managed service identity. + :type identity: ~azure.mgmt.web.v2020_09_01.models.ManagedServiceIdentity + :ivar state: Current state of the app. + :vartype state: str + :ivar host_names: Hostnames associated with the app. + :vartype host_names: list[str] + :ivar repository_site_name: Name of the repository site. + :vartype repository_site_name: str + :ivar usage_state: State indicating whether the app has exceeded its quota usage. Read-only. + Possible values include: "Normal", "Exceeded". + :vartype usage_state: str or ~azure.mgmt.web.v2020_09_01.models.UsageState + :param enabled: :code:`true` if the app is enabled; otherwise, + :code:`false`. Setting this value to false disables the app (takes the app + offline). + :type enabled: bool + :ivar enabled_host_names: Enabled hostnames for the app.Hostnames need to be assigned (see + HostNames) AND enabled. Otherwise, + the app is not served on those hostnames. + :vartype enabled_host_names: list[str] + :ivar availability_state: Management information availability state for the app. Possible + values include: "Normal", "Limited", "DisasterRecoveryMode". + :vartype availability_state: str or ~azure.mgmt.web.v2020_09_01.models.SiteAvailabilityState + :param host_name_ssl_states: Hostname SSL states are used to manage the SSL bindings for app's + hostnames. + :type host_name_ssl_states: list[~azure.mgmt.web.v2020_09_01.models.HostNameSslState] + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param reserved: :code:`true` if reserved; otherwise, :code:`false`. + :type reserved: bool + :param is_xenon: Obsolete: Hyper-V sandbox. + :type is_xenon: bool + :param hyper_v: Hyper-V sandbox. + :type hyper_v: bool + :ivar last_modified_time_utc: Last time the app was modified, in UTC. Read-only. + :vartype last_modified_time_utc: ~datetime.datetime + :param site_config: Configuration of the app. + :type site_config: ~azure.mgmt.web.v2020_09_01.models.SiteConfig + :ivar traffic_manager_host_names: Azure Traffic Manager hostnames associated with the app. + Read-only. + :vartype traffic_manager_host_names: list[str] + :param scm_site_also_stopped: :code:`true` to stop SCM (KUDU) site when the app is + stopped; otherwise, :code:`false`. The default is :code:`false`. + :type scm_site_also_stopped: bool + :ivar target_swap_slot: Specifies which deployment slot this app will swap into. Read-only. + :vartype target_swap_slot: str + :param hosting_environment_profile: App Service Environment to use for the app. + :type hosting_environment_profile: ~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentProfile + :param client_affinity_enabled: :code:`true` to enable client affinity; + :code:`false` to stop sending session affinity cookies, which route client + requests in the same session to the same instance. Default is :code:`true`. + :type client_affinity_enabled: bool + :param client_cert_enabled: :code:`true` to enable client certificate + authentication (TLS mutual authentication); otherwise, :code:`false`. Default is + :code:`false`. + :type client_cert_enabled: bool + :param client_cert_mode: This composes with ClientCertEnabled setting. + + + * ClientCertEnabled: false means ClientCert is ignored. + * ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + * ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or + accepted. Possible values include: "Required", "Optional". + :type client_cert_mode: str or ~azure.mgmt.web.v2020_09_01.models.ClientCertMode + :param client_cert_exclusion_paths: client certificate authentication comma-separated exclusion + paths. + :type client_cert_exclusion_paths: str + :param host_names_disabled: :code:`true` to disable the public hostnames of the + app; otherwise, :code:`false`. + If :code:`true`, the app is only accessible via API management process. + :type host_names_disabled: bool + :param custom_domain_verification_id: Unique identifier that verifies the custom domains + assigned to the app. Customer will add this id to a txt record for verification. + :type custom_domain_verification_id: str + :ivar outbound_ip_addresses: List of IP addresses that the app uses for outbound connections + (e.g. database access). Includes VIPs from tenants that site can be hosted with current + settings. Read-only. + :vartype outbound_ip_addresses: str + :ivar possible_outbound_ip_addresses: List of IP addresses that the app uses for outbound + connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read- + only. + :vartype possible_outbound_ip_addresses: str + :param container_size: Size of the function container. + :type container_size: int + :param daily_memory_time_quota: Maximum allowed daily memory-time quota (applicable on dynamic + apps only). + :type daily_memory_time_quota: int + :ivar suspended_till: App suspended till in case memory-time quota is exceeded. + :vartype suspended_till: ~datetime.datetime + :ivar max_number_of_workers: Maximum number of workers. + This only applies to Functions container. + :vartype max_number_of_workers: int + :param cloning_info: If specified during app creation, the app is cloned from a source app. + :type cloning_info: ~azure.mgmt.web.v2020_09_01.models.CloningInfo + :ivar resource_group: Name of the resource group the app belongs to. Read-only. + :vartype resource_group: str + :ivar is_default_container: :code:`true` if the app is a default container; + otherwise, :code:`false`. + :vartype is_default_container: bool + :ivar default_host_name: Default hostname of the app. Read-only. + :vartype default_host_name: str + :ivar slot_swap_status: Status of the last deployment slot swap operation. + :vartype slot_swap_status: ~azure.mgmt.web.v2020_09_01.models.SlotSwapStatus + :param https_only: HttpsOnly: configures a web site to accept only https requests. Issues + redirect for + http requests. + :type https_only: bool + :param redundancy_mode: Site redundancy mode. Possible values include: "None", "Manual", + "Failover", "ActiveActive", "GeoRedundant". + :type redundancy_mode: str or ~azure.mgmt.web.v2020_09_01.models.RedundancyMode + :ivar in_progress_operation_id: Specifies an operation id if this site has a pending operation. + :vartype in_progress_operation_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'state': {'readonly': True}, + 'host_names': {'readonly': True}, + 'repository_site_name': {'readonly': True}, + 'usage_state': {'readonly': True}, + 'enabled_host_names': {'readonly': True}, + 'availability_state': {'readonly': True}, + 'last_modified_time_utc': {'readonly': True}, + 'traffic_manager_host_names': {'readonly': True}, + 'target_swap_slot': {'readonly': True}, + 'outbound_ip_addresses': {'readonly': True}, + 'possible_outbound_ip_addresses': {'readonly': True}, + 'suspended_till': {'readonly': True}, + 'max_number_of_workers': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'is_default_container': {'readonly': True}, + 'default_host_name': {'readonly': True}, + 'slot_swap_status': {'readonly': True}, + 'in_progress_operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'repository_site_name': {'key': 'properties.repositorySiteName', 'type': 'str'}, + 'usage_state': {'key': 'properties.usageState', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'enabled_host_names': {'key': 'properties.enabledHostNames', 'type': '[str]'}, + 'availability_state': {'key': 'properties.availabilityState', 'type': 'str'}, + 'host_name_ssl_states': {'key': 'properties.hostNameSslStates', 'type': '[HostNameSslState]'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'last_modified_time_utc': {'key': 'properties.lastModifiedTimeUtc', 'type': 'iso-8601'}, + 'site_config': {'key': 'properties.siteConfig', 'type': 'SiteConfig'}, + 'traffic_manager_host_names': {'key': 'properties.trafficManagerHostNames', 'type': '[str]'}, + 'scm_site_also_stopped': {'key': 'properties.scmSiteAlsoStopped', 'type': 'bool'}, + 'target_swap_slot': {'key': 'properties.targetSwapSlot', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'client_affinity_enabled': {'key': 'properties.clientAffinityEnabled', 'type': 'bool'}, + 'client_cert_enabled': {'key': 'properties.clientCertEnabled', 'type': 'bool'}, + 'client_cert_mode': {'key': 'properties.clientCertMode', 'type': 'str'}, + 'client_cert_exclusion_paths': {'key': 'properties.clientCertExclusionPaths', 'type': 'str'}, + 'host_names_disabled': {'key': 'properties.hostNamesDisabled', 'type': 'bool'}, + 'custom_domain_verification_id': {'key': 'properties.customDomainVerificationId', 'type': 'str'}, + 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': 'str'}, + 'possible_outbound_ip_addresses': {'key': 'properties.possibleOutboundIpAddresses', 'type': 'str'}, + 'container_size': {'key': 'properties.containerSize', 'type': 'int'}, + 'daily_memory_time_quota': {'key': 'properties.dailyMemoryTimeQuota', 'type': 'int'}, + 'suspended_till': {'key': 'properties.suspendedTill', 'type': 'iso-8601'}, + 'max_number_of_workers': {'key': 'properties.maxNumberOfWorkers', 'type': 'int'}, + 'cloning_info': {'key': 'properties.cloningInfo', 'type': 'CloningInfo'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'is_default_container': {'key': 'properties.isDefaultContainer', 'type': 'bool'}, + 'default_host_name': {'key': 'properties.defaultHostName', 'type': 'str'}, + 'slot_swap_status': {'key': 'properties.slotSwapStatus', 'type': 'SlotSwapStatus'}, + 'https_only': {'key': 'properties.httpsOnly', 'type': 'bool'}, + 'redundancy_mode': {'key': 'properties.redundancyMode', 'type': 'str'}, + 'in_progress_operation_id': {'key': 'properties.inProgressOperationId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SitePatchResource, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.state = None + self.host_names = None + self.repository_site_name = None + self.usage_state = None + self.enabled = kwargs.get('enabled', None) + self.enabled_host_names = None + self.availability_state = None + self.host_name_ssl_states = kwargs.get('host_name_ssl_states', None) + self.server_farm_id = kwargs.get('server_farm_id', None) + self.reserved = kwargs.get('reserved', False) + self.is_xenon = kwargs.get('is_xenon', False) + self.hyper_v = kwargs.get('hyper_v', False) + self.last_modified_time_utc = None + self.site_config = kwargs.get('site_config', None) + self.traffic_manager_host_names = None + self.scm_site_also_stopped = kwargs.get('scm_site_also_stopped', False) + self.target_swap_slot = None + self.hosting_environment_profile = kwargs.get('hosting_environment_profile', None) + self.client_affinity_enabled = kwargs.get('client_affinity_enabled', None) + self.client_cert_enabled = kwargs.get('client_cert_enabled', None) + self.client_cert_mode = kwargs.get('client_cert_mode', None) + self.client_cert_exclusion_paths = kwargs.get('client_cert_exclusion_paths', None) + self.host_names_disabled = kwargs.get('host_names_disabled', None) + self.custom_domain_verification_id = kwargs.get('custom_domain_verification_id', None) + self.outbound_ip_addresses = None + self.possible_outbound_ip_addresses = None + self.container_size = kwargs.get('container_size', None) + self.daily_memory_time_quota = kwargs.get('daily_memory_time_quota', None) + self.suspended_till = None + self.max_number_of_workers = None + self.cloning_info = kwargs.get('cloning_info', None) + self.resource_group = None + self.is_default_container = None + self.default_host_name = None + self.slot_swap_status = None + self.https_only = kwargs.get('https_only', None) + self.redundancy_mode = kwargs.get('redundancy_mode', None) + self.in_progress_operation_id = None + + +class SitePhpErrorLogFlag(ProxyOnlyResource): + """Used for getting PHP error logging flag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param local_log_errors: Local log_errors setting. + :type local_log_errors: str + :param master_log_errors: Master log_errors setting. + :type master_log_errors: str + :param local_log_errors_max_length: Local log_errors_max_len setting. + :type local_log_errors_max_length: str + :param master_log_errors_max_length: Master log_errors_max_len setting. + :type master_log_errors_max_length: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'local_log_errors': {'key': 'properties.localLogErrors', 'type': 'str'}, + 'master_log_errors': {'key': 'properties.masterLogErrors', 'type': 'str'}, + 'local_log_errors_max_length': {'key': 'properties.localLogErrorsMaxLength', 'type': 'str'}, + 'master_log_errors_max_length': {'key': 'properties.masterLogErrorsMaxLength', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SitePhpErrorLogFlag, self).__init__(**kwargs) + self.local_log_errors = kwargs.get('local_log_errors', None) + self.master_log_errors = kwargs.get('master_log_errors', None) + self.local_log_errors_max_length = kwargs.get('local_log_errors_max_length', None) + self.master_log_errors_max_length = kwargs.get('master_log_errors_max_length', None) + + +class SiteSeal(msrest.serialization.Model): + """Site seal. + + All required parameters must be populated in order to send to Azure. + + :param html: Required. HTML snippet. + :type html: str + """ + + _validation = { + 'html': {'required': True}, + } + + _attribute_map = { + 'html': {'key': 'html', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteSeal, self).__init__(**kwargs) + self.html = kwargs['html'] + + +class SiteSealRequest(msrest.serialization.Model): + """Site seal request. + + :param light_theme: If :code:`true` use the light color theme for site seal; + otherwise, use the default color theme. + :type light_theme: bool + :param locale: Locale of site seal. + :type locale: str + """ + + _attribute_map = { + 'light_theme': {'key': 'lightTheme', 'type': 'bool'}, + 'locale': {'key': 'locale', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteSealRequest, self).__init__(**kwargs) + self.light_theme = kwargs.get('light_theme', None) + self.locale = kwargs.get('locale', None) + + +class SiteSourceControl(ProxyOnlyResource): + """Source control configuration for an app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param repo_url: Repository or source control URL. + :type repo_url: str + :param branch: Name of branch to use for deployment. + :type branch: str + :param is_manual_integration: :code:`true` to limit to manual integration; + :code:`false` to enable continuous integration (which configures webhooks into + online repos like GitHub). + :type is_manual_integration: bool + :param is_git_hub_action: :code:`true` if this is deployed via GitHub action. + :type is_git_hub_action: bool + :param deployment_rollback_enabled: :code:`true` to enable deployment rollback; + otherwise, :code:`false`. + :type deployment_rollback_enabled: bool + :param is_mercurial: :code:`true` for a Mercurial repository; + :code:`false` for a Git repository. + :type is_mercurial: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'repo_url': {'key': 'properties.repoUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'is_manual_integration': {'key': 'properties.isManualIntegration', 'type': 'bool'}, + 'is_git_hub_action': {'key': 'properties.isGitHubAction', 'type': 'bool'}, + 'deployment_rollback_enabled': {'key': 'properties.deploymentRollbackEnabled', 'type': 'bool'}, + 'is_mercurial': {'key': 'properties.isMercurial', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteSourceControl, self).__init__(**kwargs) + self.repo_url = kwargs.get('repo_url', None) + self.branch = kwargs.get('branch', None) + self.is_manual_integration = kwargs.get('is_manual_integration', None) + self.is_git_hub_action = kwargs.get('is_git_hub_action', None) + self.deployment_rollback_enabled = kwargs.get('deployment_rollback_enabled', None) + self.is_mercurial = kwargs.get('is_mercurial', None) + + +class SkuCapacity(msrest.serialization.Model): + """Description of the App Service plan scale options. + + :param minimum: Minimum number of workers for this App Service plan SKU. + :type minimum: int + :param maximum: Maximum number of workers for this App Service plan SKU. + :type maximum: int + :param default: Default number of workers for this App Service plan SKU. + :type default: int + :param scale_type: Available scale configurations for an App Service plan. + :type scale_type: str + """ + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuCapacity, self).__init__(**kwargs) + self.minimum = kwargs.get('minimum', None) + self.maximum = kwargs.get('maximum', None) + self.default = kwargs.get('default', None) + self.scale_type = kwargs.get('scale_type', None) + + +class SkuDescription(msrest.serialization.Model): + """Description of a SKU for a scalable resource. + + :param name: Name of the resource SKU. + :type name: str + :param tier: Service tier of the resource SKU. + :type tier: str + :param size: Size specifier of the resource SKU. + :type size: str + :param family: Family code of the resource SKU. + :type family: str + :param capacity: Current number of instances assigned to the resource. + :type capacity: int + :param sku_capacity: Min, max, and default scale values of the SKU. + :type sku_capacity: ~azure.mgmt.web.v2020_09_01.models.SkuCapacity + :param locations: Locations of the SKU. + :type locations: list[str] + :param capabilities: Capabilities of the SKU, e.g., is traffic manager enabled?. + :type capabilities: list[~azure.mgmt.web.v2020_09_01.models.Capability] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'sku_capacity': {'key': 'skuCapacity', 'type': 'SkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[Capability]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuDescription, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.capacity = kwargs.get('capacity', None) + self.sku_capacity = kwargs.get('sku_capacity', None) + self.locations = kwargs.get('locations', None) + self.capabilities = kwargs.get('capabilities', None) + + +class SkuInfo(msrest.serialization.Model): + """SKU discovery information. + + :param resource_type: Resource type that this SKU applies to. + :type resource_type: str + :param sku: Name and tier of the SKU. + :type sku: ~azure.mgmt.web.v2020_09_01.models.SkuDescription + :param capacity: Min, max, and default scale values of the SKU. + :type capacity: ~azure.mgmt.web.v2020_09_01.models.SkuCapacity + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInfo, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.sku = kwargs.get('sku', None) + self.capacity = kwargs.get('capacity', None) + + +class SkuInfoCollection(msrest.serialization.Model): + """Collection of SKU information. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.SkuInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SkuInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInfoCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class SkuInfos(msrest.serialization.Model): + """Collection of SKU information. + + :param resource_type: Resource type that this SKU applies to. + :type resource_type: str + :param skus: List of SKUs the subscription is able to use. + :type skus: list[~azure.mgmt.web.v2020_09_01.models.GlobalCsmSkuDescription] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'skus': {'key': 'skus', 'type': '[GlobalCsmSkuDescription]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInfos, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.skus = kwargs.get('skus', None) + + +class SlotConfigNamesResource(ProxyOnlyResource): + """Slot Config names azure resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param connection_string_names: List of connection string names. + :type connection_string_names: list[str] + :param app_setting_names: List of application settings names. + :type app_setting_names: list[str] + :param azure_storage_config_names: List of external Azure storage account identifiers. + :type azure_storage_config_names: list[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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'connection_string_names': {'key': 'properties.connectionStringNames', 'type': '[str]'}, + 'app_setting_names': {'key': 'properties.appSettingNames', 'type': '[str]'}, + 'azure_storage_config_names': {'key': 'properties.azureStorageConfigNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SlotConfigNamesResource, self).__init__(**kwargs) + self.connection_string_names = kwargs.get('connection_string_names', None) + self.app_setting_names = kwargs.get('app_setting_names', None) + self.azure_storage_config_names = kwargs.get('azure_storage_config_names', None) + + +class SlotDifference(ProxyOnlyResource): + """A setting difference between two deployment slots of an app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar level: Level of the difference: Information, Warning or Error. + :vartype level: str + :ivar setting_type: The type of the setting: General, AppSetting or ConnectionString. + :vartype setting_type: str + :ivar diff_rule: Rule that describes how to process the setting difference during a slot swap. + :vartype diff_rule: str + :ivar setting_name: Name of the setting. + :vartype setting_name: str + :ivar value_in_current_slot: Value of the setting in the current slot. + :vartype value_in_current_slot: str + :ivar value_in_target_slot: Value of the setting in the target slot. + :vartype value_in_target_slot: str + :ivar description: Description of the setting difference. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'level': {'readonly': True}, + 'setting_type': {'readonly': True}, + 'diff_rule': {'readonly': True}, + 'setting_name': {'readonly': True}, + 'value_in_current_slot': {'readonly': True}, + 'value_in_target_slot': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'level': {'key': 'properties.level', 'type': 'str'}, + 'setting_type': {'key': 'properties.settingType', 'type': 'str'}, + 'diff_rule': {'key': 'properties.diffRule', 'type': 'str'}, + 'setting_name': {'key': 'properties.settingName', 'type': 'str'}, + 'value_in_current_slot': {'key': 'properties.valueInCurrentSlot', 'type': 'str'}, + 'value_in_target_slot': {'key': 'properties.valueInTargetSlot', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SlotDifference, self).__init__(**kwargs) + self.level = None + self.setting_type = None + self.diff_rule = None + self.setting_name = None + self.value_in_current_slot = None + self.value_in_target_slot = None + self.description = None + + +class SlotDifferenceCollection(msrest.serialization.Model): + """Collection of slot differences. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.SlotDifference] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SlotDifference]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SlotDifferenceCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class SlotSwapStatus(msrest.serialization.Model): + """The status of the last successful slot swap operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar timestamp_utc: The time the last successful slot swap completed. + :vartype timestamp_utc: ~datetime.datetime + :ivar source_slot_name: The source slot of the last swap operation. + :vartype source_slot_name: str + :ivar destination_slot_name: The destination slot of the last swap operation. + :vartype destination_slot_name: str + """ + + _validation = { + 'timestamp_utc': {'readonly': True}, + 'source_slot_name': {'readonly': True}, + 'destination_slot_name': {'readonly': True}, + } + + _attribute_map = { + 'timestamp_utc': {'key': 'timestampUtc', 'type': 'iso-8601'}, + 'source_slot_name': {'key': 'sourceSlotName', 'type': 'str'}, + 'destination_slot_name': {'key': 'destinationSlotName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SlotSwapStatus, self).__init__(**kwargs) + self.timestamp_utc = None + self.source_slot_name = None + self.destination_slot_name = None + + +class SlowRequestsBasedTrigger(msrest.serialization.Model): + """Trigger based on request execution time. + + :param time_taken: Time taken. + :type time_taken: str + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + """ + + _attribute_map = { + 'time_taken': {'key': 'timeTaken', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SlowRequestsBasedTrigger, self).__init__(**kwargs) + self.time_taken = kwargs.get('time_taken', None) + self.count = kwargs.get('count', None) + self.time_interval = kwargs.get('time_interval', None) + + +class Snapshot(ProxyOnlyResource): + """A snapshot of an app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar time: The time the snapshot was taken. + :vartype time: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'time': {'key': 'properties.time', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Snapshot, self).__init__(**kwargs) + self.time = None + + +class SnapshotCollection(msrest.serialization.Model): + """Collection of snapshots which can be used to revert an app to a previous time. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.Snapshot] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Snapshot]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SnapshotCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class SnapshotRecoverySource(msrest.serialization.Model): + """Specifies the web app that snapshot contents will be retrieved from. + + :param location: Geographical location of the source web app, e.g. SouthEastAsia, + SouthCentralUS. + :type location: str + :param id: ARM resource ID of the source app. + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + for production slots and + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + for other slots. + :type id: str + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SnapshotRecoverySource, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.id = kwargs.get('id', None) + + +class SnapshotRestoreRequest(ProxyOnlyResource): + """Details about app recovery operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param snapshot_time: Point in time in which the app restore should be done, formatted as a + DateTime string. + :type snapshot_time: str + :param recovery_source: Optional. Specifies the web app that snapshot contents will be + retrieved from. + If empty, the targeted web app will be used as the source. + :type recovery_source: ~azure.mgmt.web.v2020_09_01.models.SnapshotRecoverySource + :param overwrite: If :code:`true` the restore operation can overwrite source app; + otherwise, :code:`false`. + :type overwrite: bool + :param recover_configuration: If true, site configuration, in addition to content, will be + reverted. + :type recover_configuration: bool + :param ignore_conflicting_host_names: If true, custom hostname conflicts will be ignored when + recovering to a target web app. + This setting is only necessary when RecoverConfiguration is enabled. + :type ignore_conflicting_host_names: bool + :param use_dr_secondary: If true, the snapshot is retrieved from DRSecondary endpoint. + :type use_dr_secondary: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'str'}, + 'recovery_source': {'key': 'properties.recoverySource', 'type': 'SnapshotRecoverySource'}, + 'overwrite': {'key': 'properties.overwrite', 'type': 'bool'}, + 'recover_configuration': {'key': 'properties.recoverConfiguration', 'type': 'bool'}, + 'ignore_conflicting_host_names': {'key': 'properties.ignoreConflictingHostNames', 'type': 'bool'}, + 'use_dr_secondary': {'key': 'properties.useDRSecondary', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(SnapshotRestoreRequest, self).__init__(**kwargs) + self.snapshot_time = kwargs.get('snapshot_time', None) + self.recovery_source = kwargs.get('recovery_source', None) + self.overwrite = kwargs.get('overwrite', None) + self.recover_configuration = kwargs.get('recover_configuration', None) + self.ignore_conflicting_host_names = kwargs.get('ignore_conflicting_host_names', None) + self.use_dr_secondary = kwargs.get('use_dr_secondary', None) + + +class Solution(msrest.serialization.Model): + """Class Representing Solution for problems detected. + + :param id: Solution Id. + :type id: float + :param display_name: Display Name of the solution. + :type display_name: str + :param order: Order of the solution. + :type order: float + :param description: Description of the solution. + :type description: str + :param type: Type of Solution. Possible values include: "QuickSolution", "DeepInvestigation", + "BestPractices". + :type type: str or ~azure.mgmt.web.v2020_09_01.models.SolutionType + :param data: Solution Data. + :type data: list[list[~azure.mgmt.web.v2020_09_01.models.NameValuePair]] + :param metadata: Solution Metadata. + :type metadata: list[list[~azure.mgmt.web.v2020_09_01.models.NameValuePair]] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'float'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'float'}, + 'description': {'key': 'description', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data': {'key': 'data', 'type': '[[NameValuePair]]'}, + 'metadata': {'key': 'metadata', 'type': '[[NameValuePair]]'}, + } + + def __init__( + self, + **kwargs + ): + super(Solution, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.display_name = kwargs.get('display_name', None) + self.order = kwargs.get('order', None) + self.description = kwargs.get('description', None) + self.type = kwargs.get('type', None) + self.data = kwargs.get('data', None) + self.metadata = kwargs.get('metadata', None) + + +class SourceControl(ProxyOnlyResource): + """The source control OAuth token. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param token: OAuth access token. + :type token: str + :param token_secret: OAuth access token secret. + :type token_secret: str + :param refresh_token: OAuth refresh token. + :type refresh_token: str + :param expiration_time: OAuth token expiration. + :type expiration_time: ~datetime.datetime + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'token': {'key': 'properties.token', 'type': 'str'}, + 'token_secret': {'key': 'properties.tokenSecret', 'type': 'str'}, + 'refresh_token': {'key': 'properties.refreshToken', 'type': 'str'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControl, self).__init__(**kwargs) + self.token = kwargs.get('token', None) + self.token_secret = kwargs.get('token_secret', None) + self.refresh_token = kwargs.get('refresh_token', None) + self.expiration_time = kwargs.get('expiration_time', None) + + +class SourceControlCollection(msrest.serialization.Model): + """Collection of source controls. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.SourceControl] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SourceControl]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StackMajorVersion(msrest.serialization.Model): + """Application stack major version. + + :param display_version: Application stack major version (display only). + :type display_version: str + :param runtime_version: Application stack major version (runtime only). + :type runtime_version: str + :param is_default: :code:`true` if this is the default major version; otherwise, + :code:`false`. + :type is_default: bool + :param minor_versions: Minor versions associated with the major version. + :type minor_versions: list[~azure.mgmt.web.v2020_09_01.models.StackMinorVersion] + :param application_insights: :code:`true` if this supports Application Insights; + otherwise, :code:`false`. + :type application_insights: bool + :param is_preview: :code:`true` if this stack is in Preview, otherwise + :code:`false`. + :type is_preview: bool + :param is_deprecated: :code:`true` if this stack has been deprecated, otherwise + :code:`false`. + :type is_deprecated: bool + :param is_hidden: :code:`true` if this stack should be hidden for new customers on + portal, otherwise :code:`false`. + :type is_hidden: bool + """ + + _attribute_map = { + 'display_version': {'key': 'displayVersion', 'type': 'str'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'minor_versions': {'key': 'minorVersions', 'type': '[StackMinorVersion]'}, + 'application_insights': {'key': 'applicationInsights', 'type': 'bool'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + 'is_deprecated': {'key': 'isDeprecated', 'type': 'bool'}, + 'is_hidden': {'key': 'isHidden', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(StackMajorVersion, self).__init__(**kwargs) + self.display_version = kwargs.get('display_version', None) + self.runtime_version = kwargs.get('runtime_version', None) + self.is_default = kwargs.get('is_default', None) + self.minor_versions = kwargs.get('minor_versions', None) + self.application_insights = kwargs.get('application_insights', None) + self.is_preview = kwargs.get('is_preview', None) + self.is_deprecated = kwargs.get('is_deprecated', None) + self.is_hidden = kwargs.get('is_hidden', None) + + +class StackMinorVersion(msrest.serialization.Model): + """Application stack minor version. + + :param display_version: Application stack minor version (display only). + :type display_version: str + :param runtime_version: Application stack minor version (runtime only). + :type runtime_version: str + :param is_default: :code:`true` if this is the default minor version; otherwise, + :code:`false`. + :type is_default: bool + :param is_remote_debugging_enabled: :code:`true` if this supports Remote + Debugging, otherwise :code:`false`. + :type is_remote_debugging_enabled: bool + """ + + _attribute_map = { + 'display_version': {'key': 'displayVersion', 'type': 'str'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'is_remote_debugging_enabled': {'key': 'isRemoteDebuggingEnabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(StackMinorVersion, self).__init__(**kwargs) + self.display_version = kwargs.get('display_version', None) + self.runtime_version = kwargs.get('runtime_version', None) + self.is_default = kwargs.get('is_default', None) + self.is_remote_debugging_enabled = kwargs.get('is_remote_debugging_enabled', None) + + +class StampCapacity(msrest.serialization.Model): + """Stamp capacity information. + + :param name: Name of the stamp. + :type name: str + :param available_capacity: Available capacity (# of machines, bytes of storage etc...). + :type available_capacity: long + :param total_capacity: Total capacity (# of machines, bytes of storage etc...). + :type total_capacity: long + :param unit: Name of the unit. + :type unit: str + :param compute_mode: Shared/dedicated workers. Possible values include: "Shared", "Dedicated", + "Dynamic". + :type compute_mode: str or ~azure.mgmt.web.v2020_09_01.models.ComputeModeOptions + :param worker_size: Size of the machines. Possible values include: "Small", "Medium", "Large", + "D1", "D2", "D3", "NestedSmall", "Default". + :type worker_size: str or ~azure.mgmt.web.v2020_09_01.models.WorkerSizeOptions + :param worker_size_id: Size ID of machines: + 0 - Small + 1 - Medium + 2 - Large. + :type worker_size_id: int + :param exclude_from_capacity_allocation: If :code:`true`, it includes basic apps. + Basic apps are not used for capacity allocation. + :type exclude_from_capacity_allocation: bool + :param is_applicable_for_all_compute_modes: :code:`true` if capacity is applicable + for all apps; otherwise, :code:`false`. + :type is_applicable_for_all_compute_modes: bool + :param site_mode: Shared or Dedicated. + :type site_mode: str + :param is_linux: Is this a linux stamp capacity. + :type is_linux: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'available_capacity': {'key': 'availableCapacity', 'type': 'long'}, + 'total_capacity': {'key': 'totalCapacity', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'compute_mode': {'key': 'computeMode', 'type': 'str'}, + 'worker_size': {'key': 'workerSize', 'type': 'str'}, + 'worker_size_id': {'key': 'workerSizeId', 'type': 'int'}, + 'exclude_from_capacity_allocation': {'key': 'excludeFromCapacityAllocation', 'type': 'bool'}, + 'is_applicable_for_all_compute_modes': {'key': 'isApplicableForAllComputeModes', 'type': 'bool'}, + 'site_mode': {'key': 'siteMode', 'type': 'str'}, + 'is_linux': {'key': 'isLinux', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(StampCapacity, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.available_capacity = kwargs.get('available_capacity', None) + self.total_capacity = kwargs.get('total_capacity', None) + self.unit = kwargs.get('unit', None) + self.compute_mode = kwargs.get('compute_mode', None) + self.worker_size = kwargs.get('worker_size', None) + self.worker_size_id = kwargs.get('worker_size_id', None) + self.exclude_from_capacity_allocation = kwargs.get('exclude_from_capacity_allocation', None) + self.is_applicable_for_all_compute_modes = kwargs.get('is_applicable_for_all_compute_modes', None) + self.site_mode = kwargs.get('site_mode', None) + self.is_linux = kwargs.get('is_linux', None) + + +class StampCapacityCollection(msrest.serialization.Model): + """Collection of stamp capacities. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.StampCapacity] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StampCapacity]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StampCapacityCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StaticSiteARMResource(Resource): + """Static Site ARM 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param sku: Description of a SKU for a scalable resource. + :type sku: ~azure.mgmt.web.v2020_09_01.models.SkuDescription + :ivar default_hostname: The default autogenerated hostname for the static site. + :vartype default_hostname: str + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :ivar custom_domains: The custom domains associated with this static site. + :vartype custom_domains: list[str] + :param repository_token: A user's github repository token. This is used to setup the Github + Actions workflow file and API secrets. + :type repository_token: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: ~azure.mgmt.web.v2020_09_01.models.StaticSiteBuildProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'default_hostname': {'readonly': True}, + 'custom_domains': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'default_hostname': {'key': 'properties.defaultHostname', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'custom_domains': {'key': 'properties.customDomains', 'type': '[str]'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteARMResource, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.default_hostname = None + self.repository_url = kwargs.get('repository_url', None) + self.branch = kwargs.get('branch', None) + self.custom_domains = None + self.repository_token = kwargs.get('repository_token', None) + self.build_properties = kwargs.get('build_properties', None) + + +class StaticSiteBuildARMResource(ProxyOnlyResource): + """Static Site Build ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar build_id: An identifier for the static site build. + :vartype build_id: str + :ivar source_branch: The source branch. + :vartype source_branch: str + :ivar pull_request_title: The title of a pull request that a static site build is related to. + :vartype pull_request_title: str + :ivar hostname: The hostname for a static site build. + :vartype hostname: str + :ivar created_time_utc: When this build was created. + :vartype created_time_utc: ~datetime.datetime + :ivar last_updated_on: When this build was updated. + :vartype last_updated_on: ~datetime.datetime + :ivar status: The status of the static site build. Possible values include: + "WaitingForDeployment", "Uploading", "Deploying", "Ready", "Failed", "Deleting", "Detached". + :vartype status: str or ~azure.mgmt.web.v2020_09_01.models.BuildStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'build_id': {'readonly': True}, + 'source_branch': {'readonly': True}, + 'pull_request_title': {'readonly': True}, + 'hostname': {'readonly': True}, + 'created_time_utc': {'readonly': True}, + 'last_updated_on': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'build_id': {'key': 'properties.buildId', 'type': 'str'}, + 'source_branch': {'key': 'properties.sourceBranch', 'type': 'str'}, + 'pull_request_title': {'key': 'properties.pullRequestTitle', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'created_time_utc': {'key': 'properties.createdTimeUtc', 'type': 'iso-8601'}, + 'last_updated_on': {'key': 'properties.lastUpdatedOn', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteBuildARMResource, self).__init__(**kwargs) + self.build_id = None + self.source_branch = None + self.pull_request_title = None + self.hostname = None + self.created_time_utc = None + self.last_updated_on = None + self.status = None + + +class StaticSiteBuildCollection(msrest.serialization.Model): + """Collection of static site builds. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.StaticSiteBuildARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteBuildARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteBuildCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StaticSiteBuildProperties(msrest.serialization.Model): + """Build properties for the static site. + + :param app_location: The path to the app code within the repository. + :type app_location: str + :param api_location: The path to the api code within the repository. + :type api_location: str + :param app_artifact_location: The path of the app artifacts after building. + :type app_artifact_location: str + """ + + _attribute_map = { + 'app_location': {'key': 'appLocation', 'type': 'str'}, + 'api_location': {'key': 'apiLocation', 'type': 'str'}, + 'app_artifact_location': {'key': 'appArtifactLocation', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteBuildProperties, self).__init__(**kwargs) + self.app_location = kwargs.get('app_location', None) + self.api_location = kwargs.get('api_location', None) + self.app_artifact_location = kwargs.get('app_artifact_location', None) + + +class StaticSiteCollection(msrest.serialization.Model): + """Collection of static sites. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.StaticSiteARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StaticSiteCustomDomainOverviewARMResource(ProxyOnlyResource): + """Static Site Custom Domain Overview ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar domain_name: The domain name for the static site custom domain. + :vartype domain_name: str + :ivar created_on: The date and time on which the custom domain was created for the static site. + :vartype created_on: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'domain_name': {'readonly': True}, + 'created_on': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'domain_name': {'key': 'properties.domainName', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteCustomDomainOverviewARMResource, self).__init__(**kwargs) + self.domain_name = None + self.created_on = None + + +class StaticSiteCustomDomainOverviewCollection(msrest.serialization.Model): + """Collection of static site custom domains. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.StaticSiteCustomDomainOverviewARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteCustomDomainOverviewARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteCustomDomainOverviewCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StaticSiteFunctionOverviewARMResource(ProxyOnlyResource): + """Static Site Function Overview ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar function_name: The name for the function. + :vartype function_name: str + :ivar trigger_type: The trigger type of the function. Possible values include: "HttpTrigger", + "Unknown". + :vartype trigger_type: str or ~azure.mgmt.web.v2020_09_01.models.TriggerTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'function_name': {'readonly': True}, + 'trigger_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'function_name': {'key': 'properties.functionName', 'type': 'str'}, + 'trigger_type': {'key': 'properties.triggerType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteFunctionOverviewARMResource, self).__init__(**kwargs) + self.function_name = None + self.trigger_type = None + + +class StaticSiteFunctionOverviewCollection(msrest.serialization.Model): + """Collection of static site functions. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.StaticSiteFunctionOverviewARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteFunctionOverviewARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteFunctionOverviewCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StaticSitePatchResource(ProxyOnlyResource): + """ARM resource for a static site when patching. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar default_hostname: The default autogenerated hostname for the static site. + :vartype default_hostname: str + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :ivar custom_domains: The custom domains associated with this static site. + :vartype custom_domains: list[str] + :param repository_token: A user's github repository token. This is used to setup the Github + Actions workflow file and API secrets. + :type repository_token: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: ~azure.mgmt.web.v2020_09_01.models.StaticSiteBuildProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'default_hostname': {'readonly': True}, + 'custom_domains': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'default_hostname': {'key': 'properties.defaultHostname', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'custom_domains': {'key': 'properties.customDomains', 'type': '[str]'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSitePatchResource, self).__init__(**kwargs) + self.default_hostname = None + self.repository_url = kwargs.get('repository_url', None) + self.branch = kwargs.get('branch', None) + self.custom_domains = None + self.repository_token = kwargs.get('repository_token', None) + self.build_properties = kwargs.get('build_properties', None) + + +class StaticSiteResetPropertiesARMResource(ProxyOnlyResource): + """Static Site Reset Properties ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param repository_token: The token which proves admin privileges to the repository. + :type repository_token: str + :param should_update_repository: Determines whether the repository should be updated with the + new properties. + :type should_update_repository: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'should_update_repository': {'key': 'properties.shouldUpdateRepository', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteResetPropertiesARMResource, self).__init__(**kwargs) + self.repository_token = kwargs.get('repository_token', None) + self.should_update_repository = kwargs.get('should_update_repository', None) + + +class StaticSitesWorkflowPreview(ProxyOnlyResource): + """Preview for the Static Site Workflow to be generated. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar path: The path for the workflow file to be generated. + :vartype path: str + :ivar contents: The contents for the workflow file to be generated. + :vartype contents: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'path': {'readonly': True}, + 'contents': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'contents': {'key': 'properties.contents', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSitesWorkflowPreview, self).__init__(**kwargs) + self.path = None + self.contents = None + + +class StaticSitesWorkflowPreviewRequest(ProxyOnlyResource): + """Request entity for previewing the Static Site workflow. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: ~azure.mgmt.web.v2020_09_01.models.StaticSiteBuildProperties + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSitesWorkflowPreviewRequest, self).__init__(**kwargs) + self.repository_url = kwargs.get('repository_url', None) + self.branch = kwargs.get('branch', None) + self.build_properties = kwargs.get('build_properties', None) + + +class StaticSiteUserARMResource(ProxyOnlyResource): + """Static Site User ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar provider: The identity provider for the static site user. + :vartype provider: str + :ivar user_id: The user id for the static site user. + :vartype user_id: str + :ivar display_name: The display name for the static site user. + :vartype display_name: str + :param roles: The roles for the static site user, in free-form string format. + :type roles: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provider': {'readonly': True}, + 'user_id': {'readonly': True}, + 'display_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteUserARMResource, self).__init__(**kwargs) + self.provider = None + self.user_id = None + self.display_name = None + self.roles = kwargs.get('roles', None) + + +class StaticSiteUserCollection(msrest.serialization.Model): + """Collection of static site custom users. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.StaticSiteUserARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteUserARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteUserCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StaticSiteUserInvitationRequestResource(ProxyOnlyResource): + """Static sites user roles invitation resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param domain: The domain name for the static site custom domain. + :type domain: str + :param provider: The identity provider for the static site user. + :type provider: str + :param user_details: The user id for the static site user. + :type user_details: str + :param roles: The roles for the static site user, in free-form string format. + :type roles: str + :param num_hours_to_expiration: The number of hours the sas token stays valid. + :type num_hours_to_expiration: int + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'domain': {'key': 'properties.domain', 'type': 'str'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + 'user_details': {'key': 'properties.userDetails', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': 'str'}, + 'num_hours_to_expiration': {'key': 'properties.numHoursToExpiration', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteUserInvitationRequestResource, self).__init__(**kwargs) + self.domain = kwargs.get('domain', None) + self.provider = kwargs.get('provider', None) + self.user_details = kwargs.get('user_details', None) + self.roles = kwargs.get('roles', None) + self.num_hours_to_expiration = kwargs.get('num_hours_to_expiration', None) + + +class StaticSiteUserInvitationResponseResource(ProxyOnlyResource): + """Static sites user roles invitation link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar expires_on: The expiration time of the invitation. + :vartype expires_on: ~datetime.datetime + :ivar invitation_url: The url for the invitation link. + :vartype invitation_url: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'expires_on': {'readonly': True}, + 'invitation_url': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'expires_on': {'key': 'properties.expiresOn', 'type': 'iso-8601'}, + 'invitation_url': {'key': 'properties.invitationUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteUserInvitationResponseResource, self).__init__(**kwargs) + self.expires_on = None + self.invitation_url = None + + +class StatusCodesBasedTrigger(msrest.serialization.Model): + """Trigger based on status code. + + :param status: HTTP status code. + :type status: int + :param sub_status: Request Sub Status. + :type sub_status: int + :param win32_status: Win32 error code. + :type win32_status: int + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'int'}, + 'sub_status': {'key': 'subStatus', 'type': 'int'}, + 'win32_status': {'key': 'win32Status', 'type': 'int'}, + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StatusCodesBasedTrigger, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.sub_status = kwargs.get('sub_status', None) + self.win32_status = kwargs.get('win32_status', None) + self.count = kwargs.get('count', None) + self.time_interval = kwargs.get('time_interval', None) + + +class StorageMigrationOptions(ProxyOnlyResource): + """Options for app content migration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param azurefiles_connection_string: AzureFiles connection string. + :type azurefiles_connection_string: str + :param azurefiles_share: AzureFiles share. + :type azurefiles_share: str + :param switch_site_after_migration: :code:`true`if the app should be switched + over; otherwise, :code:`false`. + :type switch_site_after_migration: bool + :param block_write_access_to_site: :code:`true` if the app should be read only + during copy operation; otherwise, :code:`false`. + :type block_write_access_to_site: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'azurefiles_connection_string': {'key': 'properties.azurefilesConnectionString', 'type': 'str'}, + 'azurefiles_share': {'key': 'properties.azurefilesShare', 'type': 'str'}, + 'switch_site_after_migration': {'key': 'properties.switchSiteAfterMigration', 'type': 'bool'}, + 'block_write_access_to_site': {'key': 'properties.blockWriteAccessToSite', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageMigrationOptions, self).__init__(**kwargs) + self.azurefiles_connection_string = kwargs.get('azurefiles_connection_string', None) + self.azurefiles_share = kwargs.get('azurefiles_share', None) + self.switch_site_after_migration = kwargs.get('switch_site_after_migration', False) + self.block_write_access_to_site = kwargs.get('block_write_access_to_site', False) + + +class StorageMigrationResponse(ProxyOnlyResource): + """Response for a migration of app content request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar operation_id: When server starts the migration process, it will return an operation ID + identifying that particular migration operation. + :vartype operation_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'operation_id': {'key': 'properties.operationId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageMigrationResponse, self).__init__(**kwargs) + self.operation_id = None + + +class StringDictionary(ProxyOnlyResource): + """String dictionary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param properties: Settings. + :type properties: dict[str, 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(StringDictionary, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class SwiftVirtualNetwork(ProxyOnlyResource): + """Swift Virtual Network Contract. This is used to enable the new Swift way of doing virtual network integration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param subnet_resource_id: The Virtual Network subnet's resource ID. This is the subnet that + this Web App will join. This subnet must have a delegation to Microsoft.Web/serverFarms defined + first. + :type subnet_resource_id: str + :param swift_supported: A flag that specifies if the scale unit this Web App is on supports + Swift integration. + :type swift_supported: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'subnet_resource_id': {'key': 'properties.subnetResourceId', 'type': 'str'}, + 'swift_supported': {'key': 'properties.swiftSupported', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(SwiftVirtualNetwork, self).__init__(**kwargs) + self.subnet_resource_id = kwargs.get('subnet_resource_id', None) + self.swift_supported = kwargs.get('swift_supported', None) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.web.v2020_09_01.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.web.v2020_09_01.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type 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, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class TldLegalAgreement(msrest.serialization.Model): + """Legal agreement for a top level domain. + + All required parameters must be populated in order to send to Azure. + + :param agreement_key: Required. Unique identifier for the agreement. + :type agreement_key: str + :param title: Required. Agreement title. + :type title: str + :param content: Required. Agreement details. + :type content: str + :param url: URL where a copy of the agreement details is hosted. + :type url: str + """ + + _validation = { + 'agreement_key': {'required': True}, + 'title': {'required': True}, + 'content': {'required': True}, + } + + _attribute_map = { + 'agreement_key': {'key': 'agreementKey', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'}, + 'content': {'key': 'content', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TldLegalAgreement, self).__init__(**kwargs) + self.agreement_key = kwargs['agreement_key'] + self.title = kwargs['title'] + self.content = kwargs['content'] + self.url = kwargs.get('url', None) + + +class TldLegalAgreementCollection(msrest.serialization.Model): + """Collection of top-level domain legal agreements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.TldLegalAgreement] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TldLegalAgreement]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TldLegalAgreementCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class TokenStore(ProxyOnlyResource): + """TokenStore. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param enabled: + :type enabled: bool + :param token_refresh_extension_hours: + :type token_refresh_extension_hours: float + :param file_system: + :type file_system: ~azure.mgmt.web.v2020_09_01.models.FileSystemTokenStore + :param azure_blob_storage: + :type azure_blob_storage: ~azure.mgmt.web.v2020_09_01.models.BlobStorageTokenStore + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'token_refresh_extension_hours': {'key': 'properties.tokenRefreshExtensionHours', 'type': 'float'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'FileSystemTokenStore'}, + 'azure_blob_storage': {'key': 'properties.azureBlobStorage', 'type': 'BlobStorageTokenStore'}, + } + + def __init__( + self, + **kwargs + ): + super(TokenStore, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.token_refresh_extension_hours = kwargs.get('token_refresh_extension_hours', None) + self.file_system = kwargs.get('file_system', None) + self.azure_blob_storage = kwargs.get('azure_blob_storage', None) + + +class TopLevelDomain(ProxyOnlyResource): + """A top level domain object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param privacy: If :code:`true`, then the top level domain supports domain + privacy; otherwise, :code:`false`. + :type privacy: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(TopLevelDomain, self).__init__(**kwargs) + self.privacy = kwargs.get('privacy', None) + + +class TopLevelDomainAgreementOption(msrest.serialization.Model): + """Options for retrieving the list of top level domain legal agreements. + + :param include_privacy: If :code:`true`, then the list of agreements will include + agreements for domain privacy as well; otherwise, :code:`false`. + :type include_privacy: bool + :param for_transfer: If :code:`true`, then the list of agreements will include + agreements for domain transfer as well; otherwise, :code:`false`. + :type for_transfer: bool + """ + + _attribute_map = { + 'include_privacy': {'key': 'includePrivacy', 'type': 'bool'}, + 'for_transfer': {'key': 'forTransfer', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(TopLevelDomainAgreementOption, self).__init__(**kwargs) + self.include_privacy = kwargs.get('include_privacy', None) + self.for_transfer = kwargs.get('for_transfer', None) + + +class TopLevelDomainCollection(msrest.serialization.Model): + """Collection of Top-level domains. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.TopLevelDomain] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TopLevelDomain]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TopLevelDomainCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class TriggeredJobHistory(ProxyOnlyResource): + """Triggered Web Job History. List of Triggered Web Job Run Information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param runs: List of triggered web job runs. + :type runs: list[~azure.mgmt.web.v2020_09_01.models.TriggeredJobRun] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'runs': {'key': 'properties.runs', 'type': '[TriggeredJobRun]'}, + } + + def __init__( + self, + **kwargs + ): + super(TriggeredJobHistory, self).__init__(**kwargs) + self.runs = kwargs.get('runs', None) + + +class TriggeredJobHistoryCollection(msrest.serialization.Model): + """Collection of Kudu continuous web job information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.TriggeredJobHistory] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TriggeredJobHistory]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TriggeredJobHistoryCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class TriggeredJobRun(ProxyOnlyResource): + """Triggered Web Job Run Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param web_job_id: Job ID. + :type web_job_id: str + :param web_job_name: Job name. + :type web_job_name: str + :param status: Job status. Possible values include: "Success", "Failed", "Error". + :type status: str or ~azure.mgmt.web.v2020_09_01.models.TriggeredWebJobStatus + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param end_time: End time. + :type end_time: ~datetime.datetime + :param duration: Job duration. + :type duration: str + :param output_url: Output URL. + :type output_url: str + :param error_url: Error URL. + :type error_url: str + :param url: Job URL. + :type url: str + :param job_name: Job name. + :type job_name: str + :param trigger: Job trigger. + :type trigger: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'web_job_id': {'key': 'properties.web_job_id', 'type': 'str'}, + 'web_job_name': {'key': 'properties.web_job_name', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.end_time', 'type': 'iso-8601'}, + 'duration': {'key': 'properties.duration', 'type': 'str'}, + 'output_url': {'key': 'properties.output_url', 'type': 'str'}, + 'error_url': {'key': 'properties.error_url', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'job_name': {'key': 'properties.job_name', 'type': 'str'}, + 'trigger': {'key': 'properties.trigger', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TriggeredJobRun, self).__init__(**kwargs) + self.web_job_id = kwargs.get('web_job_id', None) + self.web_job_name = kwargs.get('web_job_name', None) + self.status = kwargs.get('status', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.duration = kwargs.get('duration', None) + self.output_url = kwargs.get('output_url', None) + self.error_url = kwargs.get('error_url', None) + self.url = kwargs.get('url', None) + self.job_name = kwargs.get('job_name', None) + self.trigger = kwargs.get('trigger', None) + + +class TriggeredWebJob(ProxyOnlyResource): + """Triggered Web Job Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param latest_run: Latest job run information. + :type latest_run: ~azure.mgmt.web.v2020_09_01.models.TriggeredJobRun + :param history_url: History URL. + :type history_url: str + :param scheduler_logs_url: Scheduler Logs URL. + :type scheduler_logs_url: str + :param run_command: Run command. + :type run_command: str + :param url: Job URL. + :type url: str + :param extra_info_url: Extra Info URL. + :type extra_info_url: str + :param web_job_type: Job type. Possible values include: "Continuous", "Triggered". + :type web_job_type: str or ~azure.mgmt.web.v2020_09_01.models.WebJobType + :param error: Error information. + :type error: str + :param using_sdk: Using SDK?. + :type using_sdk: bool + :param settings: Job settings. + :type settings: dict[str, object] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'latest_run': {'key': 'properties.latest_run', 'type': 'TriggeredJobRun'}, + 'history_url': {'key': 'properties.history_url', 'type': 'str'}, + 'scheduler_logs_url': {'key': 'properties.scheduler_logs_url', 'type': 'str'}, + 'run_command': {'key': 'properties.run_command', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'extra_info_url': {'key': 'properties.extra_info_url', 'type': 'str'}, + 'web_job_type': {'key': 'properties.web_job_type', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'str'}, + 'using_sdk': {'key': 'properties.using_sdk', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(TriggeredWebJob, self).__init__(**kwargs) + self.latest_run = kwargs.get('latest_run', None) + self.history_url = kwargs.get('history_url', None) + self.scheduler_logs_url = kwargs.get('scheduler_logs_url', None) + self.run_command = kwargs.get('run_command', None) + self.url = kwargs.get('url', None) + self.extra_info_url = kwargs.get('extra_info_url', None) + self.web_job_type = kwargs.get('web_job_type', None) + self.error = kwargs.get('error', None) + self.using_sdk = kwargs.get('using_sdk', None) + self.settings = kwargs.get('settings', None) + + +class TriggeredWebJobCollection(msrest.serialization.Model): + """Collection of Kudu continuous web job information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.TriggeredWebJob] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TriggeredWebJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TriggeredWebJobCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class Twitter(ProxyOnlyResource): + """Twitter. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_09_01.models.TwitterRegistration + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'TwitterRegistration'}, + } + + def __init__( + self, + **kwargs + ): + super(Twitter, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.registration = kwargs.get('registration', None) + + +class TwitterRegistration(ProxyOnlyResource): + """TwitterRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param consumer_key: + :type consumer_key: str + :param consumer_secret_setting_name: + :type consumer_secret_setting_name: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'consumer_key': {'key': 'properties.consumerKey', 'type': 'str'}, + 'consumer_secret_setting_name': {'key': 'properties.consumerSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TwitterRegistration, self).__init__(**kwargs) + self.consumer_key = kwargs.get('consumer_key', None) + self.consumer_secret_setting_name = kwargs.get('consumer_secret_setting_name', None) + + +class Usage(ProxyOnlyResource): + """Usage of the quota resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar display_name: Friendly name shown in the UI. + :vartype display_name: str + :ivar resource_name: Name of the quota resource. + :vartype resource_name: str + :ivar unit: Units of measurement for the quota resource. + :vartype unit: str + :ivar current_value: The current value of the resource counter. + :vartype current_value: long + :ivar limit: The resource limit. + :vartype limit: long + :ivar next_reset_time: Next reset time for the resource counter. + :vartype next_reset_time: ~datetime.datetime + :ivar compute_mode: Compute mode used for this usage. Possible values include: "Shared", + "Dedicated", "Dynamic". + :vartype compute_mode: str or ~azure.mgmt.web.v2020_09_01.models.ComputeModeOptions + :ivar site_mode: Site mode used for this usage. + :vartype site_mode: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'display_name': {'readonly': True}, + 'resource_name': {'readonly': True}, + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'next_reset_time': {'readonly': True}, + 'compute_mode': {'readonly': True}, + 'site_mode': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'resource_name': {'key': 'properties.resourceName', 'type': 'str'}, + 'unit': {'key': 'properties.unit', 'type': 'str'}, + 'current_value': {'key': 'properties.currentValue', 'type': 'long'}, + 'limit': {'key': 'properties.limit', 'type': 'long'}, + 'next_reset_time': {'key': 'properties.nextResetTime', 'type': 'iso-8601'}, + 'compute_mode': {'key': 'properties.computeMode', 'type': 'str'}, + 'site_mode': {'key': 'properties.siteMode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Usage, self).__init__(**kwargs) + self.display_name = None + self.resource_name = None + self.unit = None + self.current_value = None + self.limit = None + self.next_reset_time = None + self.compute_mode = None + self.site_mode = None + + +class UsageCollection(msrest.serialization.Model): + """Collection of usages. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.Usage] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UsageCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class User(ProxyOnlyResource): + """User credentials used for publishing activity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param publishing_user_name: Username used for publishing. + :type publishing_user_name: str + :param publishing_password: Password used for publishing. + :type publishing_password: str + :param publishing_password_hash: Password hash used for publishing. + :type publishing_password_hash: str + :param publishing_password_hash_salt: Password hash salt used for publishing. + :type publishing_password_hash_salt: str + :param scm_uri: Url of SCM site. + :type scm_uri: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'publishing_user_name': {'key': 'properties.publishingUserName', 'type': 'str'}, + 'publishing_password': {'key': 'properties.publishingPassword', 'type': 'str'}, + 'publishing_password_hash': {'key': 'properties.publishingPasswordHash', 'type': 'str'}, + 'publishing_password_hash_salt': {'key': 'properties.publishingPasswordHashSalt', 'type': 'str'}, + 'scm_uri': {'key': 'properties.scmUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(User, self).__init__(**kwargs) + self.publishing_user_name = kwargs.get('publishing_user_name', None) + self.publishing_password = kwargs.get('publishing_password', None) + self.publishing_password_hash = kwargs.get('publishing_password_hash', None) + self.publishing_password_hash_salt = kwargs.get('publishing_password_hash_salt', None) + self.scm_uri = kwargs.get('scm_uri', None) + + +class ValidateRequest(msrest.serialization.Model): + """Resource validation request content. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name to verify. + :type name: str + :param type: Required. Resource type used for verification. Possible values include: + "ServerFarm", "Site". + :type type: str or ~azure.mgmt.web.v2020_09_01.models.ValidateResourceTypes + :param location: Required. Expected location of the resource. + :type location: str + :param server_farm_id: ARM resource ID of an App Service plan that would host the app. + :type server_farm_id: str + :param sku_name: Name of the target SKU for the App Service plan. + :type sku_name: str + :param need_linux_workers: :code:`true` if App Service plan is for Linux workers; + otherwise, :code:`false`. + :type need_linux_workers: bool + :param is_spot: :code:`true` if App Service plan is for Spot instances; otherwise, + :code:`false`. + :type is_spot: bool + :param capacity: Target capacity of the App Service plan (number of VMs). + :type capacity: int + :param hosting_environment: Name of App Service Environment where app or App Service plan + should be created. + :type hosting_environment: str + :param is_xenon: :code:`true` if App Service plan is running as a windows + container. + :type is_xenon: bool + :param container_registry_base_url: Base URL of the container registry. + :type container_registry_base_url: str + :param container_registry_username: Username for to access the container registry. + :type container_registry_username: str + :param container_registry_password: Password for to access the container registry. + :type container_registry_password: str + :param container_image_repository: Repository name (image name). + :type container_image_repository: str + :param container_image_tag: Image tag. + :type container_image_tag: str + :param container_image_platform: Platform (windows or linux). + :type container_image_platform: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + 'location': {'required': True}, + 'capacity': {'minimum': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'sku_name': {'key': 'properties.skuName', 'type': 'str'}, + 'need_linux_workers': {'key': 'properties.needLinuxWorkers', 'type': 'bool'}, + 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, + 'capacity': {'key': 'properties.capacity', 'type': 'int'}, + 'hosting_environment': {'key': 'properties.hostingEnvironment', 'type': 'str'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'container_registry_base_url': {'key': 'properties.containerRegistryBaseUrl', 'type': 'str'}, + 'container_registry_username': {'key': 'properties.containerRegistryUsername', 'type': 'str'}, + 'container_registry_password': {'key': 'properties.containerRegistryPassword', 'type': 'str'}, + 'container_image_repository': {'key': 'properties.containerImageRepository', 'type': 'str'}, + 'container_image_tag': {'key': 'properties.containerImageTag', 'type': 'str'}, + 'container_image_platform': {'key': 'properties.containerImagePlatform', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ValidateRequest, self).__init__(**kwargs) + self.name = kwargs['name'] + self.type = kwargs['type'] + self.location = kwargs['location'] + self.server_farm_id = kwargs.get('server_farm_id', None) + self.sku_name = kwargs.get('sku_name', None) + self.need_linux_workers = kwargs.get('need_linux_workers', None) + self.is_spot = kwargs.get('is_spot', None) + self.capacity = kwargs.get('capacity', None) + self.hosting_environment = kwargs.get('hosting_environment', None) + self.is_xenon = kwargs.get('is_xenon', None) + self.container_registry_base_url = kwargs.get('container_registry_base_url', None) + self.container_registry_username = kwargs.get('container_registry_username', None) + self.container_registry_password = kwargs.get('container_registry_password', None) + self.container_image_repository = kwargs.get('container_image_repository', None) + self.container_image_tag = kwargs.get('container_image_tag', None) + self.container_image_platform = kwargs.get('container_image_platform', None) + + +class ValidateResponse(msrest.serialization.Model): + """Describes the result of resource validation. + + :param status: Result of validation. + :type status: str + :param error: Error details for the case when validation fails. + :type error: ~azure.mgmt.web.v2020_09_01.models.ValidateResponseError + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ValidateResponseError'}, + } + + def __init__( + self, + **kwargs + ): + super(ValidateResponse, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) + + +class ValidateResponseError(msrest.serialization.Model): + """Error details for when validation fails. + + :param code: Validation error code. + :type code: str + :param message: Validation error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ValidateResponseError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class VirtualApplication(msrest.serialization.Model): + """Virtual application in an app. + + :param virtual_path: Virtual path. + :type virtual_path: str + :param physical_path: Physical path. + :type physical_path: str + :param preload_enabled: :code:`true` if preloading is enabled; otherwise, + :code:`false`. + :type preload_enabled: bool + :param virtual_directories: Virtual directories for virtual application. + :type virtual_directories: list[~azure.mgmt.web.v2020_09_01.models.VirtualDirectory] + """ + + _attribute_map = { + 'virtual_path': {'key': 'virtualPath', 'type': 'str'}, + 'physical_path': {'key': 'physicalPath', 'type': 'str'}, + 'preload_enabled': {'key': 'preloadEnabled', 'type': 'bool'}, + 'virtual_directories': {'key': 'virtualDirectories', 'type': '[VirtualDirectory]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualApplication, self).__init__(**kwargs) + self.virtual_path = kwargs.get('virtual_path', None) + self.physical_path = kwargs.get('physical_path', None) + self.preload_enabled = kwargs.get('preload_enabled', None) + self.virtual_directories = kwargs.get('virtual_directories', None) + + +class VirtualDirectory(msrest.serialization.Model): + """Directory for virtual application. + + :param virtual_path: Path to virtual application. + :type virtual_path: str + :param physical_path: Physical path. + :type physical_path: str + """ + + _attribute_map = { + 'virtual_path': {'key': 'virtualPath', 'type': 'str'}, + 'physical_path': {'key': 'physicalPath', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualDirectory, self).__init__(**kwargs) + self.virtual_path = kwargs.get('virtual_path', None) + self.physical_path = kwargs.get('physical_path', None) + + +class VirtualIPMapping(msrest.serialization.Model): + """Virtual IP mapping. + + :param virtual_ip: Virtual IP address. + :type virtual_ip: str + :param internal_http_port: Internal HTTP port. + :type internal_http_port: int + :param internal_https_port: Internal HTTPS port. + :type internal_https_port: int + :param in_use: Is virtual IP mapping in use. + :type in_use: bool + :param service_name: name of the service that virtual IP is assigned to. + :type service_name: str + """ + + _attribute_map = { + 'virtual_ip': {'key': 'virtualIP', 'type': 'str'}, + 'internal_http_port': {'key': 'internalHttpPort', 'type': 'int'}, + 'internal_https_port': {'key': 'internalHttpsPort', 'type': 'int'}, + 'in_use': {'key': 'inUse', 'type': 'bool'}, + 'service_name': {'key': 'serviceName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualIPMapping, self).__init__(**kwargs) + self.virtual_ip = kwargs.get('virtual_ip', None) + self.internal_http_port = kwargs.get('internal_http_port', None) + self.internal_https_port = kwargs.get('internal_https_port', None) + self.in_use = kwargs.get('in_use', None) + self.service_name = kwargs.get('service_name', None) + + +class VirtualNetworkProfile(msrest.serialization.Model): + """Specification for using a Virtual Network. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource id of the Virtual Network. + :type id: str + :ivar name: Name of the Virtual Network (read-only). + :vartype name: str + :ivar type: Resource type of the Virtual Network (read-only). + :vartype type: str + :param subnet: Subnet within the Virtual Network. + :type subnet: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkProfile, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = None + self.type = None + self.subnet = kwargs.get('subnet', None) + + +class VnetGateway(ProxyOnlyResource): + """The Virtual Network gateway contract. This is used to give the Virtual Network gateway access to the VPN package. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param vnet_name: The Virtual Network name. + :type vnet_name: str + :param vpn_package_uri: The URI where the VPN package can be downloaded. + :type vpn_package_uri: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vpn_package_uri': {'key': 'properties.vpnPackageUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VnetGateway, self).__init__(**kwargs) + self.vnet_name = kwargs.get('vnet_name', None) + self.vpn_package_uri = kwargs.get('vpn_package_uri', None) + + +class VnetInfo(ProxyOnlyResource): + """Virtual Network information contract. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param vnet_resource_id: The Virtual Network's resource ID. + :type vnet_resource_id: str + :ivar cert_thumbprint: The client certificate thumbprint. + :vartype cert_thumbprint: str + :param cert_blob: A certificate file (.cer) blob containing the public key of the private key + used to authenticate a + Point-To-Site VPN connection. + :type cert_blob: str + :ivar routes: The routes that this Virtual Network connection uses. + :vartype routes: list[~azure.mgmt.web.v2020_09_01.models.VnetRoute] + :ivar resync_required: :code:`true` if a resync is required; otherwise, + :code:`false`. + :vartype resync_required: bool + :param dns_servers: DNS servers to be used by this Virtual Network. This should be a comma- + separated list of IP addresses. + :type dns_servers: str + :param is_swift: Flag that is used to denote if this is VNET injection. + :type is_swift: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'cert_thumbprint': {'readonly': True}, + 'routes': {'readonly': True}, + 'resync_required': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'vnet_resource_id': {'key': 'properties.vnetResourceId', 'type': 'str'}, + 'cert_thumbprint': {'key': 'properties.certThumbprint', 'type': 'str'}, + 'cert_blob': {'key': 'properties.certBlob', 'type': 'str'}, + 'routes': {'key': 'properties.routes', 'type': '[VnetRoute]'}, + 'resync_required': {'key': 'properties.resyncRequired', 'type': 'bool'}, + 'dns_servers': {'key': 'properties.dnsServers', 'type': 'str'}, + 'is_swift': {'key': 'properties.isSwift', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(VnetInfo, self).__init__(**kwargs) + self.vnet_resource_id = kwargs.get('vnet_resource_id', None) + self.cert_thumbprint = None + self.cert_blob = kwargs.get('cert_blob', None) + self.routes = None + self.resync_required = None + self.dns_servers = kwargs.get('dns_servers', None) + self.is_swift = kwargs.get('is_swift', None) + + +class VnetParameters(ProxyOnlyResource): + """The required set of inputs to validate a VNET. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param vnet_resource_group: The Resource Group of the VNET to be validated. + :type vnet_resource_group: str + :param vnet_name: The name of the VNET to be validated. + :type vnet_name: str + :param vnet_subnet_name: The subnet name to be validated. + :type vnet_subnet_name: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'vnet_resource_group': {'key': 'properties.vnetResourceGroup', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'properties.vnetSubnetName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VnetParameters, self).__init__(**kwargs) + self.vnet_resource_group = kwargs.get('vnet_resource_group', None) + self.vnet_name = kwargs.get('vnet_name', None) + self.vnet_subnet_name = kwargs.get('vnet_subnet_name', None) + + +class VnetRoute(ProxyOnlyResource): + """Virtual Network route contract used to pass routing information for a Virtual Network. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param start_address: The starting address for this route. This may also include a CIDR + notation, in which case the end address must not be specified. + :type start_address: str + :param end_address: The ending address for this route. If the start address is specified in + CIDR notation, this must be omitted. + :type end_address: str + :param route_type: The type of route this is: + DEFAULT - By default, every app has routes to the local address ranges specified by RFC1918 + INHERITED - Routes inherited from the real Virtual Network routes + STATIC - Static route set on the app only + + These values will be used for syncing an app's routes with those from a Virtual Network. + Possible values include: "DEFAULT", "INHERITED", "STATIC". + :type route_type: str or ~azure.mgmt.web.v2020_09_01.models.RouteType + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'start_address': {'key': 'properties.startAddress', 'type': 'str'}, + 'end_address': {'key': 'properties.endAddress', 'type': 'str'}, + 'route_type': {'key': 'properties.routeType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VnetRoute, self).__init__(**kwargs) + self.start_address = kwargs.get('start_address', None) + self.end_address = kwargs.get('end_address', None) + self.route_type = kwargs.get('route_type', None) + + +class VnetValidationFailureDetails(ProxyOnlyResource): + """A class that describes the reason for a validation failure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param failed: A flag describing whether or not validation failed. + :type failed: bool + :param failed_tests: A list of tests that failed in the validation. + :type failed_tests: list[~azure.mgmt.web.v2020_09_01.models.VnetValidationTestFailure] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'failed': {'key': 'properties.failed', 'type': 'bool'}, + 'failed_tests': {'key': 'properties.failedTests', 'type': '[VnetValidationTestFailure]'}, + } + + def __init__( + self, + **kwargs + ): + super(VnetValidationFailureDetails, self).__init__(**kwargs) + self.failed = kwargs.get('failed', None) + self.failed_tests = kwargs.get('failed_tests', None) + + +class VnetValidationTestFailure(ProxyOnlyResource): + """A class that describes a test that failed during NSG and UDR validation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param test_name: The name of the test that failed. + :type test_name: str + :param details: The details of what caused the failure, e.g. the blocking rule name, etc. + :type details: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'test_name': {'key': 'properties.testName', 'type': 'str'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VnetValidationTestFailure, self).__init__(**kwargs) + self.test_name = kwargs.get('test_name', None) + self.details = kwargs.get('details', None) + + +class WebAppCollection(msrest.serialization.Model): + """Collection of App Service apps. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.Site] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Site]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WebAppCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class WebAppInstanceStatusCollection(msrest.serialization.Model): + """Collection of app instances. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.WebSiteInstanceStatus] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WebSiteInstanceStatus]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WebAppInstanceStatusCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class WebJob(ProxyOnlyResource): + """Web Job Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param run_command: Run command. + :type run_command: str + :param url: Job URL. + :type url: str + :param extra_info_url: Extra Info URL. + :type extra_info_url: str + :param web_job_type: Job type. Possible values include: "Continuous", "Triggered". + :type web_job_type: str or ~azure.mgmt.web.v2020_09_01.models.WebJobType + :param error: Error information. + :type error: str + :param using_sdk: Using SDK?. + :type using_sdk: bool + :param settings: Job settings. + :type settings: dict[str, object] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'run_command': {'key': 'properties.run_command', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'extra_info_url': {'key': 'properties.extra_info_url', 'type': 'str'}, + 'web_job_type': {'key': 'properties.web_job_type', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'str'}, + 'using_sdk': {'key': 'properties.using_sdk', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(WebJob, self).__init__(**kwargs) + self.run_command = kwargs.get('run_command', None) + self.url = kwargs.get('url', None) + self.extra_info_url = kwargs.get('extra_info_url', None) + self.web_job_type = kwargs.get('web_job_type', None) + self.error = kwargs.get('error', None) + self.using_sdk = kwargs.get('using_sdk', None) + self.settings = kwargs.get('settings', None) + + +class WebJobCollection(msrest.serialization.Model): + """Collection of Kudu web job information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.WebJob] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WebJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WebJobCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class WebSiteInstanceStatus(ProxyOnlyResource): + """WebSiteInstanceStatus. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param state: Possible values include: "READY", "STOPPED", "UNKNOWN". + :type state: str or ~azure.mgmt.web.v2020_09_01.models.SiteRuntimeState + :param status_url: Link to the GetStatusApi in Kudu. + :type status_url: str + :param detector_url: Link to the Diagnose and Solve Portal. + :type detector_url: str + :param console_url: Link to the console to web app instance. + :type console_url: str + :param health_check_url: Link to the console to web app instance. + :type health_check_url: str + :param containers: Dictionary of :code:``. + :type containers: dict[str, ~azure.mgmt.web.v2020_09_01.models.ContainerInfo] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'status_url': {'key': 'properties.statusUrl', 'type': 'str'}, + 'detector_url': {'key': 'properties.detectorUrl', 'type': 'str'}, + 'console_url': {'key': 'properties.consoleUrl', 'type': 'str'}, + 'health_check_url': {'key': 'properties.healthCheckUrl', 'type': 'str'}, + 'containers': {'key': 'properties.containers', 'type': '{ContainerInfo}'}, + } + + def __init__( + self, + **kwargs + ): + super(WebSiteInstanceStatus, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.status_url = kwargs.get('status_url', None) + self.detector_url = kwargs.get('detector_url', None) + self.console_url = kwargs.get('console_url', None) + self.health_check_url = kwargs.get('health_check_url', None) + self.containers = kwargs.get('containers', None) + + +class WorkerPool(msrest.serialization.Model): + """Worker pool of an App Service Environment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param worker_size_id: Worker size ID for referencing this worker pool. + :type worker_size_id: int + :param compute_mode: Shared or dedicated app hosting. Possible values include: "Shared", + "Dedicated", "Dynamic". + :type compute_mode: str or ~azure.mgmt.web.v2020_09_01.models.ComputeModeOptions + :param worker_size: VM size of the worker pool instances. + :type worker_size: str + :param worker_count: Number of instances in the worker pool. + :type worker_count: int + :ivar instance_names: Names of all instances in the worker pool (read only). + :vartype instance_names: list[str] + """ + + _validation = { + 'instance_names': {'readonly': True}, + } + + _attribute_map = { + 'worker_size_id': {'key': 'workerSizeId', 'type': 'int'}, + 'compute_mode': {'key': 'computeMode', 'type': 'str'}, + 'worker_size': {'key': 'workerSize', 'type': 'str'}, + 'worker_count': {'key': 'workerCount', 'type': 'int'}, + 'instance_names': {'key': 'instanceNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkerPool, self).__init__(**kwargs) + self.worker_size_id = kwargs.get('worker_size_id', None) + self.compute_mode = kwargs.get('compute_mode', None) + self.worker_size = kwargs.get('worker_size', None) + self.worker_count = kwargs.get('worker_count', None) + self.instance_names = None + + +class WorkerPoolCollection(msrest.serialization.Model): + """Collection of worker pools. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkerPoolResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkerPoolCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class WorkerPoolResource(ProxyOnlyResource): + """Worker pool of an App Service Environment ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param sku: Description of a SKU for a scalable resource. + :type sku: ~azure.mgmt.web.v2020_09_01.models.SkuDescription + :param worker_size_id: Worker size ID for referencing this worker pool. + :type worker_size_id: int + :param compute_mode: Shared or dedicated app hosting. Possible values include: "Shared", + "Dedicated", "Dynamic". + :type compute_mode: str or ~azure.mgmt.web.v2020_09_01.models.ComputeModeOptions + :param worker_size: VM size of the worker pool instances. + :type worker_size: str + :param worker_count: Number of instances in the worker pool. + :type worker_count: int + :ivar instance_names: Names of all instances in the worker pool (read only). + :vartype instance_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'instance_names': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'worker_size_id': {'key': 'properties.workerSizeId', 'type': 'int'}, + 'compute_mode': {'key': 'properties.computeMode', 'type': 'str'}, + 'worker_size': {'key': 'properties.workerSize', 'type': 'str'}, + 'worker_count': {'key': 'properties.workerCount', 'type': 'int'}, + 'instance_names': {'key': 'properties.instanceNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkerPoolResource, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.worker_size_id = kwargs.get('worker_size_id', None) + self.compute_mode = kwargs.get('compute_mode', None) + self.worker_size = kwargs.get('worker_size', None) + self.worker_count = kwargs.get('worker_count', None) + self.instance_names = None diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/models/_models_py3.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/models/_models_py3.py new file mode 100644 index 000000000000..658df7ac9206 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/models/_models_py3.py @@ -0,0 +1,19507 @@ +# 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. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._web_site_management_client_enums import * + + +class AbnormalTimePeriod(msrest.serialization.Model): + """Class representing Abnormal Time Period identified in diagnosis. + + :param start_time: Start time of the downtime. + :type start_time: ~datetime.datetime + :param end_time: End time of the downtime. + :type end_time: ~datetime.datetime + :param events: List of Possible Cause of downtime. + :type events: list[~azure.mgmt.web.v2020_09_01.models.DetectorAbnormalTimePeriod] + :param solutions: List of proposed solutions. + :type solutions: list[~azure.mgmt.web.v2020_09_01.models.Solution] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'events': {'key': 'events', 'type': '[DetectorAbnormalTimePeriod]'}, + 'solutions': {'key': 'solutions', 'type': '[Solution]'}, + } + + def __init__( + self, + *, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + events: Optional[List["DetectorAbnormalTimePeriod"]] = None, + solutions: Optional[List["Solution"]] = None, + **kwargs + ): + super(AbnormalTimePeriod, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.events = events + self.solutions = solutions + + +class Address(msrest.serialization.Model): + """Address information for domain registration. + + All required parameters must be populated in order to send to Azure. + + :param address1: Required. First line of an Address. + :type address1: str + :param address2: The second line of the Address. Optional. + :type address2: str + :param city: Required. The city for the address. + :type city: str + :param country: Required. The country for the address. + :type country: str + :param postal_code: Required. The postal code for the address. + :type postal_code: str + :param state: Required. The state or province for the address. + :type state: str + """ + + _validation = { + 'address1': {'required': True}, + 'city': {'required': True}, + 'country': {'required': True}, + 'postal_code': {'required': True}, + 'state': {'required': True}, + } + + _attribute_map = { + 'address1': {'key': 'address1', 'type': 'str'}, + 'address2': {'key': 'address2', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + *, + address1: str, + city: str, + country: str, + postal_code: str, + state: str, + address2: Optional[str] = None, + **kwargs + ): + super(Address, self).__init__(**kwargs) + self.address1 = address1 + self.address2 = address2 + self.city = city + self.country = country + self.postal_code = postal_code + self.state = state + + +class ProxyOnlyResource(msrest.serialization.Model): + """Azure proxy only resource. This resource is not tracked by Azure Resource Manager. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(ProxyOnlyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.kind = kind + self.type = None + self.system_data = None + + +class AddressResponse(ProxyOnlyResource): + """Describes main public IP address and any extra virtual IPs. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param service_ip_address: Main public virtual IP. + :type service_ip_address: str + :param internal_ip_address: Virtual Network internal IP address of the App Service Environment + if it is in internal load-balancing mode. + :type internal_ip_address: str + :param outbound_ip_addresses: IP addresses appearing on outbound connections. + :type outbound_ip_addresses: list[str] + :param vip_mappings: Additional virtual IPs. + :type vip_mappings: list[~azure.mgmt.web.v2020_09_01.models.VirtualIPMapping] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'service_ip_address': {'key': 'properties.serviceIpAddress', 'type': 'str'}, + 'internal_ip_address': {'key': 'properties.internalIpAddress', 'type': 'str'}, + 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': '[str]'}, + 'vip_mappings': {'key': 'properties.vipMappings', 'type': '[VirtualIPMapping]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + service_ip_address: Optional[str] = None, + internal_ip_address: Optional[str] = None, + outbound_ip_addresses: Optional[List[str]] = None, + vip_mappings: Optional[List["VirtualIPMapping"]] = None, + **kwargs + ): + super(AddressResponse, self).__init__(kind=kind, **kwargs) + self.service_ip_address = service_ip_address + self.internal_ip_address = internal_ip_address + self.outbound_ip_addresses = outbound_ip_addresses + self.vip_mappings = vip_mappings + + +class AllowedAudiencesValidation(ProxyOnlyResource): + """AllowedAudiencesValidation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param allowed_audiences: + :type allowed_audiences: list[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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + allowed_audiences: Optional[List[str]] = None, + **kwargs + ): + super(AllowedAudiencesValidation, self).__init__(kind=kind, **kwargs) + self.allowed_audiences = allowed_audiences + + +class AnalysisData(msrest.serialization.Model): + """Class Representing Detector Evidence used for analysis. + + :param source: Name of the Detector. + :type source: str + :param detector_definition: Detector Definition. + :type detector_definition: ~azure.mgmt.web.v2020_09_01.models.DetectorDefinition + :param metrics: Source Metrics. + :type metrics: list[~azure.mgmt.web.v2020_09_01.models.DiagnosticMetricSet] + :param data: Additional Source Data. + :type data: list[list[~azure.mgmt.web.v2020_09_01.models.NameValuePair]] + :param detector_meta_data: Detector Meta Data. + :type detector_meta_data: ~azure.mgmt.web.v2020_09_01.models.ResponseMetaData + """ + + _attribute_map = { + 'source': {'key': 'source', 'type': 'str'}, + 'detector_definition': {'key': 'detectorDefinition', 'type': 'DetectorDefinition'}, + 'metrics': {'key': 'metrics', 'type': '[DiagnosticMetricSet]'}, + 'data': {'key': 'data', 'type': '[[NameValuePair]]'}, + 'detector_meta_data': {'key': 'detectorMetaData', 'type': 'ResponseMetaData'}, + } + + def __init__( + self, + *, + source: Optional[str] = None, + detector_definition: Optional["DetectorDefinition"] = None, + metrics: Optional[List["DiagnosticMetricSet"]] = None, + data: Optional[List[List["NameValuePair"]]] = None, + detector_meta_data: Optional["ResponseMetaData"] = None, + **kwargs + ): + super(AnalysisData, self).__init__(**kwargs) + self.source = source + self.detector_definition = detector_definition + self.metrics = metrics + self.data = data + self.detector_meta_data = detector_meta_data + + +class AnalysisDefinition(ProxyOnlyResource): + """Definition of Analysis. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar description: Description of the Analysis. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(AnalysisDefinition, self).__init__(kind=kind, **kwargs) + self.description = None + + +class ApiDefinitionInfo(msrest.serialization.Model): + """Information about the formal API definition for the app. + + :param url: The URL of the API definition. + :type url: str + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__( + self, + *, + url: Optional[str] = None, + **kwargs + ): + super(ApiDefinitionInfo, self).__init__(**kwargs) + self.url = url + + +class ApiManagementConfig(msrest.serialization.Model): + """Azure API management (APIM) configuration linked to the app. + + :param id: APIM-Api Identifier. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(ApiManagementConfig, self).__init__(**kwargs) + self.id = id + + +class ApplicationLogsConfig(msrest.serialization.Model): + """Application logs configuration. + + :param file_system: Application logs to file system configuration. + :type file_system: ~azure.mgmt.web.v2020_09_01.models.FileSystemApplicationLogsConfig + :param azure_table_storage: Application logs to azure table storage configuration. + :type azure_table_storage: + ~azure.mgmt.web.v2020_09_01.models.AzureTableStorageApplicationLogsConfig + :param azure_blob_storage: Application logs to blob storage configuration. + :type azure_blob_storage: + ~azure.mgmt.web.v2020_09_01.models.AzureBlobStorageApplicationLogsConfig + """ + + _attribute_map = { + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemApplicationLogsConfig'}, + 'azure_table_storage': {'key': 'azureTableStorage', 'type': 'AzureTableStorageApplicationLogsConfig'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'AzureBlobStorageApplicationLogsConfig'}, + } + + def __init__( + self, + *, + file_system: Optional["FileSystemApplicationLogsConfig"] = None, + azure_table_storage: Optional["AzureTableStorageApplicationLogsConfig"] = None, + azure_blob_storage: Optional["AzureBlobStorageApplicationLogsConfig"] = None, + **kwargs + ): + super(ApplicationLogsConfig, self).__init__(**kwargs) + self.file_system = file_system + self.azure_table_storage = azure_table_storage + self.azure_blob_storage = azure_blob_storage + + +class ApplicationStack(msrest.serialization.Model): + """Application stack. + + :param name: Application stack name. + :type name: str + :param display: Application stack display name. + :type display: str + :param dependency: Application stack dependency. + :type dependency: str + :param major_versions: List of major versions available. + :type major_versions: list[~azure.mgmt.web.v2020_09_01.models.StackMajorVersion] + :param frameworks: List of frameworks associated with application stack. + :type frameworks: list[~azure.mgmt.web.v2020_09_01.models.ApplicationStack] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'str'}, + 'dependency': {'key': 'dependency', 'type': 'str'}, + 'major_versions': {'key': 'majorVersions', 'type': '[StackMajorVersion]'}, + 'frameworks': {'key': 'frameworks', 'type': '[ApplicationStack]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional[str] = None, + dependency: Optional[str] = None, + major_versions: Optional[List["StackMajorVersion"]] = None, + frameworks: Optional[List["ApplicationStack"]] = None, + **kwargs + ): + super(ApplicationStack, self).__init__(**kwargs) + self.name = name + self.display = display + self.dependency = dependency + self.major_versions = major_versions + self.frameworks = frameworks + + +class ApplicationStackCollection(msrest.serialization.Model): + """Collection of Application Stacks. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.ApplicationStackResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationStackResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ApplicationStackResource"], + **kwargs + ): + super(ApplicationStackCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ApplicationStackResource(ProxyOnlyResource): + """ARM resource for a ApplicationStack. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param name_properties_name: Application stack name. + :type name_properties_name: str + :param display: Application stack display name. + :type display: str + :param dependency: Application stack dependency. + :type dependency: str + :param major_versions: List of major versions available. + :type major_versions: list[~azure.mgmt.web.v2020_09_01.models.StackMajorVersion] + :param frameworks: List of frameworks associated with application stack. + :type frameworks: list[~azure.mgmt.web.v2020_09_01.models.ApplicationStack] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'display': {'key': 'properties.display', 'type': 'str'}, + 'dependency': {'key': 'properties.dependency', 'type': 'str'}, + 'major_versions': {'key': 'properties.majorVersions', 'type': '[StackMajorVersion]'}, + 'frameworks': {'key': 'properties.frameworks', 'type': '[ApplicationStack]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + name_properties_name: Optional[str] = None, + display: Optional[str] = None, + dependency: Optional[str] = None, + major_versions: Optional[List["StackMajorVersion"]] = None, + frameworks: Optional[List["ApplicationStack"]] = None, + **kwargs + ): + super(ApplicationStackResource, self).__init__(kind=kind, **kwargs) + self.name_properties_name = name_properties_name + self.display = display + self.dependency = dependency + self.major_versions = major_versions + self.frameworks = frameworks + + +class AppRegistration(ProxyOnlyResource): + """AppRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param app_id: + :type app_id: str + :param app_secret_setting_name: + :type app_secret_setting_name: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'app_id': {'key': 'properties.appId', 'type': 'str'}, + 'app_secret_setting_name': {'key': 'properties.appSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + app_id: Optional[str] = None, + app_secret_setting_name: Optional[str] = None, + **kwargs + ): + super(AppRegistration, self).__init__(kind=kind, **kwargs) + self.app_id = app_id + self.app_secret_setting_name = app_secret_setting_name + + +class AppServiceCertificate(msrest.serialization.Model): + """Key Vault container for a certificate that is purchased through Azure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param key_vault_id: Key Vault resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar provisioning_state: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.KeyVaultSecretStatus + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'key_vault_id': {'key': 'keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'keyVaultSecretName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + key_vault_id: Optional[str] = None, + key_vault_secret_name: Optional[str] = None, + **kwargs + ): + super(AppServiceCertificate, self).__init__(**kwargs) + self.key_vault_id = key_vault_id + self.key_vault_secret_name = key_vault_secret_name + self.provisioning_state = None + + +class AppServiceCertificateCollection(msrest.serialization.Model): + """Collection of certificate order certificates. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServiceCertificateResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["AppServiceCertificateResource"], + **kwargs + ): + super(AppServiceCertificateCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class Resource(msrest.serialization.Model): + """Azure resource. This resource is tracked in Azure Resource Manager. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.kind = kind + self.location = location + self.type = None + self.tags = tags + self.system_data = None + + +class AppServiceCertificateOrder(Resource): + """SSL certificate purchase order. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param certificates: State of the Key Vault secret. + :type certificates: dict[str, ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificate] + :param distinguished_name: Certificate distinguished name. + :type distinguished_name: str + :ivar domain_verification_token: Domain verification token. + :vartype domain_verification_token: str + :param validity_in_years: Duration in years (must be between 1 and 3). + :type validity_in_years: int + :param key_size: Certificate key size. + :type key_size: int + :param product_type: Certificate product type. Possible values include: + "StandardDomainValidatedSsl", "StandardDomainValidatedWildCardSsl". + :type product_type: str or ~azure.mgmt.web.v2020_09_01.models.CertificateProductType + :param auto_renew: :code:`true` if the certificate should be automatically renewed + when it expires; otherwise, :code:`false`. + :type auto_renew: bool + :ivar provisioning_state: Status of certificate order. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.ProvisioningState + :ivar status: Current order status. Possible values include: "Pendingissuance", "Issued", + "Revoked", "Canceled", "Denied", "Pendingrevocation", "PendingRekey", "Unused", "Expired", + "NotSubmitted". + :vartype status: str or ~azure.mgmt.web.v2020_09_01.models.CertificateOrderStatus + :ivar signed_certificate: Signed certificate. + :vartype signed_certificate: ~azure.mgmt.web.v2020_09_01.models.CertificateDetails + :param csr: Last CSR that was created for this order. + :type csr: str + :ivar intermediate: Intermediate certificate. + :vartype intermediate: ~azure.mgmt.web.v2020_09_01.models.CertificateDetails + :ivar root: Root certificate. + :vartype root: ~azure.mgmt.web.v2020_09_01.models.CertificateDetails + :ivar serial_number: Current serial number of the certificate. + :vartype serial_number: str + :ivar last_certificate_issuance_time: Certificate last issuance time. + :vartype last_certificate_issuance_time: ~datetime.datetime + :ivar expiration_time: Certificate expiration time. + :vartype expiration_time: ~datetime.datetime + :ivar is_private_key_external: :code:`true` if private key is external; otherwise, + :code:`false`. + :vartype is_private_key_external: bool + :ivar app_service_certificate_not_renewable_reasons: Reasons why App Service Certificate is not + renewable at the current moment. + :vartype app_service_certificate_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem] + :ivar next_auto_renewal_time_stamp: Time stamp when the certificate would be auto renewed next. + :vartype next_auto_renewal_time_stamp: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'domain_verification_token': {'readonly': True}, + 'validity_in_years': {'maximum': 3, 'minimum': 1}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'signed_certificate': {'readonly': True}, + 'intermediate': {'readonly': True}, + 'root': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'last_certificate_issuance_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'is_private_key_external': {'readonly': True}, + 'app_service_certificate_not_renewable_reasons': {'readonly': True}, + 'next_auto_renewal_time_stamp': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'certificates': {'key': 'properties.certificates', 'type': '{AppServiceCertificate}'}, + 'distinguished_name': {'key': 'properties.distinguishedName', 'type': 'str'}, + 'domain_verification_token': {'key': 'properties.domainVerificationToken', 'type': 'str'}, + 'validity_in_years': {'key': 'properties.validityInYears', 'type': 'int'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'signed_certificate': {'key': 'properties.signedCertificate', 'type': 'CertificateDetails'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'intermediate': {'key': 'properties.intermediate', 'type': 'CertificateDetails'}, + 'root': {'key': 'properties.root', 'type': 'CertificateDetails'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'last_certificate_issuance_time': {'key': 'properties.lastCertificateIssuanceTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + 'app_service_certificate_not_renewable_reasons': {'key': 'properties.appServiceCertificateNotRenewableReasons', 'type': '[str]'}, + 'next_auto_renewal_time_stamp': {'key': 'properties.nextAutoRenewalTimeStamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + certificates: Optional[Dict[str, "AppServiceCertificate"]] = None, + distinguished_name: Optional[str] = None, + validity_in_years: Optional[int] = 1, + key_size: Optional[int] = 2048, + product_type: Optional[Union[str, "CertificateProductType"]] = None, + auto_renew: Optional[bool] = True, + csr: Optional[str] = None, + **kwargs + ): + super(AppServiceCertificateOrder, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.certificates = certificates + self.distinguished_name = distinguished_name + self.domain_verification_token = None + self.validity_in_years = validity_in_years + self.key_size = key_size + self.product_type = product_type + self.auto_renew = auto_renew + self.provisioning_state = None + self.status = None + self.signed_certificate = None + self.csr = csr + self.intermediate = None + self.root = None + self.serial_number = None + self.last_certificate_issuance_time = None + self.expiration_time = None + self.is_private_key_external = None + self.app_service_certificate_not_renewable_reasons = None + self.next_auto_renewal_time_stamp = None + + +class AppServiceCertificateOrderCollection(msrest.serialization.Model): + """Collection of certificate orders. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrder] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServiceCertificateOrder]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["AppServiceCertificateOrder"], + **kwargs + ): + super(AppServiceCertificateOrderCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class AppServiceCertificateOrderPatchResource(ProxyOnlyResource): + """ARM resource for a certificate order that is purchased through Azure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param certificates: State of the Key Vault secret. + :type certificates: dict[str, ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificate] + :param distinguished_name: Certificate distinguished name. + :type distinguished_name: str + :ivar domain_verification_token: Domain verification token. + :vartype domain_verification_token: str + :param validity_in_years: Duration in years (must be between 1 and 3). + :type validity_in_years: int + :param key_size: Certificate key size. + :type key_size: int + :param product_type: Certificate product type. Possible values include: + "StandardDomainValidatedSsl", "StandardDomainValidatedWildCardSsl". + :type product_type: str or ~azure.mgmt.web.v2020_09_01.models.CertificateProductType + :param auto_renew: :code:`true` if the certificate should be automatically renewed + when it expires; otherwise, :code:`false`. + :type auto_renew: bool + :ivar provisioning_state: Status of certificate order. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.ProvisioningState + :ivar status: Current order status. Possible values include: "Pendingissuance", "Issued", + "Revoked", "Canceled", "Denied", "Pendingrevocation", "PendingRekey", "Unused", "Expired", + "NotSubmitted". + :vartype status: str or ~azure.mgmt.web.v2020_09_01.models.CertificateOrderStatus + :ivar signed_certificate: Signed certificate. + :vartype signed_certificate: ~azure.mgmt.web.v2020_09_01.models.CertificateDetails + :param csr: Last CSR that was created for this order. + :type csr: str + :ivar intermediate: Intermediate certificate. + :vartype intermediate: ~azure.mgmt.web.v2020_09_01.models.CertificateDetails + :ivar root: Root certificate. + :vartype root: ~azure.mgmt.web.v2020_09_01.models.CertificateDetails + :ivar serial_number: Current serial number of the certificate. + :vartype serial_number: str + :ivar last_certificate_issuance_time: Certificate last issuance time. + :vartype last_certificate_issuance_time: ~datetime.datetime + :ivar expiration_time: Certificate expiration time. + :vartype expiration_time: ~datetime.datetime + :ivar is_private_key_external: :code:`true` if private key is external; otherwise, + :code:`false`. + :vartype is_private_key_external: bool + :ivar app_service_certificate_not_renewable_reasons: Reasons why App Service Certificate is not + renewable at the current moment. + :vartype app_service_certificate_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem] + :ivar next_auto_renewal_time_stamp: Time stamp when the certificate would be auto renewed next. + :vartype next_auto_renewal_time_stamp: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'domain_verification_token': {'readonly': True}, + 'validity_in_years': {'maximum': 3, 'minimum': 1}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'signed_certificate': {'readonly': True}, + 'intermediate': {'readonly': True}, + 'root': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'last_certificate_issuance_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'is_private_key_external': {'readonly': True}, + 'app_service_certificate_not_renewable_reasons': {'readonly': True}, + 'next_auto_renewal_time_stamp': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'certificates': {'key': 'properties.certificates', 'type': '{AppServiceCertificate}'}, + 'distinguished_name': {'key': 'properties.distinguishedName', 'type': 'str'}, + 'domain_verification_token': {'key': 'properties.domainVerificationToken', 'type': 'str'}, + 'validity_in_years': {'key': 'properties.validityInYears', 'type': 'int'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'signed_certificate': {'key': 'properties.signedCertificate', 'type': 'CertificateDetails'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'intermediate': {'key': 'properties.intermediate', 'type': 'CertificateDetails'}, + 'root': {'key': 'properties.root', 'type': 'CertificateDetails'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'last_certificate_issuance_time': {'key': 'properties.lastCertificateIssuanceTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + 'app_service_certificate_not_renewable_reasons': {'key': 'properties.appServiceCertificateNotRenewableReasons', 'type': '[str]'}, + 'next_auto_renewal_time_stamp': {'key': 'properties.nextAutoRenewalTimeStamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + certificates: Optional[Dict[str, "AppServiceCertificate"]] = None, + distinguished_name: Optional[str] = None, + validity_in_years: Optional[int] = 1, + key_size: Optional[int] = 2048, + product_type: Optional[Union[str, "CertificateProductType"]] = None, + auto_renew: Optional[bool] = True, + csr: Optional[str] = None, + **kwargs + ): + super(AppServiceCertificateOrderPatchResource, self).__init__(kind=kind, **kwargs) + self.certificates = certificates + self.distinguished_name = distinguished_name + self.domain_verification_token = None + self.validity_in_years = validity_in_years + self.key_size = key_size + self.product_type = product_type + self.auto_renew = auto_renew + self.provisioning_state = None + self.status = None + self.signed_certificate = None + self.csr = csr + self.intermediate = None + self.root = None + self.serial_number = None + self.last_certificate_issuance_time = None + self.expiration_time = None + self.is_private_key_external = None + self.app_service_certificate_not_renewable_reasons = None + self.next_auto_renewal_time_stamp = None + + +class AppServiceCertificatePatchResource(ProxyOnlyResource): + """Key Vault container ARM resource for a certificate that is purchased through Azure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param key_vault_id: Key Vault resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar provisioning_state: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.KeyVaultSecretStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + key_vault_id: Optional[str] = None, + key_vault_secret_name: Optional[str] = None, + **kwargs + ): + super(AppServiceCertificatePatchResource, self).__init__(kind=kind, **kwargs) + self.key_vault_id = key_vault_id + self.key_vault_secret_name = key_vault_secret_name + self.provisioning_state = None + + +class AppServiceCertificateResource(Resource): + """Key Vault container ARM resource for a certificate that is purchased through Azure. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param key_vault_id: Key Vault resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar provisioning_state: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.KeyVaultSecretStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + key_vault_id: Optional[str] = None, + key_vault_secret_name: Optional[str] = None, + **kwargs + ): + super(AppServiceCertificateResource, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.key_vault_id = key_vault_id + self.key_vault_secret_name = key_vault_secret_name + self.provisioning_state = None + + +class AppServiceEnvironment(msrest.serialization.Model): + """Description of an App Service Environment. + + 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. + + :param name: Required. Name of the App Service Environment. + :type name: str + :param location: Required. Location of the App Service Environment, e.g. "West US". + :type location: str + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.ProvisioningState + :ivar status: Current status of the App Service Environment. Possible values include: + "Preparing", "Ready", "Scaling", "Deleting". + :vartype status: str or ~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentStatus + :param vnet_name: Name of the Virtual Network for the App Service Environment. + :type vnet_name: str + :param vnet_resource_group_name: Resource group of the Virtual Network. + :type vnet_resource_group_name: str + :param vnet_subnet_name: Subnet of the Virtual Network. + :type vnet_subnet_name: str + :param virtual_network: Required. Description of the Virtual Network. + :type virtual_network: ~azure.mgmt.web.v2020_09_01.models.VirtualNetworkProfile + :param internal_load_balancing_mode: Specifies which endpoints to serve internally in the + Virtual Network for the App Service Environment. Possible values include: "None", "Web", + "Publishing", "Web,Publishing". + :type internal_load_balancing_mode: str or ~azure.mgmt.web.v2020_09_01.models.LoadBalancingMode + :param multi_size: Front-end VM size, e.g. "Medium", "Large". + :type multi_size: str + :param multi_role_count: Number of front-end instances. + :type multi_role_count: int + :param worker_pools: Required. Description of worker pools with worker size IDs, VM sizes, and + number of workers in each pool. + :type worker_pools: list[~azure.mgmt.web.v2020_09_01.models.WorkerPool] + :param ipssl_address_count: Number of IP SSL addresses reserved for the App Service + Environment. + :type ipssl_address_count: int + :ivar database_edition: Edition of the metadata database for the App Service Environment, e.g. + "Standard". + :vartype database_edition: str + :ivar database_service_objective: Service objective of the metadata database for the App + Service Environment, e.g. "S0". + :vartype database_service_objective: str + :ivar upgrade_domains: Number of upgrade domains of the App Service Environment. + :vartype upgrade_domains: int + :ivar subscription_id: Subscription of the App Service Environment. + :vartype subscription_id: str + :param dns_suffix: DNS suffix of the App Service Environment. + :type dns_suffix: str + :ivar last_action: Last deployment action on the App Service Environment. + :vartype last_action: str + :ivar last_action_result: Result of the last deployment action on the App Service Environment. + :vartype last_action_result: str + :ivar allowed_multi_sizes: List of comma separated strings describing which VM sizes are + allowed for front-ends. + :vartype allowed_multi_sizes: str + :ivar allowed_worker_sizes: List of comma separated strings describing which VM sizes are + allowed for workers. + :vartype allowed_worker_sizes: str + :ivar maximum_number_of_machines: Maximum number of VMs in the App Service Environment. + :vartype maximum_number_of_machines: int + :ivar vip_mappings: Description of IP SSL mapping for the App Service Environment. + :vartype vip_mappings: list[~azure.mgmt.web.v2020_09_01.models.VirtualIPMapping] + :ivar environment_capacities: Current total, used, and available worker capacities. + :vartype environment_capacities: list[~azure.mgmt.web.v2020_09_01.models.StampCapacity] + :param network_access_control_list: Access control list for controlling traffic to the App + Service Environment. + :type network_access_control_list: + list[~azure.mgmt.web.v2020_09_01.models.NetworkAccessControlEntry] + :ivar environment_is_healthy: True/false indicating whether the App Service Environment is + healthy. + :vartype environment_is_healthy: bool + :ivar environment_status: Detailed message about with results of the last check of the App + Service Environment. + :vartype environment_status: str + :ivar resource_group: Resource group of the App Service Environment. + :vartype resource_group: str + :param front_end_scale_factor: Scale factor for front-ends. + :type front_end_scale_factor: int + :ivar default_front_end_scale_factor: Default Scale Factor for FrontEnds. + :vartype default_front_end_scale_factor: int + :param api_management_account_id: API Management Account associated with the App Service + Environment. + :type api_management_account_id: str + :param suspended: :code:`true` if the App Service Environment is suspended; + otherwise, :code:`false`. The environment can be suspended, e.g. when the + management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :type suspended: bool + :param dynamic_cache_enabled: True/false indicating whether the App Service Environment is + suspended. The environment can be suspended e.g. when the management endpoint is no longer + available + (most likely because NSG blocked the incoming traffic). + :type dynamic_cache_enabled: bool + :param cluster_settings: Custom settings for changing the behavior of the App Service + Environment. + :type cluster_settings: list[~azure.mgmt.web.v2020_09_01.models.NameValuePair] + :param user_whitelisted_ip_ranges: User added ip ranges to whitelist on ASE db. + :type user_whitelisted_ip_ranges: list[str] + :param has_linux_workers: Flag that displays whether an ASE has linux workers or not. + :type has_linux_workers: bool + :param ssl_cert_key_vault_id: Key Vault ID for ILB App Service Environment default SSL + certificate. + :type ssl_cert_key_vault_id: str + :param ssl_cert_key_vault_secret_name: Key Vault Secret Name for ILB App Service Environment + default SSL certificate. + :type ssl_cert_key_vault_secret_name: str + """ + + _validation = { + 'name': {'required': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'virtual_network': {'required': True}, + 'worker_pools': {'required': True}, + 'database_edition': {'readonly': True}, + 'database_service_objective': {'readonly': True}, + 'upgrade_domains': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'last_action': {'readonly': True}, + 'last_action_result': {'readonly': True}, + 'allowed_multi_sizes': {'readonly': True}, + 'allowed_worker_sizes': {'readonly': True}, + 'maximum_number_of_machines': {'readonly': True}, + 'vip_mappings': {'readonly': True}, + 'environment_capacities': {'readonly': True}, + 'environment_is_healthy': {'readonly': True}, + 'environment_status': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'default_front_end_scale_factor': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'vnet_name': {'key': 'vnetName', 'type': 'str'}, + 'vnet_resource_group_name': {'key': 'vnetResourceGroupName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'vnetSubnetName', 'type': 'str'}, + 'virtual_network': {'key': 'virtualNetwork', 'type': 'VirtualNetworkProfile'}, + 'internal_load_balancing_mode': {'key': 'internalLoadBalancingMode', 'type': 'str'}, + 'multi_size': {'key': 'multiSize', 'type': 'str'}, + 'multi_role_count': {'key': 'multiRoleCount', 'type': 'int'}, + 'worker_pools': {'key': 'workerPools', 'type': '[WorkerPool]'}, + 'ipssl_address_count': {'key': 'ipsslAddressCount', 'type': 'int'}, + 'database_edition': {'key': 'databaseEdition', 'type': 'str'}, + 'database_service_objective': {'key': 'databaseServiceObjective', 'type': 'str'}, + 'upgrade_domains': {'key': 'upgradeDomains', 'type': 'int'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'dns_suffix': {'key': 'dnsSuffix', 'type': 'str'}, + 'last_action': {'key': 'lastAction', 'type': 'str'}, + 'last_action_result': {'key': 'lastActionResult', 'type': 'str'}, + 'allowed_multi_sizes': {'key': 'allowedMultiSizes', 'type': 'str'}, + 'allowed_worker_sizes': {'key': 'allowedWorkerSizes', 'type': 'str'}, + 'maximum_number_of_machines': {'key': 'maximumNumberOfMachines', 'type': 'int'}, + 'vip_mappings': {'key': 'vipMappings', 'type': '[VirtualIPMapping]'}, + 'environment_capacities': {'key': 'environmentCapacities', 'type': '[StampCapacity]'}, + 'network_access_control_list': {'key': 'networkAccessControlList', 'type': '[NetworkAccessControlEntry]'}, + 'environment_is_healthy': {'key': 'environmentIsHealthy', 'type': 'bool'}, + 'environment_status': {'key': 'environmentStatus', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'front_end_scale_factor': {'key': 'frontEndScaleFactor', 'type': 'int'}, + 'default_front_end_scale_factor': {'key': 'defaultFrontEndScaleFactor', 'type': 'int'}, + 'api_management_account_id': {'key': 'apiManagementAccountId', 'type': 'str'}, + 'suspended': {'key': 'suspended', 'type': 'bool'}, + 'dynamic_cache_enabled': {'key': 'dynamicCacheEnabled', 'type': 'bool'}, + 'cluster_settings': {'key': 'clusterSettings', 'type': '[NameValuePair]'}, + 'user_whitelisted_ip_ranges': {'key': 'userWhitelistedIpRanges', 'type': '[str]'}, + 'has_linux_workers': {'key': 'hasLinuxWorkers', 'type': 'bool'}, + 'ssl_cert_key_vault_id': {'key': 'sslCertKeyVaultId', 'type': 'str'}, + 'ssl_cert_key_vault_secret_name': {'key': 'sslCertKeyVaultSecretName', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + location: str, + virtual_network: "VirtualNetworkProfile", + worker_pools: List["WorkerPool"], + vnet_name: Optional[str] = None, + vnet_resource_group_name: Optional[str] = None, + vnet_subnet_name: Optional[str] = None, + internal_load_balancing_mode: Optional[Union[str, "LoadBalancingMode"]] = None, + multi_size: Optional[str] = None, + multi_role_count: Optional[int] = None, + ipssl_address_count: Optional[int] = None, + dns_suffix: Optional[str] = None, + network_access_control_list: Optional[List["NetworkAccessControlEntry"]] = None, + front_end_scale_factor: Optional[int] = None, + api_management_account_id: Optional[str] = None, + suspended: Optional[bool] = None, + dynamic_cache_enabled: Optional[bool] = None, + cluster_settings: Optional[List["NameValuePair"]] = None, + user_whitelisted_ip_ranges: Optional[List[str]] = None, + has_linux_workers: Optional[bool] = None, + ssl_cert_key_vault_id: Optional[str] = None, + ssl_cert_key_vault_secret_name: Optional[str] = None, + **kwargs + ): + super(AppServiceEnvironment, self).__init__(**kwargs) + self.name = name + self.location = location + self.provisioning_state = None + self.status = None + self.vnet_name = vnet_name + self.vnet_resource_group_name = vnet_resource_group_name + self.vnet_subnet_name = vnet_subnet_name + self.virtual_network = virtual_network + self.internal_load_balancing_mode = internal_load_balancing_mode + self.multi_size = multi_size + self.multi_role_count = multi_role_count + self.worker_pools = worker_pools + self.ipssl_address_count = ipssl_address_count + self.database_edition = None + self.database_service_objective = None + self.upgrade_domains = None + self.subscription_id = None + self.dns_suffix = dns_suffix + self.last_action = None + self.last_action_result = None + self.allowed_multi_sizes = None + self.allowed_worker_sizes = None + self.maximum_number_of_machines = None + self.vip_mappings = None + self.environment_capacities = None + self.network_access_control_list = network_access_control_list + self.environment_is_healthy = None + self.environment_status = None + self.resource_group = None + self.front_end_scale_factor = front_end_scale_factor + self.default_front_end_scale_factor = None + self.api_management_account_id = api_management_account_id + self.suspended = suspended + self.dynamic_cache_enabled = dynamic_cache_enabled + self.cluster_settings = cluster_settings + self.user_whitelisted_ip_ranges = user_whitelisted_ip_ranges + self.has_linux_workers = has_linux_workers + self.ssl_cert_key_vault_id = ssl_cert_key_vault_id + self.ssl_cert_key_vault_secret_name = ssl_cert_key_vault_secret_name + + +class AppServiceEnvironmentCollection(msrest.serialization.Model): + """Collection of App Service Environments. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.AppServiceEnvironmentResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServiceEnvironmentResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["AppServiceEnvironmentResource"], + **kwargs + ): + super(AppServiceEnvironmentCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class AppServiceEnvironmentPatchResource(ProxyOnlyResource): + """ARM resource for a app service environment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param name_properties_name: Name of the App Service Environment. + :type name_properties_name: str + :param location: Location of the App Service Environment, e.g. "West US". + :type location: str + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.ProvisioningState + :ivar status: Current status of the App Service Environment. Possible values include: + "Preparing", "Ready", "Scaling", "Deleting". + :vartype status: str or ~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentStatus + :param vnet_name: Name of the Virtual Network for the App Service Environment. + :type vnet_name: str + :param vnet_resource_group_name: Resource group of the Virtual Network. + :type vnet_resource_group_name: str + :param vnet_subnet_name: Subnet of the Virtual Network. + :type vnet_subnet_name: str + :param virtual_network: Description of the Virtual Network. + :type virtual_network: ~azure.mgmt.web.v2020_09_01.models.VirtualNetworkProfile + :param internal_load_balancing_mode: Specifies which endpoints to serve internally in the + Virtual Network for the App Service Environment. Possible values include: "None", "Web", + "Publishing", "Web,Publishing". + :type internal_load_balancing_mode: str or ~azure.mgmt.web.v2020_09_01.models.LoadBalancingMode + :param multi_size: Front-end VM size, e.g. "Medium", "Large". + :type multi_size: str + :param multi_role_count: Number of front-end instances. + :type multi_role_count: int + :param worker_pools: Description of worker pools with worker size IDs, VM sizes, and number of + workers in each pool. + :type worker_pools: list[~azure.mgmt.web.v2020_09_01.models.WorkerPool] + :param ipssl_address_count: Number of IP SSL addresses reserved for the App Service + Environment. + :type ipssl_address_count: int + :ivar database_edition: Edition of the metadata database for the App Service Environment, e.g. + "Standard". + :vartype database_edition: str + :ivar database_service_objective: Service objective of the metadata database for the App + Service Environment, e.g. "S0". + :vartype database_service_objective: str + :ivar upgrade_domains: Number of upgrade domains of the App Service Environment. + :vartype upgrade_domains: int + :ivar subscription_id: Subscription of the App Service Environment. + :vartype subscription_id: str + :param dns_suffix: DNS suffix of the App Service Environment. + :type dns_suffix: str + :ivar last_action: Last deployment action on the App Service Environment. + :vartype last_action: str + :ivar last_action_result: Result of the last deployment action on the App Service Environment. + :vartype last_action_result: str + :ivar allowed_multi_sizes: List of comma separated strings describing which VM sizes are + allowed for front-ends. + :vartype allowed_multi_sizes: str + :ivar allowed_worker_sizes: List of comma separated strings describing which VM sizes are + allowed for workers. + :vartype allowed_worker_sizes: str + :ivar maximum_number_of_machines: Maximum number of VMs in the App Service Environment. + :vartype maximum_number_of_machines: int + :ivar vip_mappings: Description of IP SSL mapping for the App Service Environment. + :vartype vip_mappings: list[~azure.mgmt.web.v2020_09_01.models.VirtualIPMapping] + :ivar environment_capacities: Current total, used, and available worker capacities. + :vartype environment_capacities: list[~azure.mgmt.web.v2020_09_01.models.StampCapacity] + :param network_access_control_list: Access control list for controlling traffic to the App + Service Environment. + :type network_access_control_list: + list[~azure.mgmt.web.v2020_09_01.models.NetworkAccessControlEntry] + :ivar environment_is_healthy: True/false indicating whether the App Service Environment is + healthy. + :vartype environment_is_healthy: bool + :ivar environment_status: Detailed message about with results of the last check of the App + Service Environment. + :vartype environment_status: str + :ivar resource_group: Resource group of the App Service Environment. + :vartype resource_group: str + :param front_end_scale_factor: Scale factor for front-ends. + :type front_end_scale_factor: int + :ivar default_front_end_scale_factor: Default Scale Factor for FrontEnds. + :vartype default_front_end_scale_factor: int + :param api_management_account_id: API Management Account associated with the App Service + Environment. + :type api_management_account_id: str + :param suspended: :code:`true` if the App Service Environment is suspended; + otherwise, :code:`false`. The environment can be suspended, e.g. when the + management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :type suspended: bool + :param dynamic_cache_enabled: True/false indicating whether the App Service Environment is + suspended. The environment can be suspended e.g. when the management endpoint is no longer + available + (most likely because NSG blocked the incoming traffic). + :type dynamic_cache_enabled: bool + :param cluster_settings: Custom settings for changing the behavior of the App Service + Environment. + :type cluster_settings: list[~azure.mgmt.web.v2020_09_01.models.NameValuePair] + :param user_whitelisted_ip_ranges: User added ip ranges to whitelist on ASE db. + :type user_whitelisted_ip_ranges: list[str] + :param has_linux_workers: Flag that displays whether an ASE has linux workers or not. + :type has_linux_workers: bool + :param ssl_cert_key_vault_id: Key Vault ID for ILB App Service Environment default SSL + certificate. + :type ssl_cert_key_vault_id: str + :param ssl_cert_key_vault_secret_name: Key Vault Secret Name for ILB App Service Environment + default SSL certificate. + :type ssl_cert_key_vault_secret_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'database_edition': {'readonly': True}, + 'database_service_objective': {'readonly': True}, + 'upgrade_domains': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'last_action': {'readonly': True}, + 'last_action_result': {'readonly': True}, + 'allowed_multi_sizes': {'readonly': True}, + 'allowed_worker_sizes': {'readonly': True}, + 'maximum_number_of_machines': {'readonly': True}, + 'vip_mappings': {'readonly': True}, + 'environment_capacities': {'readonly': True}, + 'environment_is_healthy': {'readonly': True}, + 'environment_status': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'default_front_end_scale_factor': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_resource_group_name': {'key': 'properties.vnetResourceGroupName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'properties.vnetSubnetName', 'type': 'str'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'VirtualNetworkProfile'}, + 'internal_load_balancing_mode': {'key': 'properties.internalLoadBalancingMode', 'type': 'str'}, + 'multi_size': {'key': 'properties.multiSize', 'type': 'str'}, + 'multi_role_count': {'key': 'properties.multiRoleCount', 'type': 'int'}, + 'worker_pools': {'key': 'properties.workerPools', 'type': '[WorkerPool]'}, + 'ipssl_address_count': {'key': 'properties.ipsslAddressCount', 'type': 'int'}, + 'database_edition': {'key': 'properties.databaseEdition', 'type': 'str'}, + 'database_service_objective': {'key': 'properties.databaseServiceObjective', 'type': 'str'}, + 'upgrade_domains': {'key': 'properties.upgradeDomains', 'type': 'int'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'dns_suffix': {'key': 'properties.dnsSuffix', 'type': 'str'}, + 'last_action': {'key': 'properties.lastAction', 'type': 'str'}, + 'last_action_result': {'key': 'properties.lastActionResult', 'type': 'str'}, + 'allowed_multi_sizes': {'key': 'properties.allowedMultiSizes', 'type': 'str'}, + 'allowed_worker_sizes': {'key': 'properties.allowedWorkerSizes', 'type': 'str'}, + 'maximum_number_of_machines': {'key': 'properties.maximumNumberOfMachines', 'type': 'int'}, + 'vip_mappings': {'key': 'properties.vipMappings', 'type': '[VirtualIPMapping]'}, + 'environment_capacities': {'key': 'properties.environmentCapacities', 'type': '[StampCapacity]'}, + 'network_access_control_list': {'key': 'properties.networkAccessControlList', 'type': '[NetworkAccessControlEntry]'}, + 'environment_is_healthy': {'key': 'properties.environmentIsHealthy', 'type': 'bool'}, + 'environment_status': {'key': 'properties.environmentStatus', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'front_end_scale_factor': {'key': 'properties.frontEndScaleFactor', 'type': 'int'}, + 'default_front_end_scale_factor': {'key': 'properties.defaultFrontEndScaleFactor', 'type': 'int'}, + 'api_management_account_id': {'key': 'properties.apiManagementAccountId', 'type': 'str'}, + 'suspended': {'key': 'properties.suspended', 'type': 'bool'}, + 'dynamic_cache_enabled': {'key': 'properties.dynamicCacheEnabled', 'type': 'bool'}, + 'cluster_settings': {'key': 'properties.clusterSettings', 'type': '[NameValuePair]'}, + 'user_whitelisted_ip_ranges': {'key': 'properties.userWhitelistedIpRanges', 'type': '[str]'}, + 'has_linux_workers': {'key': 'properties.hasLinuxWorkers', 'type': 'bool'}, + 'ssl_cert_key_vault_id': {'key': 'properties.sslCertKeyVaultId', 'type': 'str'}, + 'ssl_cert_key_vault_secret_name': {'key': 'properties.sslCertKeyVaultSecretName', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + name_properties_name: Optional[str] = None, + location: Optional[str] = None, + vnet_name: Optional[str] = None, + vnet_resource_group_name: Optional[str] = None, + vnet_subnet_name: Optional[str] = None, + virtual_network: Optional["VirtualNetworkProfile"] = None, + internal_load_balancing_mode: Optional[Union[str, "LoadBalancingMode"]] = None, + multi_size: Optional[str] = None, + multi_role_count: Optional[int] = None, + worker_pools: Optional[List["WorkerPool"]] = None, + ipssl_address_count: Optional[int] = None, + dns_suffix: Optional[str] = None, + network_access_control_list: Optional[List["NetworkAccessControlEntry"]] = None, + front_end_scale_factor: Optional[int] = None, + api_management_account_id: Optional[str] = None, + suspended: Optional[bool] = None, + dynamic_cache_enabled: Optional[bool] = None, + cluster_settings: Optional[List["NameValuePair"]] = None, + user_whitelisted_ip_ranges: Optional[List[str]] = None, + has_linux_workers: Optional[bool] = None, + ssl_cert_key_vault_id: Optional[str] = None, + ssl_cert_key_vault_secret_name: Optional[str] = None, + **kwargs + ): + super(AppServiceEnvironmentPatchResource, self).__init__(kind=kind, **kwargs) + self.name_properties_name = name_properties_name + self.location = location + self.provisioning_state = None + self.status = None + self.vnet_name = vnet_name + self.vnet_resource_group_name = vnet_resource_group_name + self.vnet_subnet_name = vnet_subnet_name + self.virtual_network = virtual_network + self.internal_load_balancing_mode = internal_load_balancing_mode + self.multi_size = multi_size + self.multi_role_count = multi_role_count + self.worker_pools = worker_pools + self.ipssl_address_count = ipssl_address_count + self.database_edition = None + self.database_service_objective = None + self.upgrade_domains = None + self.subscription_id = None + self.dns_suffix = dns_suffix + self.last_action = None + self.last_action_result = None + self.allowed_multi_sizes = None + self.allowed_worker_sizes = None + self.maximum_number_of_machines = None + self.vip_mappings = None + self.environment_capacities = None + self.network_access_control_list = network_access_control_list + self.environment_is_healthy = None + self.environment_status = None + self.resource_group = None + self.front_end_scale_factor = front_end_scale_factor + self.default_front_end_scale_factor = None + self.api_management_account_id = api_management_account_id + self.suspended = suspended + self.dynamic_cache_enabled = dynamic_cache_enabled + self.cluster_settings = cluster_settings + self.user_whitelisted_ip_ranges = user_whitelisted_ip_ranges + self.has_linux_workers = has_linux_workers + self.ssl_cert_key_vault_id = ssl_cert_key_vault_id + self.ssl_cert_key_vault_secret_name = ssl_cert_key_vault_secret_name + + +class AppServiceEnvironmentResource(Resource): + """App Service Environment ARM 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param name_properties_name: Name of the App Service Environment. + :type name_properties_name: str + :param location_properties_location: Location of the App Service Environment, e.g. "West US". + :type location_properties_location: str + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.ProvisioningState + :ivar status: Current status of the App Service Environment. Possible values include: + "Preparing", "Ready", "Scaling", "Deleting". + :vartype status: str or ~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentStatus + :param vnet_name: Name of the Virtual Network for the App Service Environment. + :type vnet_name: str + :param vnet_resource_group_name: Resource group of the Virtual Network. + :type vnet_resource_group_name: str + :param vnet_subnet_name: Subnet of the Virtual Network. + :type vnet_subnet_name: str + :param virtual_network: Description of the Virtual Network. + :type virtual_network: ~azure.mgmt.web.v2020_09_01.models.VirtualNetworkProfile + :param internal_load_balancing_mode: Specifies which endpoints to serve internally in the + Virtual Network for the App Service Environment. Possible values include: "None", "Web", + "Publishing", "Web,Publishing". + :type internal_load_balancing_mode: str or ~azure.mgmt.web.v2020_09_01.models.LoadBalancingMode + :param multi_size: Front-end VM size, e.g. "Medium", "Large". + :type multi_size: str + :param multi_role_count: Number of front-end instances. + :type multi_role_count: int + :param worker_pools: Description of worker pools with worker size IDs, VM sizes, and number of + workers in each pool. + :type worker_pools: list[~azure.mgmt.web.v2020_09_01.models.WorkerPool] + :param ipssl_address_count: Number of IP SSL addresses reserved for the App Service + Environment. + :type ipssl_address_count: int + :ivar database_edition: Edition of the metadata database for the App Service Environment, e.g. + "Standard". + :vartype database_edition: str + :ivar database_service_objective: Service objective of the metadata database for the App + Service Environment, e.g. "S0". + :vartype database_service_objective: str + :ivar upgrade_domains: Number of upgrade domains of the App Service Environment. + :vartype upgrade_domains: int + :ivar subscription_id: Subscription of the App Service Environment. + :vartype subscription_id: str + :param dns_suffix: DNS suffix of the App Service Environment. + :type dns_suffix: str + :ivar last_action: Last deployment action on the App Service Environment. + :vartype last_action: str + :ivar last_action_result: Result of the last deployment action on the App Service Environment. + :vartype last_action_result: str + :ivar allowed_multi_sizes: List of comma separated strings describing which VM sizes are + allowed for front-ends. + :vartype allowed_multi_sizes: str + :ivar allowed_worker_sizes: List of comma separated strings describing which VM sizes are + allowed for workers. + :vartype allowed_worker_sizes: str + :ivar maximum_number_of_machines: Maximum number of VMs in the App Service Environment. + :vartype maximum_number_of_machines: int + :ivar vip_mappings: Description of IP SSL mapping for the App Service Environment. + :vartype vip_mappings: list[~azure.mgmt.web.v2020_09_01.models.VirtualIPMapping] + :ivar environment_capacities: Current total, used, and available worker capacities. + :vartype environment_capacities: list[~azure.mgmt.web.v2020_09_01.models.StampCapacity] + :param network_access_control_list: Access control list for controlling traffic to the App + Service Environment. + :type network_access_control_list: + list[~azure.mgmt.web.v2020_09_01.models.NetworkAccessControlEntry] + :ivar environment_is_healthy: True/false indicating whether the App Service Environment is + healthy. + :vartype environment_is_healthy: bool + :ivar environment_status: Detailed message about with results of the last check of the App + Service Environment. + :vartype environment_status: str + :ivar resource_group: Resource group of the App Service Environment. + :vartype resource_group: str + :param front_end_scale_factor: Scale factor for front-ends. + :type front_end_scale_factor: int + :ivar default_front_end_scale_factor: Default Scale Factor for FrontEnds. + :vartype default_front_end_scale_factor: int + :param api_management_account_id: API Management Account associated with the App Service + Environment. + :type api_management_account_id: str + :param suspended: :code:`true` if the App Service Environment is suspended; + otherwise, :code:`false`. The environment can be suspended, e.g. when the + management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :type suspended: bool + :param dynamic_cache_enabled: True/false indicating whether the App Service Environment is + suspended. The environment can be suspended e.g. when the management endpoint is no longer + available + (most likely because NSG blocked the incoming traffic). + :type dynamic_cache_enabled: bool + :param cluster_settings: Custom settings for changing the behavior of the App Service + Environment. + :type cluster_settings: list[~azure.mgmt.web.v2020_09_01.models.NameValuePair] + :param user_whitelisted_ip_ranges: User added ip ranges to whitelist on ASE db. + :type user_whitelisted_ip_ranges: list[str] + :param has_linux_workers: Flag that displays whether an ASE has linux workers or not. + :type has_linux_workers: bool + :param ssl_cert_key_vault_id: Key Vault ID for ILB App Service Environment default SSL + certificate. + :type ssl_cert_key_vault_id: str + :param ssl_cert_key_vault_secret_name: Key Vault Secret Name for ILB App Service Environment + default SSL certificate. + :type ssl_cert_key_vault_secret_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'database_edition': {'readonly': True}, + 'database_service_objective': {'readonly': True}, + 'upgrade_domains': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'last_action': {'readonly': True}, + 'last_action_result': {'readonly': True}, + 'allowed_multi_sizes': {'readonly': True}, + 'allowed_worker_sizes': {'readonly': True}, + 'maximum_number_of_machines': {'readonly': True}, + 'vip_mappings': {'readonly': True}, + 'environment_capacities': {'readonly': True}, + 'environment_is_healthy': {'readonly': True}, + 'environment_status': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'default_front_end_scale_factor': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'location_properties_location': {'key': 'properties.location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_resource_group_name': {'key': 'properties.vnetResourceGroupName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'properties.vnetSubnetName', 'type': 'str'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'VirtualNetworkProfile'}, + 'internal_load_balancing_mode': {'key': 'properties.internalLoadBalancingMode', 'type': 'str'}, + 'multi_size': {'key': 'properties.multiSize', 'type': 'str'}, + 'multi_role_count': {'key': 'properties.multiRoleCount', 'type': 'int'}, + 'worker_pools': {'key': 'properties.workerPools', 'type': '[WorkerPool]'}, + 'ipssl_address_count': {'key': 'properties.ipsslAddressCount', 'type': 'int'}, + 'database_edition': {'key': 'properties.databaseEdition', 'type': 'str'}, + 'database_service_objective': {'key': 'properties.databaseServiceObjective', 'type': 'str'}, + 'upgrade_domains': {'key': 'properties.upgradeDomains', 'type': 'int'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'dns_suffix': {'key': 'properties.dnsSuffix', 'type': 'str'}, + 'last_action': {'key': 'properties.lastAction', 'type': 'str'}, + 'last_action_result': {'key': 'properties.lastActionResult', 'type': 'str'}, + 'allowed_multi_sizes': {'key': 'properties.allowedMultiSizes', 'type': 'str'}, + 'allowed_worker_sizes': {'key': 'properties.allowedWorkerSizes', 'type': 'str'}, + 'maximum_number_of_machines': {'key': 'properties.maximumNumberOfMachines', 'type': 'int'}, + 'vip_mappings': {'key': 'properties.vipMappings', 'type': '[VirtualIPMapping]'}, + 'environment_capacities': {'key': 'properties.environmentCapacities', 'type': '[StampCapacity]'}, + 'network_access_control_list': {'key': 'properties.networkAccessControlList', 'type': '[NetworkAccessControlEntry]'}, + 'environment_is_healthy': {'key': 'properties.environmentIsHealthy', 'type': 'bool'}, + 'environment_status': {'key': 'properties.environmentStatus', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'front_end_scale_factor': {'key': 'properties.frontEndScaleFactor', 'type': 'int'}, + 'default_front_end_scale_factor': {'key': 'properties.defaultFrontEndScaleFactor', 'type': 'int'}, + 'api_management_account_id': {'key': 'properties.apiManagementAccountId', 'type': 'str'}, + 'suspended': {'key': 'properties.suspended', 'type': 'bool'}, + 'dynamic_cache_enabled': {'key': 'properties.dynamicCacheEnabled', 'type': 'bool'}, + 'cluster_settings': {'key': 'properties.clusterSettings', 'type': '[NameValuePair]'}, + 'user_whitelisted_ip_ranges': {'key': 'properties.userWhitelistedIpRanges', 'type': '[str]'}, + 'has_linux_workers': {'key': 'properties.hasLinuxWorkers', 'type': 'bool'}, + 'ssl_cert_key_vault_id': {'key': 'properties.sslCertKeyVaultId', 'type': 'str'}, + 'ssl_cert_key_vault_secret_name': {'key': 'properties.sslCertKeyVaultSecretName', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + name_properties_name: Optional[str] = None, + location_properties_location: Optional[str] = None, + vnet_name: Optional[str] = None, + vnet_resource_group_name: Optional[str] = None, + vnet_subnet_name: Optional[str] = None, + virtual_network: Optional["VirtualNetworkProfile"] = None, + internal_load_balancing_mode: Optional[Union[str, "LoadBalancingMode"]] = None, + multi_size: Optional[str] = None, + multi_role_count: Optional[int] = None, + worker_pools: Optional[List["WorkerPool"]] = None, + ipssl_address_count: Optional[int] = None, + dns_suffix: Optional[str] = None, + network_access_control_list: Optional[List["NetworkAccessControlEntry"]] = None, + front_end_scale_factor: Optional[int] = None, + api_management_account_id: Optional[str] = None, + suspended: Optional[bool] = None, + dynamic_cache_enabled: Optional[bool] = None, + cluster_settings: Optional[List["NameValuePair"]] = None, + user_whitelisted_ip_ranges: Optional[List[str]] = None, + has_linux_workers: Optional[bool] = None, + ssl_cert_key_vault_id: Optional[str] = None, + ssl_cert_key_vault_secret_name: Optional[str] = None, + **kwargs + ): + super(AppServiceEnvironmentResource, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.name_properties_name = name_properties_name + self.location_properties_location = location_properties_location + self.provisioning_state = None + self.status = None + self.vnet_name = vnet_name + self.vnet_resource_group_name = vnet_resource_group_name + self.vnet_subnet_name = vnet_subnet_name + self.virtual_network = virtual_network + self.internal_load_balancing_mode = internal_load_balancing_mode + self.multi_size = multi_size + self.multi_role_count = multi_role_count + self.worker_pools = worker_pools + self.ipssl_address_count = ipssl_address_count + self.database_edition = None + self.database_service_objective = None + self.upgrade_domains = None + self.subscription_id = None + self.dns_suffix = dns_suffix + self.last_action = None + self.last_action_result = None + self.allowed_multi_sizes = None + self.allowed_worker_sizes = None + self.maximum_number_of_machines = None + self.vip_mappings = None + self.environment_capacities = None + self.network_access_control_list = network_access_control_list + self.environment_is_healthy = None + self.environment_status = None + self.resource_group = None + self.front_end_scale_factor = front_end_scale_factor + self.default_front_end_scale_factor = None + self.api_management_account_id = api_management_account_id + self.suspended = suspended + self.dynamic_cache_enabled = dynamic_cache_enabled + self.cluster_settings = cluster_settings + self.user_whitelisted_ip_ranges = user_whitelisted_ip_ranges + self.has_linux_workers = has_linux_workers + self.ssl_cert_key_vault_id = ssl_cert_key_vault_id + self.ssl_cert_key_vault_secret_name = ssl_cert_key_vault_secret_name + + +class AppserviceGithubToken(msrest.serialization.Model): + """Github access token for Appservice CLI github integration. + + :param access_token: Github access token for Appservice CLI github integration. + :type access_token: str + :param scope: Scope of the github access token. + :type scope: str + :param token_type: token type. + :type token_type: str + :param got_token: True if valid github token received, False otherwise. + :type got_token: bool + :param error_message: Error message if unable to get token. + :type error_message: str + """ + + _attribute_map = { + 'access_token': {'key': 'accessToken', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'}, + 'token_type': {'key': 'tokenType', 'type': 'str'}, + 'got_token': {'key': 'gotToken', 'type': 'bool'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__( + self, + *, + access_token: Optional[str] = None, + scope: Optional[str] = None, + token_type: Optional[str] = None, + got_token: Optional[bool] = None, + error_message: Optional[str] = None, + **kwargs + ): + super(AppserviceGithubToken, self).__init__(**kwargs) + self.access_token = access_token + self.scope = scope + self.token_type = token_type + self.got_token = got_token + self.error_message = error_message + + +class AppserviceGithubTokenRequest(msrest.serialization.Model): + """Appservice Github token request content. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Code string to exchange for Github Access token. + :type code: str + :param state: Required. State string used for verification. + :type state: str + """ + + _validation = { + 'code': {'required': True}, + 'state': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + *, + code: str, + state: str, + **kwargs + ): + super(AppserviceGithubTokenRequest, self).__init__(**kwargs) + self.code = code + self.state = state + + +class AppServicePlan(Resource): + """App Service plan. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param sku: Description of a SKU for a scalable resource. + :type sku: ~azure.mgmt.web.v2020_09_01.models.SkuDescription + :param worker_tier_name: Target worker tier assigned to the App Service plan. + :type worker_tier_name: str + :ivar status: App Service plan status. Possible values include: "Ready", "Pending", "Creating". + :vartype status: str or ~azure.mgmt.web.v2020_09_01.models.StatusOptions + :ivar subscription: App Service plan subscription. + :vartype subscription: str + :param hosting_environment_profile: Specification for the App Service Environment to use for + the App Service plan. + :type hosting_environment_profile: ~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentProfile + :ivar maximum_number_of_workers: Maximum number of instances that can be assigned to this App + Service plan. + :vartype maximum_number_of_workers: int + :ivar geo_region: Geographical location for the App Service plan. + :vartype geo_region: str + :param per_site_scaling: If :code:`true`, apps assigned to this App Service plan + can be scaled independently. + If :code:`false`, apps assigned to this App Service plan will scale to all + instances of the plan. + :type per_site_scaling: bool + :param maximum_elastic_worker_count: Maximum number of total workers allowed for this + ElasticScaleEnabled App Service Plan. + :type maximum_elastic_worker_count: int + :ivar number_of_sites: Number of apps assigned to this App Service plan. + :vartype number_of_sites: int + :param is_spot: If :code:`true`, this App Service Plan owns spot instances. + :type is_spot: bool + :param spot_expiration_time: The time when the server farm expires. Valid only if it is a spot + server farm. + :type spot_expiration_time: ~datetime.datetime + :param free_offer_expiration_time: The time when the server farm free offer expires. + :type free_offer_expiration_time: ~datetime.datetime + :ivar resource_group: Resource group of the App Service plan. + :vartype resource_group: str + :param reserved: If Linux app service plan :code:`true`, + :code:`false` otherwise. + :type reserved: bool + :param is_xenon: Obsolete: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type is_xenon: bool + :param hyper_v: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type hyper_v: bool + :param target_worker_count: Scaling worker count. + :type target_worker_count: int + :param target_worker_size_id: Scaling worker size ID. + :type target_worker_size_id: int + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'status': {'readonly': True}, + 'subscription': {'readonly': True}, + 'maximum_number_of_workers': {'readonly': True}, + 'geo_region': {'readonly': True}, + 'number_of_sites': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'worker_tier_name': {'key': 'properties.workerTierName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'maximum_number_of_workers': {'key': 'properties.maximumNumberOfWorkers', 'type': 'int'}, + 'geo_region': {'key': 'properties.geoRegion', 'type': 'str'}, + 'per_site_scaling': {'key': 'properties.perSiteScaling', 'type': 'bool'}, + 'maximum_elastic_worker_count': {'key': 'properties.maximumElasticWorkerCount', 'type': 'int'}, + 'number_of_sites': {'key': 'properties.numberOfSites', 'type': 'int'}, + 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, + 'spot_expiration_time': {'key': 'properties.spotExpirationTime', 'type': 'iso-8601'}, + 'free_offer_expiration_time': {'key': 'properties.freeOfferExpirationTime', 'type': 'iso-8601'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'target_worker_count': {'key': 'properties.targetWorkerCount', 'type': 'int'}, + 'target_worker_size_id': {'key': 'properties.targetWorkerSizeId', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["SkuDescription"] = None, + worker_tier_name: Optional[str] = None, + hosting_environment_profile: Optional["HostingEnvironmentProfile"] = None, + per_site_scaling: Optional[bool] = False, + maximum_elastic_worker_count: Optional[int] = None, + is_spot: Optional[bool] = None, + spot_expiration_time: Optional[datetime.datetime] = None, + free_offer_expiration_time: Optional[datetime.datetime] = None, + reserved: Optional[bool] = False, + is_xenon: Optional[bool] = False, + hyper_v: Optional[bool] = False, + target_worker_count: Optional[int] = None, + target_worker_size_id: Optional[int] = None, + **kwargs + ): + super(AppServicePlan, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.sku = sku + self.worker_tier_name = worker_tier_name + self.status = None + self.subscription = None + self.hosting_environment_profile = hosting_environment_profile + self.maximum_number_of_workers = None + self.geo_region = None + self.per_site_scaling = per_site_scaling + self.maximum_elastic_worker_count = maximum_elastic_worker_count + self.number_of_sites = None + self.is_spot = is_spot + self.spot_expiration_time = spot_expiration_time + self.free_offer_expiration_time = free_offer_expiration_time + self.resource_group = None + self.reserved = reserved + self.is_xenon = is_xenon + self.hyper_v = hyper_v + self.target_worker_count = target_worker_count + self.target_worker_size_id = target_worker_size_id + self.provisioning_state = None + + +class AppServicePlanCollection(msrest.serialization.Model): + """Collection of App Service plans. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.AppServicePlan] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServicePlan]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["AppServicePlan"], + **kwargs + ): + super(AppServicePlanCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class AppServicePlanPatchResource(ProxyOnlyResource): + """ARM resource for a app service plan. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param worker_tier_name: Target worker tier assigned to the App Service plan. + :type worker_tier_name: str + :ivar status: App Service plan status. Possible values include: "Ready", "Pending", "Creating". + :vartype status: str or ~azure.mgmt.web.v2020_09_01.models.StatusOptions + :ivar subscription: App Service plan subscription. + :vartype subscription: str + :param hosting_environment_profile: Specification for the App Service Environment to use for + the App Service plan. + :type hosting_environment_profile: ~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentProfile + :ivar maximum_number_of_workers: Maximum number of instances that can be assigned to this App + Service plan. + :vartype maximum_number_of_workers: int + :ivar geo_region: Geographical location for the App Service plan. + :vartype geo_region: str + :param per_site_scaling: If :code:`true`, apps assigned to this App Service plan + can be scaled independently. + If :code:`false`, apps assigned to this App Service plan will scale to all + instances of the plan. + :type per_site_scaling: bool + :param maximum_elastic_worker_count: Maximum number of total workers allowed for this + ElasticScaleEnabled App Service Plan. + :type maximum_elastic_worker_count: int + :ivar number_of_sites: Number of apps assigned to this App Service plan. + :vartype number_of_sites: int + :param is_spot: If :code:`true`, this App Service Plan owns spot instances. + :type is_spot: bool + :param spot_expiration_time: The time when the server farm expires. Valid only if it is a spot + server farm. + :type spot_expiration_time: ~datetime.datetime + :param free_offer_expiration_time: The time when the server farm free offer expires. + :type free_offer_expiration_time: ~datetime.datetime + :ivar resource_group: Resource group of the App Service plan. + :vartype resource_group: str + :param reserved: This needs to set to :code:`true` when creating a Linux App + Service Plan, along with :code:`kind` set to :code:`Linux`. It should + be :code:`false` otherwise. + :type reserved: bool + :param is_xenon: Obsolete: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type is_xenon: bool + :param hyper_v: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type hyper_v: bool + :param target_worker_count: Scaling worker count. + :type target_worker_count: int + :param target_worker_size_id: Scaling worker size ID. + :type target_worker_size_id: int + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'status': {'readonly': True}, + 'subscription': {'readonly': True}, + 'maximum_number_of_workers': {'readonly': True}, + 'geo_region': {'readonly': True}, + 'number_of_sites': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'worker_tier_name': {'key': 'properties.workerTierName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'maximum_number_of_workers': {'key': 'properties.maximumNumberOfWorkers', 'type': 'int'}, + 'geo_region': {'key': 'properties.geoRegion', 'type': 'str'}, + 'per_site_scaling': {'key': 'properties.perSiteScaling', 'type': 'bool'}, + 'maximum_elastic_worker_count': {'key': 'properties.maximumElasticWorkerCount', 'type': 'int'}, + 'number_of_sites': {'key': 'properties.numberOfSites', 'type': 'int'}, + 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, + 'spot_expiration_time': {'key': 'properties.spotExpirationTime', 'type': 'iso-8601'}, + 'free_offer_expiration_time': {'key': 'properties.freeOfferExpirationTime', 'type': 'iso-8601'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'target_worker_count': {'key': 'properties.targetWorkerCount', 'type': 'int'}, + 'target_worker_size_id': {'key': 'properties.targetWorkerSizeId', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + worker_tier_name: Optional[str] = None, + hosting_environment_profile: Optional["HostingEnvironmentProfile"] = None, + per_site_scaling: Optional[bool] = False, + maximum_elastic_worker_count: Optional[int] = None, + is_spot: Optional[bool] = None, + spot_expiration_time: Optional[datetime.datetime] = None, + free_offer_expiration_time: Optional[datetime.datetime] = None, + reserved: Optional[bool] = False, + is_xenon: Optional[bool] = False, + hyper_v: Optional[bool] = False, + target_worker_count: Optional[int] = None, + target_worker_size_id: Optional[int] = None, + **kwargs + ): + super(AppServicePlanPatchResource, self).__init__(kind=kind, **kwargs) + self.worker_tier_name = worker_tier_name + self.status = None + self.subscription = None + self.hosting_environment_profile = hosting_environment_profile + self.maximum_number_of_workers = None + self.geo_region = None + self.per_site_scaling = per_site_scaling + self.maximum_elastic_worker_count = maximum_elastic_worker_count + self.number_of_sites = None + self.is_spot = is_spot + self.spot_expiration_time = spot_expiration_time + self.free_offer_expiration_time = free_offer_expiration_time + self.resource_group = None + self.reserved = reserved + self.is_xenon = is_xenon + self.hyper_v = hyper_v + self.target_worker_count = target_worker_count + self.target_worker_size_id = target_worker_size_id + self.provisioning_state = None + + +class ArmIdWrapper(msrest.serialization.Model): + """A wrapper for an ARM resource id. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ArmIdWrapper, self).__init__(**kwargs) + self.id = None + + +class AuthPlatform(ProxyOnlyResource): + """AuthPlatform. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param enabled: + :type enabled: bool + :param runtime_version: + :type runtime_version: str + :param config_file_path: + :type config_file_path: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'runtime_version': {'key': 'properties.runtimeVersion', 'type': 'str'}, + 'config_file_path': {'key': 'properties.configFilePath', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + runtime_version: Optional[str] = None, + config_file_path: Optional[str] = None, + **kwargs + ): + super(AuthPlatform, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.runtime_version = runtime_version + self.config_file_path = config_file_path + + +class AutoHealActions(msrest.serialization.Model): + """Actions which to take by the auto-heal module when a rule is triggered. + + :param action_type: Predefined action to be taken. Possible values include: "Recycle", + "LogEvent", "CustomAction". + :type action_type: str or ~azure.mgmt.web.v2020_09_01.models.AutoHealActionType + :param custom_action: Custom action to be taken. + :type custom_action: ~azure.mgmt.web.v2020_09_01.models.AutoHealCustomAction + :param min_process_execution_time: Minimum time the process must execute + before taking the action. + :type min_process_execution_time: str + """ + + _attribute_map = { + 'action_type': {'key': 'actionType', 'type': 'str'}, + 'custom_action': {'key': 'customAction', 'type': 'AutoHealCustomAction'}, + 'min_process_execution_time': {'key': 'minProcessExecutionTime', 'type': 'str'}, + } + + def __init__( + self, + *, + action_type: Optional[Union[str, "AutoHealActionType"]] = None, + custom_action: Optional["AutoHealCustomAction"] = None, + min_process_execution_time: Optional[str] = None, + **kwargs + ): + super(AutoHealActions, self).__init__(**kwargs) + self.action_type = action_type + self.custom_action = custom_action + self.min_process_execution_time = min_process_execution_time + + +class AutoHealCustomAction(msrest.serialization.Model): + """Custom action to be executed +when an auto heal rule is triggered. + + :param exe: Executable to be run. + :type exe: str + :param parameters: Parameters for the executable. + :type parameters: str + """ + + _attribute_map = { + 'exe': {'key': 'exe', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'str'}, + } + + def __init__( + self, + *, + exe: Optional[str] = None, + parameters: Optional[str] = None, + **kwargs + ): + super(AutoHealCustomAction, self).__init__(**kwargs) + self.exe = exe + self.parameters = parameters + + +class AutoHealRules(msrest.serialization.Model): + """Rules that can be defined for auto-heal. + + :param triggers: Conditions that describe when to execute the auto-heal actions. + :type triggers: ~azure.mgmt.web.v2020_09_01.models.AutoHealTriggers + :param actions: Actions to be executed when a rule is triggered. + :type actions: ~azure.mgmt.web.v2020_09_01.models.AutoHealActions + """ + + _attribute_map = { + 'triggers': {'key': 'triggers', 'type': 'AutoHealTriggers'}, + 'actions': {'key': 'actions', 'type': 'AutoHealActions'}, + } + + def __init__( + self, + *, + triggers: Optional["AutoHealTriggers"] = None, + actions: Optional["AutoHealActions"] = None, + **kwargs + ): + super(AutoHealRules, self).__init__(**kwargs) + self.triggers = triggers + self.actions = actions + + +class AutoHealTriggers(msrest.serialization.Model): + """Triggers for auto-heal. + + :param requests: A rule based on total requests. + :type requests: ~azure.mgmt.web.v2020_09_01.models.RequestsBasedTrigger + :param private_bytes_in_kb: A rule based on private bytes. + :type private_bytes_in_kb: int + :param status_codes: A rule based on status codes. + :type status_codes: list[~azure.mgmt.web.v2020_09_01.models.StatusCodesBasedTrigger] + :param slow_requests: A rule based on request execution time. + :type slow_requests: ~azure.mgmt.web.v2020_09_01.models.SlowRequestsBasedTrigger + """ + + _attribute_map = { + 'requests': {'key': 'requests', 'type': 'RequestsBasedTrigger'}, + 'private_bytes_in_kb': {'key': 'privateBytesInKB', 'type': 'int'}, + 'status_codes': {'key': 'statusCodes', 'type': '[StatusCodesBasedTrigger]'}, + 'slow_requests': {'key': 'slowRequests', 'type': 'SlowRequestsBasedTrigger'}, + } + + def __init__( + self, + *, + requests: Optional["RequestsBasedTrigger"] = None, + private_bytes_in_kb: Optional[int] = None, + status_codes: Optional[List["StatusCodesBasedTrigger"]] = None, + slow_requests: Optional["SlowRequestsBasedTrigger"] = None, + **kwargs + ): + super(AutoHealTriggers, self).__init__(**kwargs) + self.requests = requests + self.private_bytes_in_kb = private_bytes_in_kb + self.status_codes = status_codes + self.slow_requests = slow_requests + + +class AzureActiveDirectory(ProxyOnlyResource): + """AzureActiveDirectory. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_09_01.models.AzureActiveDirectoryRegistration + :param login: + :type login: ~azure.mgmt.web.v2020_09_01.models.AzureActiveDirectoryLogin + :param validation: + :type validation: ~azure.mgmt.web.v2020_09_01.models.AzureActiveDirectoryValidation + :param is_auto_provisioned: + :type is_auto_provisioned: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'AzureActiveDirectoryRegistration'}, + 'login': {'key': 'properties.login', 'type': 'AzureActiveDirectoryLogin'}, + 'validation': {'key': 'properties.validation', 'type': 'AzureActiveDirectoryValidation'}, + 'is_auto_provisioned': {'key': 'properties.isAutoProvisioned', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + registration: Optional["AzureActiveDirectoryRegistration"] = None, + login: Optional["AzureActiveDirectoryLogin"] = None, + validation: Optional["AzureActiveDirectoryValidation"] = None, + is_auto_provisioned: Optional[bool] = None, + **kwargs + ): + super(AzureActiveDirectory, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.registration = registration + self.login = login + self.validation = validation + self.is_auto_provisioned = is_auto_provisioned + + +class AzureActiveDirectoryLogin(ProxyOnlyResource): + """AzureActiveDirectoryLogin. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param disable_www_authenticate: + :type disable_www_authenticate: bool + :param login_parameters: + :type login_parameters: list[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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'disable_www_authenticate': {'key': 'properties.disableWWWAuthenticate', 'type': 'bool'}, + 'login_parameters': {'key': 'properties.loginParameters', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + disable_www_authenticate: Optional[bool] = None, + login_parameters: Optional[List[str]] = None, + **kwargs + ): + super(AzureActiveDirectoryLogin, self).__init__(kind=kind, **kwargs) + self.disable_www_authenticate = disable_www_authenticate + self.login_parameters = login_parameters + + +class AzureActiveDirectoryRegistration(ProxyOnlyResource): + """AzureActiveDirectoryRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param open_id_issuer: + :type open_id_issuer: str + :param client_id: + :type client_id: str + :param client_secret_setting_name: + :type client_secret_setting_name: str + :param client_secret_certificate_thumbprint: + :type client_secret_certificate_thumbprint: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'open_id_issuer': {'key': 'properties.openIdIssuer', 'type': 'str'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_secret_certificate_thumbprint': {'key': 'properties.clientSecretCertificateThumbprint', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + open_id_issuer: Optional[str] = None, + client_id: Optional[str] = None, + client_secret_setting_name: Optional[str] = None, + client_secret_certificate_thumbprint: Optional[str] = None, + **kwargs + ): + super(AzureActiveDirectoryRegistration, self).__init__(kind=kind, **kwargs) + self.open_id_issuer = open_id_issuer + self.client_id = client_id + self.client_secret_setting_name = client_secret_setting_name + self.client_secret_certificate_thumbprint = client_secret_certificate_thumbprint + + +class AzureActiveDirectoryValidation(ProxyOnlyResource): + """AzureActiveDirectoryValidation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param jwt_claim_checks: + :type jwt_claim_checks: ~azure.mgmt.web.v2020_09_01.models.JwtClaimChecks + :param allowed_audiences: + :type allowed_audiences: list[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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'jwt_claim_checks': {'key': 'properties.jwtClaimChecks', 'type': 'JwtClaimChecks'}, + 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + jwt_claim_checks: Optional["JwtClaimChecks"] = None, + allowed_audiences: Optional[List[str]] = None, + **kwargs + ): + super(AzureActiveDirectoryValidation, self).__init__(kind=kind, **kwargs) + self.jwt_claim_checks = jwt_claim_checks + self.allowed_audiences = allowed_audiences + + +class AzureBlobStorageApplicationLogsConfig(msrest.serialization.Model): + """Application logs azure blob storage configuration. + + :param level: Log level. Possible values include: "Off", "Verbose", "Information", "Warning", + "Error". + :type level: str or ~azure.mgmt.web.v2020_09_01.models.LogLevel + :param sas_url: SAS url to a azure blob container with read/write/list/delete permissions. + :type sas_url: str + :param retention_in_days: Retention in days. + Remove blobs older than X days. + 0 or lower means no retention. + :type retention_in_days: int + """ + + _attribute_map = { + 'level': {'key': 'level', 'type': 'str'}, + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + } + + def __init__( + self, + *, + level: Optional[Union[str, "LogLevel"]] = None, + sas_url: Optional[str] = None, + retention_in_days: Optional[int] = None, + **kwargs + ): + super(AzureBlobStorageApplicationLogsConfig, self).__init__(**kwargs) + self.level = level + self.sas_url = sas_url + self.retention_in_days = retention_in_days + + +class AzureBlobStorageHttpLogsConfig(msrest.serialization.Model): + """Http logs to azure blob storage configuration. + + :param sas_url: SAS url to a azure blob container with read/write/list/delete permissions. + :type sas_url: str + :param retention_in_days: Retention in days. + Remove blobs older than X days. + 0 or lower means no retention. + :type retention_in_days: int + :param enabled: True if configuration is enabled, false if it is disabled and null if + configuration is not set. + :type enabled: bool + """ + + _attribute_map = { + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + sas_url: Optional[str] = None, + retention_in_days: Optional[int] = None, + enabled: Optional[bool] = None, + **kwargs + ): + super(AzureBlobStorageHttpLogsConfig, self).__init__(**kwargs) + self.sas_url = sas_url + self.retention_in_days = retention_in_days + self.enabled = enabled + + +class AzureStorageInfoValue(msrest.serialization.Model): + """Azure Files or Blob Storage access information value for dictionary storage. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Type of storage. Possible values include: "AzureFiles", "AzureBlob". + :type type: str or ~azure.mgmt.web.v2020_09_01.models.AzureStorageType + :param account_name: Name of the storage account. + :type account_name: str + :param share_name: Name of the file share (container name, for Blob storage). + :type share_name: str + :param access_key: Access key for the storage account. + :type access_key: str + :param mount_path: Path to mount the storage within the site's runtime environment. + :type mount_path: str + :ivar state: State of the storage account. Possible values include: "Ok", "InvalidCredentials", + "InvalidShare". + :vartype state: str or ~azure.mgmt.web.v2020_09_01.models.AzureStorageState + """ + + _validation = { + 'state': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'account_name': {'key': 'accountName', 'type': 'str'}, + 'share_name': {'key': 'shareName', 'type': 'str'}, + 'access_key': {'key': 'accessKey', 'type': 'str'}, + 'mount_path': {'key': 'mountPath', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "AzureStorageType"]] = None, + account_name: Optional[str] = None, + share_name: Optional[str] = None, + access_key: Optional[str] = None, + mount_path: Optional[str] = None, + **kwargs + ): + super(AzureStorageInfoValue, self).__init__(**kwargs) + self.type = type + self.account_name = account_name + self.share_name = share_name + self.access_key = access_key + self.mount_path = mount_path + self.state = None + + +class AzureStoragePropertyDictionaryResource(ProxyOnlyResource): + """AzureStorageInfo dictionary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param properties: Azure storage accounts. + :type properties: dict[str, ~azure.mgmt.web.v2020_09_01.models.AzureStorageInfoValue] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': '{AzureStorageInfoValue}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + properties: Optional[Dict[str, "AzureStorageInfoValue"]] = None, + **kwargs + ): + super(AzureStoragePropertyDictionaryResource, self).__init__(kind=kind, **kwargs) + self.properties = properties + + +class AzureTableStorageApplicationLogsConfig(msrest.serialization.Model): + """Application logs to Azure table storage configuration. + + All required parameters must be populated in order to send to Azure. + + :param level: Log level. Possible values include: "Off", "Verbose", "Information", "Warning", + "Error". + :type level: str or ~azure.mgmt.web.v2020_09_01.models.LogLevel + :param sas_url: Required. SAS URL to an Azure table with add/query/delete permissions. + :type sas_url: str + """ + + _validation = { + 'sas_url': {'required': True}, + } + + _attribute_map = { + 'level': {'key': 'level', 'type': 'str'}, + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + sas_url: str, + level: Optional[Union[str, "LogLevel"]] = None, + **kwargs + ): + super(AzureTableStorageApplicationLogsConfig, self).__init__(**kwargs) + self.level = level + self.sas_url = sas_url + + +class BackupItem(ProxyOnlyResource): + """Backup description. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar backup_id: Id of the backup. + :vartype backup_id: int + :ivar storage_account_url: SAS URL for the storage account container which contains this + backup. + :vartype storage_account_url: str + :ivar blob_name: Name of the blob which contains data for this backup. + :vartype blob_name: str + :ivar name_properties_name: Name of this backup. + :vartype name_properties_name: str + :ivar status: Backup status. Possible values include: "InProgress", "Failed", "Succeeded", + "TimedOut", "Created", "Skipped", "PartiallySucceeded", "DeleteInProgress", "DeleteFailed", + "Deleted". + :vartype status: str or ~azure.mgmt.web.v2020_09_01.models.BackupItemStatus + :ivar size_in_bytes: Size of the backup in bytes. + :vartype size_in_bytes: long + :ivar created: Timestamp of the backup creation. + :vartype created: ~datetime.datetime + :ivar log: Details regarding this backup. Might contain an error message. + :vartype log: str + :ivar databases: List of databases included in the backup. + :vartype databases: list[~azure.mgmt.web.v2020_09_01.models.DatabaseBackupSetting] + :ivar scheduled: True if this backup has been created due to a schedule being triggered. + :vartype scheduled: bool + :ivar last_restore_time_stamp: Timestamp of a last restore operation which used this backup. + :vartype last_restore_time_stamp: ~datetime.datetime + :ivar finished_time_stamp: Timestamp when this backup finished. + :vartype finished_time_stamp: ~datetime.datetime + :ivar correlation_id: Unique correlation identifier. Please use this along with the timestamp + while communicating with Azure support. + :vartype correlation_id: str + :ivar website_size_in_bytes: Size of the original web app which has been backed up. + :vartype website_size_in_bytes: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'backup_id': {'readonly': True}, + 'storage_account_url': {'readonly': True}, + 'blob_name': {'readonly': True}, + 'name_properties_name': {'readonly': True}, + 'status': {'readonly': True}, + 'size_in_bytes': {'readonly': True}, + 'created': {'readonly': True}, + 'log': {'readonly': True}, + 'databases': {'readonly': True}, + 'scheduled': {'readonly': True}, + 'last_restore_time_stamp': {'readonly': True}, + 'finished_time_stamp': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'website_size_in_bytes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'backup_id': {'key': 'properties.id', 'type': 'int'}, + 'storage_account_url': {'key': 'properties.storageAccountUrl', 'type': 'str'}, + 'blob_name': {'key': 'properties.blobName', 'type': 'str'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'size_in_bytes': {'key': 'properties.sizeInBytes', 'type': 'long'}, + 'created': {'key': 'properties.created', 'type': 'iso-8601'}, + 'log': {'key': 'properties.log', 'type': 'str'}, + 'databases': {'key': 'properties.databases', 'type': '[DatabaseBackupSetting]'}, + 'scheduled': {'key': 'properties.scheduled', 'type': 'bool'}, + 'last_restore_time_stamp': {'key': 'properties.lastRestoreTimeStamp', 'type': 'iso-8601'}, + 'finished_time_stamp': {'key': 'properties.finishedTimeStamp', 'type': 'iso-8601'}, + 'correlation_id': {'key': 'properties.correlationId', 'type': 'str'}, + 'website_size_in_bytes': {'key': 'properties.websiteSizeInBytes', 'type': 'long'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(BackupItem, self).__init__(kind=kind, **kwargs) + self.backup_id = None + self.storage_account_url = None + self.blob_name = None + self.name_properties_name = None + self.status = None + self.size_in_bytes = None + self.created = None + self.log = None + self.databases = None + self.scheduled = None + self.last_restore_time_stamp = None + self.finished_time_stamp = None + self.correlation_id = None + self.website_size_in_bytes = None + + +class BackupItemCollection(msrest.serialization.Model): + """Collection of backup items. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.BackupItem] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BackupItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["BackupItem"], + **kwargs + ): + super(BackupItemCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class BackupRequest(ProxyOnlyResource): + """Description of a backup which will be performed. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param backup_name: Name of the backup. + :type backup_name: str + :param enabled: True if the backup schedule is enabled (must be included in that case), false + if the backup schedule should be disabled. + :type enabled: bool + :param storage_account_url: SAS URL to the container. + :type storage_account_url: str + :param backup_schedule: Schedule for the backup if it is executed periodically. + :type backup_schedule: ~azure.mgmt.web.v2020_09_01.models.BackupSchedule + :param databases: Databases included in the backup. + :type databases: list[~azure.mgmt.web.v2020_09_01.models.DatabaseBackupSetting] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'backup_name': {'key': 'properties.backupName', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'storage_account_url': {'key': 'properties.storageAccountUrl', 'type': 'str'}, + 'backup_schedule': {'key': 'properties.backupSchedule', 'type': 'BackupSchedule'}, + 'databases': {'key': 'properties.databases', 'type': '[DatabaseBackupSetting]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + backup_name: Optional[str] = None, + enabled: Optional[bool] = None, + storage_account_url: Optional[str] = None, + backup_schedule: Optional["BackupSchedule"] = None, + databases: Optional[List["DatabaseBackupSetting"]] = None, + **kwargs + ): + super(BackupRequest, self).__init__(kind=kind, **kwargs) + self.backup_name = backup_name + self.enabled = enabled + self.storage_account_url = storage_account_url + self.backup_schedule = backup_schedule + self.databases = databases + + +class BackupSchedule(msrest.serialization.Model): + """Description of a backup schedule. Describes how often should be the backup performed and what should be the retention policy. + + 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. + + :param frequency_interval: Required. How often the backup should be executed (e.g. for weekly + backup, this should be set to 7 and FrequencyUnit should be set to Day). + :type frequency_interval: int + :param frequency_unit: Required. The unit of time for how often the backup should be executed + (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7). + Possible values include: "Day", "Hour". Default value: "Day". + :type frequency_unit: str or ~azure.mgmt.web.v2020_09_01.models.FrequencyUnit + :param keep_at_least_one_backup: Required. True if the retention policy should always keep at + least one backup in the storage account, regardless how old it is; false otherwise. + :type keep_at_least_one_backup: bool + :param retention_period_in_days: Required. After how many days backups should be deleted. + :type retention_period_in_days: int + :param start_time: When the schedule should start working. + :type start_time: ~datetime.datetime + :ivar last_execution_time: Last time when this schedule was triggered. + :vartype last_execution_time: ~datetime.datetime + """ + + _validation = { + 'frequency_interval': {'required': True}, + 'frequency_unit': {'required': True}, + 'keep_at_least_one_backup': {'required': True}, + 'retention_period_in_days': {'required': True}, + 'last_execution_time': {'readonly': True}, + } + + _attribute_map = { + 'frequency_interval': {'key': 'frequencyInterval', 'type': 'int'}, + 'frequency_unit': {'key': 'frequencyUnit', 'type': 'str'}, + 'keep_at_least_one_backup': {'key': 'keepAtLeastOneBackup', 'type': 'bool'}, + 'retention_period_in_days': {'key': 'retentionPeriodInDays', 'type': 'int'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'last_execution_time': {'key': 'lastExecutionTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + frequency_interval: int = 7, + frequency_unit: Union[str, "FrequencyUnit"] = "Day", + keep_at_least_one_backup: bool = True, + retention_period_in_days: int = 30, + start_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(BackupSchedule, self).__init__(**kwargs) + self.frequency_interval = frequency_interval + self.frequency_unit = frequency_unit + self.keep_at_least_one_backup = keep_at_least_one_backup + self.retention_period_in_days = retention_period_in_days + self.start_time = start_time + self.last_execution_time = None + + +class BillingMeter(ProxyOnlyResource): + """App Service billing entity that contains information about meter which the Azure billing system utilizes to charge users for services. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param meter_id: Meter GUID onboarded in Commerce. + :type meter_id: str + :param billing_location: Azure Location of billable resource. + :type billing_location: str + :param short_name: Short Name from App Service Azure pricing Page. + :type short_name: str + :param friendly_name: Friendly name of the meter. + :type friendly_name: str + :param resource_type: App Service ResourceType meter used for. + :type resource_type: str + :param os_type: App Service OS type meter used for. + :type os_type: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, + 'billing_location': {'key': 'properties.billingLocation', 'type': 'str'}, + 'short_name': {'key': 'properties.shortName', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'resource_type': {'key': 'properties.resourceType', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + meter_id: Optional[str] = None, + billing_location: Optional[str] = None, + short_name: Optional[str] = None, + friendly_name: Optional[str] = None, + resource_type: Optional[str] = None, + os_type: Optional[str] = None, + **kwargs + ): + super(BillingMeter, self).__init__(kind=kind, **kwargs) + self.meter_id = meter_id + self.billing_location = billing_location + self.short_name = short_name + self.friendly_name = friendly_name + self.resource_type = resource_type + self.os_type = os_type + + +class BillingMeterCollection(msrest.serialization.Model): + """Collection of Billing Meters. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.BillingMeter] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingMeter]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["BillingMeter"], + **kwargs + ): + super(BillingMeterCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class BlobStorageTokenStore(ProxyOnlyResource): + """BlobStorageTokenStore. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param sas_url_setting_name: + :type sas_url_setting_name: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'sas_url_setting_name': {'key': 'properties.sasUrlSettingName', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + sas_url_setting_name: Optional[str] = None, + **kwargs + ): + super(BlobStorageTokenStore, self).__init__(kind=kind, **kwargs) + self.sas_url_setting_name = sas_url_setting_name + + +class Capability(msrest.serialization.Model): + """Describes the capabilities/features allowed for a specific SKU. + + :param name: Name of the SKU capability. + :type name: str + :param value: Value of the SKU capability. + :type value: str + :param reason: Reason of the SKU capability. + :type reason: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + reason: Optional[str] = None, + **kwargs + ): + super(Capability, self).__init__(**kwargs) + self.name = name + self.value = value + self.reason = reason + + +class Certificate(Resource): + """SSL certificate for an app. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar friendly_name: Friendly name of the certificate. + :vartype friendly_name: str + :ivar subject_name: Subject name of the certificate. + :vartype subject_name: str + :param host_names: Host names the certificate applies to. + :type host_names: list[str] + :param pfx_blob: Pfx blob. + :type pfx_blob: bytearray + :ivar site_name: App name. + :vartype site_name: str + :ivar self_link: Self link. + :vartype self_link: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar issue_date: Certificate issue Date. + :vartype issue_date: ~datetime.datetime + :ivar expiration_date: Certificate expiration date. + :vartype expiration_date: ~datetime.datetime + :param password: Certificate password. + :type password: str + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid: Is the certificate valid?. + :vartype valid: bool + :ivar cer_blob: Raw bytes of .cer file. + :vartype cer_blob: bytearray + :ivar public_key_hash: Public key hash. + :vartype public_key_hash: str + :ivar hosting_environment_profile: Specification for the App Service Environment to use for the + certificate. + :vartype hosting_environment_profile: + ~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentProfile + :param key_vault_id: Key Vault Csm resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar key_vault_secret_status: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype key_vault_secret_status: str or + ~azure.mgmt.web.v2020_09_01.models.KeyVaultSecretStatus + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param canonical_name: CNAME of the certificate to be issued via free certificate. + :type canonical_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'site_name': {'readonly': True}, + 'self_link': {'readonly': True}, + 'issuer': {'readonly': True}, + 'issue_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'valid': {'readonly': True}, + 'cer_blob': {'readonly': True}, + 'public_key_hash': {'readonly': True}, + 'hosting_environment_profile': {'readonly': True}, + 'key_vault_secret_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'subject_name': {'key': 'properties.subjectName', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'pfx_blob': {'key': 'properties.pfxBlob', 'type': 'bytearray'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'self_link': {'key': 'properties.selfLink', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'issue_date': {'key': 'properties.issueDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'valid': {'key': 'properties.valid', 'type': 'bool'}, + 'cer_blob': {'key': 'properties.cerBlob', 'type': 'bytearray'}, + 'public_key_hash': {'key': 'properties.publicKeyHash', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'key_vault_secret_status': {'key': 'properties.keyVaultSecretStatus', 'type': 'str'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'canonical_name': {'key': 'properties.canonicalName', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + host_names: Optional[List[str]] = None, + pfx_blob: Optional[bytearray] = None, + password: Optional[str] = None, + key_vault_id: Optional[str] = None, + key_vault_secret_name: Optional[str] = None, + server_farm_id: Optional[str] = None, + canonical_name: Optional[str] = None, + **kwargs + ): + super(Certificate, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.friendly_name = None + self.subject_name = None + self.host_names = host_names + self.pfx_blob = pfx_blob + self.site_name = None + self.self_link = None + self.issuer = None + self.issue_date = None + self.expiration_date = None + self.password = password + self.thumbprint = None + self.valid = None + self.cer_blob = None + self.public_key_hash = None + self.hosting_environment_profile = None + self.key_vault_id = key_vault_id + self.key_vault_secret_name = key_vault_secret_name + self.key_vault_secret_status = None + self.server_farm_id = server_farm_id + self.canonical_name = canonical_name + + +class CertificateCollection(msrest.serialization.Model): + """Collection of certificates. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.Certificate] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Certificate]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Certificate"], + **kwargs + ): + super(CertificateCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class CertificateDetails(msrest.serialization.Model): + """SSL certificate details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar version: Certificate Version. + :vartype version: int + :ivar serial_number: Certificate Serial Number. + :vartype serial_number: str + :ivar thumbprint: Certificate Thumbprint. + :vartype thumbprint: str + :ivar subject: Certificate Subject. + :vartype subject: str + :ivar not_before: Date Certificate is valid from. + :vartype not_before: ~datetime.datetime + :ivar not_after: Date Certificate is valid to. + :vartype not_after: ~datetime.datetime + :ivar signature_algorithm: Certificate Signature algorithm. + :vartype signature_algorithm: str + :ivar issuer: Certificate Issuer. + :vartype issuer: str + :ivar raw_data: Raw certificate data. + :vartype raw_data: str + """ + + _validation = { + 'version': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'subject': {'readonly': True}, + 'not_before': {'readonly': True}, + 'not_after': {'readonly': True}, + 'signature_algorithm': {'readonly': True}, + 'issuer': {'readonly': True}, + 'raw_data': {'readonly': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'int'}, + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + 'not_before': {'key': 'notBefore', 'type': 'iso-8601'}, + 'not_after': {'key': 'notAfter', 'type': 'iso-8601'}, + 'signature_algorithm': {'key': 'signatureAlgorithm', 'type': 'str'}, + 'issuer': {'key': 'issuer', 'type': 'str'}, + 'raw_data': {'key': 'rawData', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateDetails, self).__init__(**kwargs) + self.version = None + self.serial_number = None + self.thumbprint = None + self.subject = None + self.not_before = None + self.not_after = None + self.signature_algorithm = None + self.issuer = None + self.raw_data = None + + +class CertificateEmail(ProxyOnlyResource): + """SSL certificate email. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param email_id: Email id. + :type email_id: str + :param time_stamp: Time stamp. + :type time_stamp: ~datetime.datetime + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'email_id': {'key': 'properties.emailId', 'type': 'str'}, + 'time_stamp': {'key': 'properties.timeStamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + email_id: Optional[str] = None, + time_stamp: Optional[datetime.datetime] = None, + **kwargs + ): + super(CertificateEmail, self).__init__(kind=kind, **kwargs) + self.email_id = email_id + self.time_stamp = time_stamp + + +class CertificateOrderAction(ProxyOnlyResource): + """Certificate order action. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar action_type: Action type. Possible values include: "CertificateIssued", + "CertificateOrderCanceled", "CertificateOrderCreated", "CertificateRevoked", + "DomainValidationComplete", "FraudDetected", "OrgNameChange", "OrgValidationComplete", + "SanDrop", "FraudCleared", "CertificateExpired", "CertificateExpirationWarning", + "FraudDocumentationRequired", "Unknown". + :vartype action_type: str or ~azure.mgmt.web.v2020_09_01.models.CertificateOrderActionType + :ivar created_at: Time at which the certificate action was performed. + :vartype created_at: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'action_type': {'readonly': True}, + 'created_at': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'action_type': {'key': 'properties.actionType', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(CertificateOrderAction, self).__init__(kind=kind, **kwargs) + self.action_type = None + self.created_at = None + + +class CertificatePatchResource(ProxyOnlyResource): + """ARM resource for a certificate. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar friendly_name: Friendly name of the certificate. + :vartype friendly_name: str + :ivar subject_name: Subject name of the certificate. + :vartype subject_name: str + :param host_names: Host names the certificate applies to. + :type host_names: list[str] + :param pfx_blob: Pfx blob. + :type pfx_blob: bytearray + :ivar site_name: App name. + :vartype site_name: str + :ivar self_link: Self link. + :vartype self_link: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar issue_date: Certificate issue Date. + :vartype issue_date: ~datetime.datetime + :ivar expiration_date: Certificate expiration date. + :vartype expiration_date: ~datetime.datetime + :param password: Certificate password. + :type password: str + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid: Is the certificate valid?. + :vartype valid: bool + :ivar cer_blob: Raw bytes of .cer file. + :vartype cer_blob: bytearray + :ivar public_key_hash: Public key hash. + :vartype public_key_hash: str + :ivar hosting_environment_profile: Specification for the App Service Environment to use for the + certificate. + :vartype hosting_environment_profile: + ~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentProfile + :param key_vault_id: Key Vault Csm resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar key_vault_secret_status: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype key_vault_secret_status: str or + ~azure.mgmt.web.v2020_09_01.models.KeyVaultSecretStatus + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param canonical_name: CNAME of the certificate to be issued via free certificate. + :type canonical_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'site_name': {'readonly': True}, + 'self_link': {'readonly': True}, + 'issuer': {'readonly': True}, + 'issue_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'valid': {'readonly': True}, + 'cer_blob': {'readonly': True}, + 'public_key_hash': {'readonly': True}, + 'hosting_environment_profile': {'readonly': True}, + 'key_vault_secret_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'subject_name': {'key': 'properties.subjectName', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'pfx_blob': {'key': 'properties.pfxBlob', 'type': 'bytearray'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'self_link': {'key': 'properties.selfLink', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'issue_date': {'key': 'properties.issueDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'valid': {'key': 'properties.valid', 'type': 'bool'}, + 'cer_blob': {'key': 'properties.cerBlob', 'type': 'bytearray'}, + 'public_key_hash': {'key': 'properties.publicKeyHash', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'key_vault_secret_status': {'key': 'properties.keyVaultSecretStatus', 'type': 'str'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'canonical_name': {'key': 'properties.canonicalName', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + host_names: Optional[List[str]] = None, + pfx_blob: Optional[bytearray] = None, + password: Optional[str] = None, + key_vault_id: Optional[str] = None, + key_vault_secret_name: Optional[str] = None, + server_farm_id: Optional[str] = None, + canonical_name: Optional[str] = None, + **kwargs + ): + super(CertificatePatchResource, self).__init__(kind=kind, **kwargs) + self.friendly_name = None + self.subject_name = None + self.host_names = host_names + self.pfx_blob = pfx_blob + self.site_name = None + self.self_link = None + self.issuer = None + self.issue_date = None + self.expiration_date = None + self.password = password + self.thumbprint = None + self.valid = None + self.cer_blob = None + self.public_key_hash = None + self.hosting_environment_profile = None + self.key_vault_id = key_vault_id + self.key_vault_secret_name = key_vault_secret_name + self.key_vault_secret_status = None + self.server_farm_id = server_farm_id + self.canonical_name = canonical_name + + +class ClientRegistration(ProxyOnlyResource): + """ClientRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param client_id: + :type client_id: str + :param client_secret_setting_name: + :type client_secret_setting_name: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + client_id: Optional[str] = None, + client_secret_setting_name: Optional[str] = None, + **kwargs + ): + super(ClientRegistration, self).__init__(kind=kind, **kwargs) + self.client_id = client_id + self.client_secret_setting_name = client_secret_setting_name + + +class CloningInfo(msrest.serialization.Model): + """Information needed for cloning operation. + + All required parameters must be populated in order to send to Azure. + + :param correlation_id: Correlation ID of cloning operation. This ID ties multiple cloning + operations + together to use the same snapshot. + :type correlation_id: str + :param overwrite: :code:`true` to overwrite destination app; otherwise, + :code:`false`. + :type overwrite: bool + :param clone_custom_host_names: :code:`true` to clone custom hostnames from source + app; otherwise, :code:`false`. + :type clone_custom_host_names: bool + :param clone_source_control: :code:`true` to clone source control from source app; + otherwise, :code:`false`. + :type clone_source_control: bool + :param source_web_app_id: Required. ARM resource ID of the source app. App resource ID is of + the form + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + for production slots and + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + for other slots. + :type source_web_app_id: str + :param source_web_app_location: Location of source app ex: West US or North Europe. + :type source_web_app_location: str + :param hosting_environment: App Service Environment. + :type hosting_environment: str + :param app_settings_overrides: Application setting overrides for cloned app. If specified, + these settings override the settings cloned + from source app. Otherwise, application settings from source app are retained. + :type app_settings_overrides: dict[str, str] + :param configure_load_balancing: :code:`true` to configure load balancing for + source and destination app. + :type configure_load_balancing: bool + :param traffic_manager_profile_id: ARM resource ID of the Traffic Manager profile to use, if it + exists. Traffic Manager resource ID is of the form + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + :type traffic_manager_profile_id: str + :param traffic_manager_profile_name: Name of Traffic Manager profile to create. This is only + needed if Traffic Manager profile does not already exist. + :type traffic_manager_profile_name: str + """ + + _validation = { + 'source_web_app_id': {'required': True}, + } + + _attribute_map = { + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'overwrite': {'key': 'overwrite', 'type': 'bool'}, + 'clone_custom_host_names': {'key': 'cloneCustomHostNames', 'type': 'bool'}, + 'clone_source_control': {'key': 'cloneSourceControl', 'type': 'bool'}, + 'source_web_app_id': {'key': 'sourceWebAppId', 'type': 'str'}, + 'source_web_app_location': {'key': 'sourceWebAppLocation', 'type': 'str'}, + 'hosting_environment': {'key': 'hostingEnvironment', 'type': 'str'}, + 'app_settings_overrides': {'key': 'appSettingsOverrides', 'type': '{str}'}, + 'configure_load_balancing': {'key': 'configureLoadBalancing', 'type': 'bool'}, + 'traffic_manager_profile_id': {'key': 'trafficManagerProfileId', 'type': 'str'}, + 'traffic_manager_profile_name': {'key': 'trafficManagerProfileName', 'type': 'str'}, + } + + def __init__( + self, + *, + source_web_app_id: str, + correlation_id: Optional[str] = None, + overwrite: Optional[bool] = None, + clone_custom_host_names: Optional[bool] = None, + clone_source_control: Optional[bool] = None, + source_web_app_location: Optional[str] = None, + hosting_environment: Optional[str] = None, + app_settings_overrides: Optional[Dict[str, str]] = None, + configure_load_balancing: Optional[bool] = None, + traffic_manager_profile_id: Optional[str] = None, + traffic_manager_profile_name: Optional[str] = None, + **kwargs + ): + super(CloningInfo, self).__init__(**kwargs) + self.correlation_id = correlation_id + self.overwrite = overwrite + self.clone_custom_host_names = clone_custom_host_names + self.clone_source_control = clone_source_control + self.source_web_app_id = source_web_app_id + self.source_web_app_location = source_web_app_location + self.hosting_environment = hosting_environment + self.app_settings_overrides = app_settings_overrides + self.configure_load_balancing = configure_load_balancing + self.traffic_manager_profile_id = traffic_manager_profile_id + self.traffic_manager_profile_name = traffic_manager_profile_name + + +class Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: Principal Id of user assigned identity. + :vartype principal_id: str + :ivar client_id: Client Id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class ConnectionStringDictionary(ProxyOnlyResource): + """String dictionary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param properties: Connection strings. + :type properties: dict[str, ~azure.mgmt.web.v2020_09_01.models.ConnStringValueTypePair] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': '{ConnStringValueTypePair}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + properties: Optional[Dict[str, "ConnStringValueTypePair"]] = None, + **kwargs + ): + super(ConnectionStringDictionary, self).__init__(kind=kind, **kwargs) + self.properties = properties + + +class ConnStringInfo(msrest.serialization.Model): + """Database connection string information. + + :param name: Name of connection string. + :type name: str + :param connection_string: Connection string value. + :type connection_string: str + :param type: Type of database. Possible values include: "MySql", "SQLServer", "SQLAzure", + "Custom", "NotificationHub", "ServiceBus", "EventHub", "ApiHub", "DocDb", "RedisCache", + "PostgreSQL". + :type type: str or ~azure.mgmt.web.v2020_09_01.models.ConnectionStringType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + connection_string: Optional[str] = None, + type: Optional[Union[str, "ConnectionStringType"]] = None, + **kwargs + ): + super(ConnStringInfo, self).__init__(**kwargs) + self.name = name + self.connection_string = connection_string + self.type = type + + +class ConnStringValueTypePair(msrest.serialization.Model): + """Database connection string value to type pair. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Value of pair. + :type value: str + :param type: Required. Type of database. Possible values include: "MySql", "SQLServer", + "SQLAzure", "Custom", "NotificationHub", "ServiceBus", "EventHub", "ApiHub", "DocDb", + "RedisCache", "PostgreSQL". + :type type: str or ~azure.mgmt.web.v2020_09_01.models.ConnectionStringType + """ + + _validation = { + 'value': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + value: str, + type: Union[str, "ConnectionStringType"], + **kwargs + ): + super(ConnStringValueTypePair, self).__init__(**kwargs) + self.value = value + self.type = type + + +class Contact(msrest.serialization.Model): + """Contact information for domain registration. If 'Domain Privacy' option is not selected then the contact information is made publicly available through the Whois +directories as per ICANN requirements. + + All required parameters must be populated in order to send to Azure. + + :param address_mailing: Mailing address. + :type address_mailing: ~azure.mgmt.web.v2020_09_01.models.Address + :param email: Required. Email address. + :type email: str + :param fax: Fax number. + :type fax: str + :param job_title: Job title. + :type job_title: str + :param name_first: Required. First name. + :type name_first: str + :param name_last: Required. Last name. + :type name_last: str + :param name_middle: Middle name. + :type name_middle: str + :param organization: Organization contact belongs to. + :type organization: str + :param phone: Required. Phone number. + :type phone: str + """ + + _validation = { + 'email': {'required': True}, + 'name_first': {'required': True}, + 'name_last': {'required': True}, + 'phone': {'required': True}, + } + + _attribute_map = { + 'address_mailing': {'key': 'addressMailing', 'type': 'Address'}, + 'email': {'key': 'email', 'type': 'str'}, + 'fax': {'key': 'fax', 'type': 'str'}, + 'job_title': {'key': 'jobTitle', 'type': 'str'}, + 'name_first': {'key': 'nameFirst', 'type': 'str'}, + 'name_last': {'key': 'nameLast', 'type': 'str'}, + 'name_middle': {'key': 'nameMiddle', 'type': 'str'}, + 'organization': {'key': 'organization', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + } + + def __init__( + self, + *, + email: str, + name_first: str, + name_last: str, + phone: str, + address_mailing: Optional["Address"] = None, + fax: Optional[str] = None, + job_title: Optional[str] = None, + name_middle: Optional[str] = None, + organization: Optional[str] = None, + **kwargs + ): + super(Contact, self).__init__(**kwargs) + self.address_mailing = address_mailing + self.email = email + self.fax = fax + self.job_title = job_title + self.name_first = name_first + self.name_last = name_last + self.name_middle = name_middle + self.organization = organization + self.phone = phone + + +class ContainerCpuStatistics(msrest.serialization.Model): + """ContainerCpuStatistics. + + :param cpu_usage: + :type cpu_usage: ~azure.mgmt.web.v2020_09_01.models.ContainerCpuUsage + :param system_cpu_usage: + :type system_cpu_usage: long + :param online_cpu_count: + :type online_cpu_count: int + :param throttling_data: + :type throttling_data: ~azure.mgmt.web.v2020_09_01.models.ContainerThrottlingData + """ + + _attribute_map = { + 'cpu_usage': {'key': 'cpuUsage', 'type': 'ContainerCpuUsage'}, + 'system_cpu_usage': {'key': 'systemCpuUsage', 'type': 'long'}, + 'online_cpu_count': {'key': 'onlineCpuCount', 'type': 'int'}, + 'throttling_data': {'key': 'throttlingData', 'type': 'ContainerThrottlingData'}, + } + + def __init__( + self, + *, + cpu_usage: Optional["ContainerCpuUsage"] = None, + system_cpu_usage: Optional[int] = None, + online_cpu_count: Optional[int] = None, + throttling_data: Optional["ContainerThrottlingData"] = None, + **kwargs + ): + super(ContainerCpuStatistics, self).__init__(**kwargs) + self.cpu_usage = cpu_usage + self.system_cpu_usage = system_cpu_usage + self.online_cpu_count = online_cpu_count + self.throttling_data = throttling_data + + +class ContainerCpuUsage(msrest.serialization.Model): + """ContainerCpuUsage. + + :param total_usage: + :type total_usage: long + :param per_cpu_usage: + :type per_cpu_usage: list[long] + :param kernel_mode_usage: + :type kernel_mode_usage: long + :param user_mode_usage: + :type user_mode_usage: long + """ + + _attribute_map = { + 'total_usage': {'key': 'totalUsage', 'type': 'long'}, + 'per_cpu_usage': {'key': 'perCpuUsage', 'type': '[long]'}, + 'kernel_mode_usage': {'key': 'kernelModeUsage', 'type': 'long'}, + 'user_mode_usage': {'key': 'userModeUsage', 'type': 'long'}, + } + + def __init__( + self, + *, + total_usage: Optional[int] = None, + per_cpu_usage: Optional[List[int]] = None, + kernel_mode_usage: Optional[int] = None, + user_mode_usage: Optional[int] = None, + **kwargs + ): + super(ContainerCpuUsage, self).__init__(**kwargs) + self.total_usage = total_usage + self.per_cpu_usage = per_cpu_usage + self.kernel_mode_usage = kernel_mode_usage + self.user_mode_usage = user_mode_usage + + +class ContainerInfo(msrest.serialization.Model): + """ContainerInfo. + + :param current_time_stamp: + :type current_time_stamp: ~datetime.datetime + :param previous_time_stamp: + :type previous_time_stamp: ~datetime.datetime + :param current_cpu_stats: + :type current_cpu_stats: ~azure.mgmt.web.v2020_09_01.models.ContainerCpuStatistics + :param previous_cpu_stats: + :type previous_cpu_stats: ~azure.mgmt.web.v2020_09_01.models.ContainerCpuStatistics + :param memory_stats: + :type memory_stats: ~azure.mgmt.web.v2020_09_01.models.ContainerMemoryStatistics + :param name: + :type name: str + :param id: + :type id: str + :param eth0: + :type eth0: ~azure.mgmt.web.v2020_09_01.models.ContainerNetworkInterfaceStatistics + """ + + _attribute_map = { + 'current_time_stamp': {'key': 'currentTimeStamp', 'type': 'iso-8601'}, + 'previous_time_stamp': {'key': 'previousTimeStamp', 'type': 'iso-8601'}, + 'current_cpu_stats': {'key': 'currentCpuStats', 'type': 'ContainerCpuStatistics'}, + 'previous_cpu_stats': {'key': 'previousCpuStats', 'type': 'ContainerCpuStatistics'}, + 'memory_stats': {'key': 'memoryStats', 'type': 'ContainerMemoryStatistics'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'eth0': {'key': 'eth0', 'type': 'ContainerNetworkInterfaceStatistics'}, + } + + def __init__( + self, + *, + current_time_stamp: Optional[datetime.datetime] = None, + previous_time_stamp: Optional[datetime.datetime] = None, + current_cpu_stats: Optional["ContainerCpuStatistics"] = None, + previous_cpu_stats: Optional["ContainerCpuStatistics"] = None, + memory_stats: Optional["ContainerMemoryStatistics"] = None, + name: Optional[str] = None, + id: Optional[str] = None, + eth0: Optional["ContainerNetworkInterfaceStatistics"] = None, + **kwargs + ): + super(ContainerInfo, self).__init__(**kwargs) + self.current_time_stamp = current_time_stamp + self.previous_time_stamp = previous_time_stamp + self.current_cpu_stats = current_cpu_stats + self.previous_cpu_stats = previous_cpu_stats + self.memory_stats = memory_stats + self.name = name + self.id = id + self.eth0 = eth0 + + +class ContainerMemoryStatistics(msrest.serialization.Model): + """ContainerMemoryStatistics. + + :param usage: + :type usage: long + :param max_usage: + :type max_usage: long + :param limit: + :type limit: long + """ + + _attribute_map = { + 'usage': {'key': 'usage', 'type': 'long'}, + 'max_usage': {'key': 'maxUsage', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + } + + def __init__( + self, + *, + usage: Optional[int] = None, + max_usage: Optional[int] = None, + limit: Optional[int] = None, + **kwargs + ): + super(ContainerMemoryStatistics, self).__init__(**kwargs) + self.usage = usage + self.max_usage = max_usage + self.limit = limit + + +class ContainerNetworkInterfaceStatistics(msrest.serialization.Model): + """ContainerNetworkInterfaceStatistics. + + :param rx_bytes: + :type rx_bytes: long + :param rx_packets: + :type rx_packets: long + :param rx_errors: + :type rx_errors: long + :param rx_dropped: + :type rx_dropped: long + :param tx_bytes: + :type tx_bytes: long + :param tx_packets: + :type tx_packets: long + :param tx_errors: + :type tx_errors: long + :param tx_dropped: + :type tx_dropped: long + """ + + _attribute_map = { + 'rx_bytes': {'key': 'rxBytes', 'type': 'long'}, + 'rx_packets': {'key': 'rxPackets', 'type': 'long'}, + 'rx_errors': {'key': 'rxErrors', 'type': 'long'}, + 'rx_dropped': {'key': 'rxDropped', 'type': 'long'}, + 'tx_bytes': {'key': 'txBytes', 'type': 'long'}, + 'tx_packets': {'key': 'txPackets', 'type': 'long'}, + 'tx_errors': {'key': 'txErrors', 'type': 'long'}, + 'tx_dropped': {'key': 'txDropped', 'type': 'long'}, + } + + def __init__( + self, + *, + rx_bytes: Optional[int] = None, + rx_packets: Optional[int] = None, + rx_errors: Optional[int] = None, + rx_dropped: Optional[int] = None, + tx_bytes: Optional[int] = None, + tx_packets: Optional[int] = None, + tx_errors: Optional[int] = None, + tx_dropped: Optional[int] = None, + **kwargs + ): + super(ContainerNetworkInterfaceStatistics, self).__init__(**kwargs) + self.rx_bytes = rx_bytes + self.rx_packets = rx_packets + self.rx_errors = rx_errors + self.rx_dropped = rx_dropped + self.tx_bytes = tx_bytes + self.tx_packets = tx_packets + self.tx_errors = tx_errors + self.tx_dropped = tx_dropped + + +class ContainerThrottlingData(msrest.serialization.Model): + """ContainerThrottlingData. + + :param periods: + :type periods: int + :param throttled_periods: + :type throttled_periods: int + :param throttled_time: + :type throttled_time: int + """ + + _attribute_map = { + 'periods': {'key': 'periods', 'type': 'int'}, + 'throttled_periods': {'key': 'throttledPeriods', 'type': 'int'}, + 'throttled_time': {'key': 'throttledTime', 'type': 'int'}, + } + + def __init__( + self, + *, + periods: Optional[int] = None, + throttled_periods: Optional[int] = None, + throttled_time: Optional[int] = None, + **kwargs + ): + super(ContainerThrottlingData, self).__init__(**kwargs) + self.periods = periods + self.throttled_periods = throttled_periods + self.throttled_time = throttled_time + + +class ContinuousWebJob(ProxyOnlyResource): + """Continuous Web Job Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param status: Job status. Possible values include: "Initializing", "Starting", "Running", + "PendingRestart", "Stopped". + :type status: str or ~azure.mgmt.web.v2020_09_01.models.ContinuousWebJobStatus + :param detailed_status: Detailed status. + :type detailed_status: str + :param log_url: Log URL. + :type log_url: str + :param run_command: Run command. + :type run_command: str + :param url: Job URL. + :type url: str + :param extra_info_url: Extra Info URL. + :type extra_info_url: str + :param web_job_type: Job type. Possible values include: "Continuous", "Triggered". + :type web_job_type: str or ~azure.mgmt.web.v2020_09_01.models.WebJobType + :param error: Error information. + :type error: str + :param using_sdk: Using SDK?. + :type using_sdk: bool + :param settings: Job settings. + :type settings: dict[str, object] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'detailed_status': {'key': 'properties.detailed_status', 'type': 'str'}, + 'log_url': {'key': 'properties.log_url', 'type': 'str'}, + 'run_command': {'key': 'properties.run_command', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'extra_info_url': {'key': 'properties.extra_info_url', 'type': 'str'}, + 'web_job_type': {'key': 'properties.web_job_type', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'str'}, + 'using_sdk': {'key': 'properties.using_sdk', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': '{object}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + status: Optional[Union[str, "ContinuousWebJobStatus"]] = None, + detailed_status: Optional[str] = None, + log_url: Optional[str] = None, + run_command: Optional[str] = None, + url: Optional[str] = None, + extra_info_url: Optional[str] = None, + web_job_type: Optional[Union[str, "WebJobType"]] = None, + error: Optional[str] = None, + using_sdk: Optional[bool] = None, + settings: Optional[Dict[str, object]] = None, + **kwargs + ): + super(ContinuousWebJob, self).__init__(kind=kind, **kwargs) + self.status = status + self.detailed_status = detailed_status + self.log_url = log_url + self.run_command = run_command + self.url = url + self.extra_info_url = extra_info_url + self.web_job_type = web_job_type + self.error = error + self.using_sdk = using_sdk + self.settings = settings + + +class ContinuousWebJobCollection(msrest.serialization.Model): + """Collection of Kudu continuous web job information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.ContinuousWebJob] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ContinuousWebJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ContinuousWebJob"], + **kwargs + ): + super(ContinuousWebJobCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class CookieExpiration(ProxyOnlyResource): + """CookieExpiration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param convention: Possible values include: "FixedTime", "IdentityProviderDerived". + :type convention: str or ~azure.mgmt.web.v2020_09_01.models.CookieExpirationConvention + :param time_to_expiration: + :type time_to_expiration: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'convention': {'key': 'properties.convention', 'type': 'str'}, + 'time_to_expiration': {'key': 'properties.timeToExpiration', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + convention: Optional[Union[str, "CookieExpirationConvention"]] = None, + time_to_expiration: Optional[str] = None, + **kwargs + ): + super(CookieExpiration, self).__init__(kind=kind, **kwargs) + self.convention = convention + self.time_to_expiration = time_to_expiration + + +class CorsSettings(msrest.serialization.Model): + """Cross-Origin Resource Sharing (CORS) settings for the app. + + :param allowed_origins: Gets or sets the list of origins that should be allowed to make cross- + origin + calls (for example: http://example.com:12345). Use "*" to allow all. + :type allowed_origins: list[str] + :param support_credentials: Gets or sets whether CORS requests with credentials are allowed. + See + https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + for more details. + :type support_credentials: bool + """ + + _attribute_map = { + 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'support_credentials': {'key': 'supportCredentials', 'type': 'bool'}, + } + + def __init__( + self, + *, + allowed_origins: Optional[List[str]] = None, + support_credentials: Optional[bool] = None, + **kwargs + ): + super(CorsSettings, self).__init__(**kwargs) + self.allowed_origins = allowed_origins + self.support_credentials = support_credentials + + +class CsmCopySlotEntity(msrest.serialization.Model): + """Copy deployment slot parameters. + + All required parameters must be populated in order to send to Azure. + + :param target_slot: Required. Destination deployment slot during copy operation. + :type target_slot: str + :param site_config: Required. The site object which will be merged with the source slot site + to produce new destination slot site object. + :code:`null` to just copy source slot content. Otherwise a + :code:`Site` + object with properties to override source slot site. + :type site_config: ~azure.mgmt.web.v2020_09_01.models.SiteConfig + """ + + _validation = { + 'target_slot': {'required': True}, + 'site_config': {'required': True}, + } + + _attribute_map = { + 'target_slot': {'key': 'targetSlot', 'type': 'str'}, + 'site_config': {'key': 'siteConfig', 'type': 'SiteConfig'}, + } + + def __init__( + self, + *, + target_slot: str, + site_config: "SiteConfig", + **kwargs + ): + super(CsmCopySlotEntity, self).__init__(**kwargs) + self.target_slot = target_slot + self.site_config = site_config + + +class CsmMoveResourceEnvelope(msrest.serialization.Model): + """Object with a list of the resources that need to be moved and the resource group they should be moved to. + + :param target_resource_group: + :type target_resource_group: str + :param resources: + :type resources: list[str] + """ + + _validation = { + 'target_resource_group': {'max_length': 90, 'min_length': 1, 'pattern': r' ^[-\w\._\(\)]+[^\.]$'}, + } + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + } + + def __init__( + self, + *, + target_resource_group: Optional[str] = None, + resources: Optional[List[str]] = None, + **kwargs + ): + super(CsmMoveResourceEnvelope, self).__init__(**kwargs) + self.target_resource_group = target_resource_group + self.resources = resources + + +class CsmOperationCollection(msrest.serialization.Model): + """Collection of Azure resource manager operation metadata. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.CsmOperationDescription] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CsmOperationDescription]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["CsmOperationDescription"], + **kwargs + ): + super(CsmOperationCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class CsmOperationDescription(msrest.serialization.Model): + """Description of an operation available for Microsoft.Web resource provider. + + :param name: + :type name: str + :param display: Meta data about operation used for display in portal. + :type display: ~azure.mgmt.web.v2020_09_01.models.CsmOperationDisplay + :param origin: + :type origin: str + :param properties: Properties available for a Microsoft.Web resource provider operation. + :type properties: ~azure.mgmt.web.v2020_09_01.models.CsmOperationDescriptionProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'CsmOperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CsmOperationDescriptionProperties'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["CsmOperationDisplay"] = None, + origin: Optional[str] = None, + properties: Optional["CsmOperationDescriptionProperties"] = None, + **kwargs + ): + super(CsmOperationDescription, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.properties = properties + + +class CsmOperationDescriptionProperties(msrest.serialization.Model): + """Properties available for a Microsoft.Web resource provider operation. + + :param service_specification: Resource metrics service provided by Microsoft.Insights resource + provider. + :type service_specification: ~azure.mgmt.web.v2020_09_01.models.ServiceSpecification + """ + + _attribute_map = { + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__( + self, + *, + service_specification: Optional["ServiceSpecification"] = None, + **kwargs + ): + super(CsmOperationDescriptionProperties, self).__init__(**kwargs) + self.service_specification = service_specification + + +class CsmOperationDisplay(msrest.serialization.Model): + """Meta data about operation used for display in portal. + + :param provider: + :type provider: str + :param resource: + :type resource: str + :param operation: + :type operation: str + :param description: + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(CsmOperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class CsmPublishingCredentialsPoliciesCollection(ProxyOnlyResource): + """Publishing Credentials Policies collection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param ftp: Whether FTP is allowed. + :type ftp: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingCredentialsPoliciesEntity + :param scm: Whether Scm Basic Auth is allowed. + :type scm: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingCredentialsPoliciesEntity + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'ftp': {'key': 'properties.ftp', 'type': 'CsmPublishingCredentialsPoliciesEntity'}, + 'scm': {'key': 'properties.scm', 'type': 'CsmPublishingCredentialsPoliciesEntity'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + ftp: Optional["CsmPublishingCredentialsPoliciesEntity"] = None, + scm: Optional["CsmPublishingCredentialsPoliciesEntity"] = None, + **kwargs + ): + super(CsmPublishingCredentialsPoliciesCollection, self).__init__(kind=kind, **kwargs) + self.ftp = ftp + self.scm = scm + + +class CsmPublishingCredentialsPoliciesEntity(ProxyOnlyResource): + """Publishing Credentials Policies parameters. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param allow: :code:`true` to allow access to a publishing method; otherwise, + :code:`false`. + :type allow: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'allow': {'key': 'properties.allow', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + allow: Optional[bool] = None, + **kwargs + ): + super(CsmPublishingCredentialsPoliciesEntity, self).__init__(kind=kind, **kwargs) + self.allow = allow + + +class CsmPublishingProfileOptions(msrest.serialization.Model): + """Publishing options for requested profile. + + :param format: Name of the format. Valid values are: + FileZilla3 + WebDeploy -- default + Ftp. Possible values include: "FileZilla3", "WebDeploy", "Ftp". + :type format: str or ~azure.mgmt.web.v2020_09_01.models.PublishingProfileFormat + :param include_disaster_recovery_endpoints: Include the DisasterRecover endpoint if true. + :type include_disaster_recovery_endpoints: bool + """ + + _attribute_map = { + 'format': {'key': 'format', 'type': 'str'}, + 'include_disaster_recovery_endpoints': {'key': 'includeDisasterRecoveryEndpoints', 'type': 'bool'}, + } + + def __init__( + self, + *, + format: Optional[Union[str, "PublishingProfileFormat"]] = None, + include_disaster_recovery_endpoints: Optional[bool] = None, + **kwargs + ): + super(CsmPublishingProfileOptions, self).__init__(**kwargs) + self.format = format + self.include_disaster_recovery_endpoints = include_disaster_recovery_endpoints + + +class CsmSlotEntity(msrest.serialization.Model): + """Deployment slot parameters. + + All required parameters must be populated in order to send to Azure. + + :param target_slot: Required. Destination deployment slot during swap operation. + :type target_slot: str + :param preserve_vnet: Required. :code:`true` to preserve Virtual Network to the + slot during swap; otherwise, :code:`false`. + :type preserve_vnet: bool + """ + + _validation = { + 'target_slot': {'required': True}, + 'preserve_vnet': {'required': True}, + } + + _attribute_map = { + 'target_slot': {'key': 'targetSlot', 'type': 'str'}, + 'preserve_vnet': {'key': 'preserveVnet', 'type': 'bool'}, + } + + def __init__( + self, + *, + target_slot: str, + preserve_vnet: bool, + **kwargs + ): + super(CsmSlotEntity, self).__init__(**kwargs) + self.target_slot = target_slot + self.preserve_vnet = preserve_vnet + + +class CsmUsageQuota(msrest.serialization.Model): + """Usage of the quota resource. + + :param unit: Units of measurement for the quota resource. + :type unit: str + :param next_reset_time: Next reset time for the resource counter. + :type next_reset_time: ~datetime.datetime + :param current_value: The current value of the resource counter. + :type current_value: long + :param limit: The resource limit. + :type limit: long + :param name: Quota name. + :type name: ~azure.mgmt.web.v2020_09_01.models.LocalizableString + """ + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'next_reset_time': {'key': 'nextResetTime', 'type': 'iso-8601'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'LocalizableString'}, + } + + def __init__( + self, + *, + unit: Optional[str] = None, + next_reset_time: Optional[datetime.datetime] = None, + current_value: Optional[int] = None, + limit: Optional[int] = None, + name: Optional["LocalizableString"] = None, + **kwargs + ): + super(CsmUsageQuota, self).__init__(**kwargs) + self.unit = unit + self.next_reset_time = next_reset_time + self.current_value = current_value + self.limit = limit + self.name = name + + +class CsmUsageQuotaCollection(msrest.serialization.Model): + """Collection of CSM usage quotas. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.CsmUsageQuota] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CsmUsageQuota]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["CsmUsageQuota"], + **kwargs + ): + super(CsmUsageQuotaCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class CustomHostnameAnalysisResult(ProxyOnlyResource): + """Custom domain analysis. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar is_hostname_already_verified: :code:`true` if hostname is already verified; + otherwise, :code:`false`. + :vartype is_hostname_already_verified: bool + :ivar custom_domain_verification_test: DNS verification test result. Possible values include: + "Passed", "Failed", "Skipped". + :vartype custom_domain_verification_test: str or + ~azure.mgmt.web.v2020_09_01.models.DnsVerificationTestResult + :ivar custom_domain_verification_failure_info: Raw failure information if DNS verification + fails. + :vartype custom_domain_verification_failure_info: + ~azure.mgmt.web.v2020_09_01.models.ErrorEntity + :ivar has_conflict_on_scale_unit: :code:`true` if there is a conflict on a scale + unit; otherwise, :code:`false`. + :vartype has_conflict_on_scale_unit: bool + :ivar has_conflict_across_subscription: :code:`true` if there is a conflict across + subscriptions; otherwise, :code:`false`. + :vartype has_conflict_across_subscription: bool + :ivar conflicting_app_resource_id: Name of the conflicting app on scale unit if it's within the + same subscription. + :vartype conflicting_app_resource_id: str + :param c_name_records: CName records controller can see for this hostname. + :type c_name_records: list[str] + :param txt_records: TXT records controller can see for this hostname. + :type txt_records: list[str] + :param a_records: A records controller can see for this hostname. + :type a_records: list[str] + :param alternate_c_name_records: Alternate CName records controller can see for this hostname. + :type alternate_c_name_records: list[str] + :param alternate_txt_records: Alternate TXT records controller can see for this hostname. + :type alternate_txt_records: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'is_hostname_already_verified': {'readonly': True}, + 'custom_domain_verification_test': {'readonly': True}, + 'custom_domain_verification_failure_info': {'readonly': True}, + 'has_conflict_on_scale_unit': {'readonly': True}, + 'has_conflict_across_subscription': {'readonly': True}, + 'conflicting_app_resource_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'is_hostname_already_verified': {'key': 'properties.isHostnameAlreadyVerified', 'type': 'bool'}, + 'custom_domain_verification_test': {'key': 'properties.customDomainVerificationTest', 'type': 'str'}, + 'custom_domain_verification_failure_info': {'key': 'properties.customDomainVerificationFailureInfo', 'type': 'ErrorEntity'}, + 'has_conflict_on_scale_unit': {'key': 'properties.hasConflictOnScaleUnit', 'type': 'bool'}, + 'has_conflict_across_subscription': {'key': 'properties.hasConflictAcrossSubscription', 'type': 'bool'}, + 'conflicting_app_resource_id': {'key': 'properties.conflictingAppResourceId', 'type': 'str'}, + 'c_name_records': {'key': 'properties.cNameRecords', 'type': '[str]'}, + 'txt_records': {'key': 'properties.txtRecords', 'type': '[str]'}, + 'a_records': {'key': 'properties.aRecords', 'type': '[str]'}, + 'alternate_c_name_records': {'key': 'properties.alternateCNameRecords', 'type': '[str]'}, + 'alternate_txt_records': {'key': 'properties.alternateTxtRecords', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + c_name_records: Optional[List[str]] = None, + txt_records: Optional[List[str]] = None, + a_records: Optional[List[str]] = None, + alternate_c_name_records: Optional[List[str]] = None, + alternate_txt_records: Optional[List[str]] = None, + **kwargs + ): + super(CustomHostnameAnalysisResult, self).__init__(kind=kind, **kwargs) + self.is_hostname_already_verified = None + self.custom_domain_verification_test = None + self.custom_domain_verification_failure_info = None + self.has_conflict_on_scale_unit = None + self.has_conflict_across_subscription = None + self.conflicting_app_resource_id = None + self.c_name_records = c_name_records + self.txt_records = txt_records + self.a_records = a_records + self.alternate_c_name_records = alternate_c_name_records + self.alternate_txt_records = alternate_txt_records + + +class CustomOpenIdConnectProvider(ProxyOnlyResource): + """CustomOpenIdConnectProvider. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_09_01.models.OpenIdConnectRegistration + :param login: + :type login: ~azure.mgmt.web.v2020_09_01.models.OpenIdConnectLogin + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'OpenIdConnectRegistration'}, + 'login': {'key': 'properties.login', 'type': 'OpenIdConnectLogin'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + registration: Optional["OpenIdConnectRegistration"] = None, + login: Optional["OpenIdConnectLogin"] = None, + **kwargs + ): + super(CustomOpenIdConnectProvider, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.registration = registration + self.login = login + + +class DatabaseBackupSetting(msrest.serialization.Model): + """Database backup settings. + + All required parameters must be populated in order to send to Azure. + + :param database_type: Required. Database type (e.g. SqlAzure / MySql). Possible values include: + "SqlAzure", "MySql", "LocalMySql", "PostgreSql". + :type database_type: str or ~azure.mgmt.web.v2020_09_01.models.DatabaseType + :param name: + :type name: str + :param connection_string_name: Contains a connection string name that is linked to the + SiteConfig.ConnectionStrings. + This is used during restore with overwrite connection strings options. + :type connection_string_name: str + :param connection_string: Contains a connection string to a database which is being backed up + or restored. If the restore should happen to a new database, the database name inside is the + new one. + :type connection_string: str + """ + + _validation = { + 'database_type': {'required': True}, + } + + _attribute_map = { + 'database_type': {'key': 'databaseType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'connection_string_name': {'key': 'connectionStringName', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + } + + def __init__( + self, + *, + database_type: Union[str, "DatabaseType"], + name: Optional[str] = None, + connection_string_name: Optional[str] = None, + connection_string: Optional[str] = None, + **kwargs + ): + super(DatabaseBackupSetting, self).__init__(**kwargs) + self.database_type = database_type + self.name = name + self.connection_string_name = connection_string_name + self.connection_string = connection_string + + +class DataSource(msrest.serialization.Model): + """Class representing data source used by the detectors. + + :param instructions: Instructions if any for the data source. + :type instructions: list[str] + :param data_source_uri: Datasource Uri Links. + :type data_source_uri: list[~azure.mgmt.web.v2020_09_01.models.NameValuePair] + """ + + _attribute_map = { + 'instructions': {'key': 'instructions', 'type': '[str]'}, + 'data_source_uri': {'key': 'dataSourceUri', 'type': '[NameValuePair]'}, + } + + def __init__( + self, + *, + instructions: Optional[List[str]] = None, + data_source_uri: Optional[List["NameValuePair"]] = None, + **kwargs + ): + super(DataSource, self).__init__(**kwargs) + self.instructions = instructions + self.data_source_uri = data_source_uri + + +class DataTableResponseColumn(msrest.serialization.Model): + """Column definition. + + :param column_name: Name of the column. + :type column_name: str + :param data_type: Data type which looks like 'String' or 'Int32'. + :type data_type: str + :param column_type: Column Type. + :type column_type: str + """ + + _attribute_map = { + 'column_name': {'key': 'columnName', 'type': 'str'}, + 'data_type': {'key': 'dataType', 'type': 'str'}, + 'column_type': {'key': 'columnType', 'type': 'str'}, + } + + def __init__( + self, + *, + column_name: Optional[str] = None, + data_type: Optional[str] = None, + column_type: Optional[str] = None, + **kwargs + ): + super(DataTableResponseColumn, self).__init__(**kwargs) + self.column_name = column_name + self.data_type = data_type + self.column_type = column_type + + +class DataTableResponseObject(msrest.serialization.Model): + """Data Table which defines columns and raw row values. + + :param table_name: Name of the table. + :type table_name: str + :param columns: List of columns with data types. + :type columns: list[~azure.mgmt.web.v2020_09_01.models.DataTableResponseColumn] + :param rows: Raw row values. + :type rows: list[list[str]] + """ + + _attribute_map = { + 'table_name': {'key': 'tableName', 'type': 'str'}, + 'columns': {'key': 'columns', 'type': '[DataTableResponseColumn]'}, + 'rows': {'key': 'rows', 'type': '[[str]]'}, + } + + def __init__( + self, + *, + table_name: Optional[str] = None, + columns: Optional[List["DataTableResponseColumn"]] = None, + rows: Optional[List[List[str]]] = None, + **kwargs + ): + super(DataTableResponseObject, self).__init__(**kwargs) + self.table_name = table_name + self.columns = columns + self.rows = rows + + +class DefaultErrorResponse(msrest.serialization.Model): + """App Service error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Error model. + :vartype error: ~azure.mgmt.web.v2020_09_01.models.DefaultErrorResponseError + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'DefaultErrorResponseError'}, + } + + def __init__( + self, + **kwargs + ): + super(DefaultErrorResponse, self).__init__(**kwargs) + self.error = None + + +class DefaultErrorResponseError(msrest.serialization.Model): + """Error model. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Standardized string to programmatically identify the error. + :vartype code: str + :ivar message: Detailed error description and debugging information. + :vartype message: str + :ivar target: Detailed error description and debugging information. + :vartype target: str + :param details: + :type details: list[~azure.mgmt.web.v2020_09_01.models.DefaultErrorResponseErrorDetailsItem] + :ivar innererror: More information to debug error. + :vartype innererror: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'innererror': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[DefaultErrorResponseErrorDetailsItem]'}, + 'innererror': {'key': 'innererror', 'type': 'str'}, + } + + def __init__( + self, + *, + details: Optional[List["DefaultErrorResponseErrorDetailsItem"]] = None, + **kwargs + ): + super(DefaultErrorResponseError, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = details + self.innererror = None + + +class DefaultErrorResponseErrorDetailsItem(msrest.serialization.Model): + """Detailed errors. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Standardized string to programmatically identify the error. + :vartype code: str + :ivar message: Detailed error description and debugging information. + :vartype message: str + :ivar target: Detailed error description and debugging information. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DefaultErrorResponseErrorDetailsItem, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + + +class DeletedAppRestoreRequest(ProxyOnlyResource): + """Details about restoring a deleted app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param deleted_site_id: ARM resource ID of the deleted app. Example: + /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}. + :type deleted_site_id: str + :param recover_configuration: If true, deleted site configuration, in addition to content, will + be restored. + :type recover_configuration: bool + :param snapshot_time: Point in time to restore the deleted app from, formatted as a DateTime + string. + If unspecified, default value is the time that the app was deleted. + :type snapshot_time: str + :param use_dr_secondary: If true, the snapshot is retrieved from DRSecondary endpoint. + :type use_dr_secondary: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'deleted_site_id': {'key': 'properties.deletedSiteId', 'type': 'str'}, + 'recover_configuration': {'key': 'properties.recoverConfiguration', 'type': 'bool'}, + 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'str'}, + 'use_dr_secondary': {'key': 'properties.useDRSecondary', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + deleted_site_id: Optional[str] = None, + recover_configuration: Optional[bool] = None, + snapshot_time: Optional[str] = None, + use_dr_secondary: Optional[bool] = None, + **kwargs + ): + super(DeletedAppRestoreRequest, self).__init__(kind=kind, **kwargs) + self.deleted_site_id = deleted_site_id + self.recover_configuration = recover_configuration + self.snapshot_time = snapshot_time + self.use_dr_secondary = use_dr_secondary + + +class DeletedSite(ProxyOnlyResource): + """A deleted app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar deleted_site_id: Numeric id for the deleted site. + :vartype deleted_site_id: int + :ivar deleted_timestamp: Time in UTC when the app was deleted. + :vartype deleted_timestamp: str + :ivar subscription: Subscription containing the deleted site. + :vartype subscription: str + :ivar resource_group: ResourceGroup that contained the deleted site. + :vartype resource_group: str + :ivar deleted_site_name: Name of the deleted site. + :vartype deleted_site_name: str + :ivar slot: Slot of the deleted site. + :vartype slot: str + :ivar kind_properties_kind: Kind of site that was deleted. + :vartype kind_properties_kind: str + :ivar geo_region_name: Geo Region of the deleted site. + :vartype geo_region_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'deleted_site_id': {'readonly': True}, + 'deleted_timestamp': {'readonly': True}, + 'subscription': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'deleted_site_name': {'readonly': True}, + 'slot': {'readonly': True}, + 'kind_properties_kind': {'readonly': True}, + 'geo_region_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'deleted_site_id': {'key': 'properties.deletedSiteId', 'type': 'int'}, + 'deleted_timestamp': {'key': 'properties.deletedTimestamp', 'type': 'str'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'deleted_site_name': {'key': 'properties.deletedSiteName', 'type': 'str'}, + 'slot': {'key': 'properties.slot', 'type': 'str'}, + 'kind_properties_kind': {'key': 'properties.kind', 'type': 'str'}, + 'geo_region_name': {'key': 'properties.geoRegionName', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(DeletedSite, self).__init__(kind=kind, **kwargs) + self.deleted_site_id = None + self.deleted_timestamp = None + self.subscription = None + self.resource_group = None + self.deleted_site_name = None + self.slot = None + self.kind_properties_kind = None + self.geo_region_name = None + + +class DeletedWebAppCollection(msrest.serialization.Model): + """Collection of deleted apps. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.DeletedSite] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DeletedSite]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DeletedSite"], + **kwargs + ): + super(DeletedWebAppCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class Deployment(ProxyOnlyResource): + """User credentials used for publishing activity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param status: Deployment status. + :type status: int + :param message: Details about deployment status. + :type message: str + :param author: Who authored the deployment. + :type author: str + :param deployer: Who performed the deployment. + :type deployer: str + :param author_email: Author email. + :type author_email: str + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param end_time: End time. + :type end_time: ~datetime.datetime + :param active: True if deployment is currently active, false if completed and null if not + started. + :type active: bool + :param details: Details on deployment. + :type details: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'status': {'key': 'properties.status', 'type': 'int'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'author': {'key': 'properties.author', 'type': 'str'}, + 'deployer': {'key': 'properties.deployer', 'type': 'str'}, + 'author_email': {'key': 'properties.author_email', 'type': 'str'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.end_time', 'type': 'iso-8601'}, + 'active': {'key': 'properties.active', 'type': 'bool'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + status: Optional[int] = None, + message: Optional[str] = None, + author: Optional[str] = None, + deployer: Optional[str] = None, + author_email: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + active: Optional[bool] = None, + details: Optional[str] = None, + **kwargs + ): + super(Deployment, self).__init__(kind=kind, **kwargs) + self.status = status + self.message = message + self.author = author + self.deployer = deployer + self.author_email = author_email + self.start_time = start_time + self.end_time = end_time + self.active = active + self.details = details + + +class DeploymentCollection(msrest.serialization.Model): + """Collection of app deployments. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.Deployment] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Deployment]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Deployment"], + **kwargs + ): + super(DeploymentCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DeploymentLocations(msrest.serialization.Model): + """List of available locations (regions or App Service Environments) for +deployment of App Service resources. + + :param locations: Available regions. + :type locations: list[~azure.mgmt.web.v2020_09_01.models.GeoRegion] + :param hosting_environments: Available App Service Environments with full descriptions of the + environments. + :type hosting_environments: list[~azure.mgmt.web.v2020_09_01.models.AppServiceEnvironment] + :param hosting_environment_deployment_infos: Available App Service Environments with basic + information. + :type hosting_environment_deployment_infos: + list[~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentDeploymentInfo] + """ + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[GeoRegion]'}, + 'hosting_environments': {'key': 'hostingEnvironments', 'type': '[AppServiceEnvironment]'}, + 'hosting_environment_deployment_infos': {'key': 'hostingEnvironmentDeploymentInfos', 'type': '[HostingEnvironmentDeploymentInfo]'}, + } + + def __init__( + self, + *, + locations: Optional[List["GeoRegion"]] = None, + hosting_environments: Optional[List["AppServiceEnvironment"]] = None, + hosting_environment_deployment_infos: Optional[List["HostingEnvironmentDeploymentInfo"]] = None, + **kwargs + ): + super(DeploymentLocations, self).__init__(**kwargs) + self.locations = locations + self.hosting_environments = hosting_environments + self.hosting_environment_deployment_infos = hosting_environment_deployment_infos + + +class DetectorAbnormalTimePeriod(msrest.serialization.Model): + """Class representing Abnormal Time Period detected. + + :param start_time: Start time of the correlated event. + :type start_time: ~datetime.datetime + :param end_time: End time of the correlated event. + :type end_time: ~datetime.datetime + :param message: Message describing the event. + :type message: str + :param source: Represents the name of the Detector. + :type source: str + :param priority: Represents the rank of the Detector. + :type priority: float + :param meta_data: Downtime metadata. + :type meta_data: list[list[~azure.mgmt.web.v2020_09_01.models.NameValuePair]] + :param type: Represents the type of the Detector. Possible values include: "ServiceIncident", + "AppDeployment", "AppCrash", "RuntimeIssueDetected", "AseDeployment", "UserIssue", + "PlatformIssue", "Other". + :type type: str or ~azure.mgmt.web.v2020_09_01.models.IssueType + :param solutions: List of proposed solutions. + :type solutions: list[~azure.mgmt.web.v2020_09_01.models.Solution] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'float'}, + 'meta_data': {'key': 'metaData', 'type': '[[NameValuePair]]'}, + 'type': {'key': 'type', 'type': 'str'}, + 'solutions': {'key': 'solutions', 'type': '[Solution]'}, + } + + def __init__( + self, + *, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + message: Optional[str] = None, + source: Optional[str] = None, + priority: Optional[float] = None, + meta_data: Optional[List[List["NameValuePair"]]] = None, + type: Optional[Union[str, "IssueType"]] = None, + solutions: Optional[List["Solution"]] = None, + **kwargs + ): + super(DetectorAbnormalTimePeriod, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.message = message + self.source = source + self.priority = priority + self.meta_data = meta_data + self.type = type + self.solutions = solutions + + +class DetectorDefinition(ProxyOnlyResource): + """Class representing detector definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar display_name: Display name of the detector. + :vartype display_name: str + :ivar description: Description of the detector. + :vartype description: str + :ivar rank: Detector Rank. + :vartype rank: float + :ivar is_enabled: Flag representing whether detector is enabled or not. + :vartype is_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'rank': {'readonly': True}, + 'is_enabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'rank': {'key': 'properties.rank', 'type': 'float'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(DetectorDefinition, self).__init__(kind=kind, **kwargs) + self.display_name = None + self.description = None + self.rank = None + self.is_enabled = None + + +class DetectorInfo(msrest.serialization.Model): + """Definition of Detector. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar description: Short description of the detector and its purpose. + :vartype description: str + :ivar category: Support Category. + :vartype category: str + :ivar sub_category: Support Sub Category. + :vartype sub_category: str + :ivar support_topic_id: Support Topic Id. + :vartype support_topic_id: str + """ + + _validation = { + 'description': {'readonly': True}, + 'category': {'readonly': True}, + 'sub_category': {'readonly': True}, + 'support_topic_id': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'sub_category': {'key': 'subCategory', 'type': 'str'}, + 'support_topic_id': {'key': 'supportTopicId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DetectorInfo, self).__init__(**kwargs) + self.description = None + self.category = None + self.sub_category = None + self.support_topic_id = None + + +class DetectorResponse(ProxyOnlyResource): + """Class representing Response from Detector. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param metadata: metadata for the detector. + :type metadata: ~azure.mgmt.web.v2020_09_01.models.DetectorInfo + :param dataset: Data Set. + :type dataset: list[~azure.mgmt.web.v2020_09_01.models.DiagnosticData] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'metadata': {'key': 'properties.metadata', 'type': 'DetectorInfo'}, + 'dataset': {'key': 'properties.dataset', 'type': '[DiagnosticData]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + metadata: Optional["DetectorInfo"] = None, + dataset: Optional[List["DiagnosticData"]] = None, + **kwargs + ): + super(DetectorResponse, self).__init__(kind=kind, **kwargs) + self.metadata = metadata + self.dataset = dataset + + +class DetectorResponseCollection(msrest.serialization.Model): + """Collection of detector responses. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.DetectorResponse] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DetectorResponse]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DetectorResponse"], + **kwargs + ): + super(DetectorResponseCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DiagnosticAnalysis(ProxyOnlyResource): + """Class representing a diagnostic analysis done on an application. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param abnormal_time_periods: List of time periods. + :type abnormal_time_periods: list[~azure.mgmt.web.v2020_09_01.models.AbnormalTimePeriod] + :param payload: Data by each detector. + :type payload: list[~azure.mgmt.web.v2020_09_01.models.AnalysisData] + :param non_correlated_detectors: Data by each detector for detectors that did not corelate. + :type non_correlated_detectors: list[~azure.mgmt.web.v2020_09_01.models.DetectorDefinition] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'abnormal_time_periods': {'key': 'properties.abnormalTimePeriods', 'type': '[AbnormalTimePeriod]'}, + 'payload': {'key': 'properties.payload', 'type': '[AnalysisData]'}, + 'non_correlated_detectors': {'key': 'properties.nonCorrelatedDetectors', 'type': '[DetectorDefinition]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + abnormal_time_periods: Optional[List["AbnormalTimePeriod"]] = None, + payload: Optional[List["AnalysisData"]] = None, + non_correlated_detectors: Optional[List["DetectorDefinition"]] = None, + **kwargs + ): + super(DiagnosticAnalysis, self).__init__(kind=kind, **kwargs) + self.start_time = start_time + self.end_time = end_time + self.abnormal_time_periods = abnormal_time_periods + self.payload = payload + self.non_correlated_detectors = non_correlated_detectors + + +class DiagnosticAnalysisCollection(msrest.serialization.Model): + """Collection of Diagnostic Analyses. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.AnalysisDefinition] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AnalysisDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["AnalysisDefinition"], + **kwargs + ): + super(DiagnosticAnalysisCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DiagnosticCategory(ProxyOnlyResource): + """Class representing detector definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar description: Description of the diagnostic category. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(DiagnosticCategory, self).__init__(kind=kind, **kwargs) + self.description = None + + +class DiagnosticCategoryCollection(msrest.serialization.Model): + """Collection of Diagnostic Categories. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.DiagnosticCategory] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DiagnosticCategory]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DiagnosticCategory"], + **kwargs + ): + super(DiagnosticCategoryCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DiagnosticData(msrest.serialization.Model): + """Set of data with rendering instructions. + + :param table: Data in table form. + :type table: ~azure.mgmt.web.v2020_09_01.models.DataTableResponseObject + :param rendering_properties: Properties that describe how the table should be rendered. + :type rendering_properties: ~azure.mgmt.web.v2020_09_01.models.Rendering + """ + + _attribute_map = { + 'table': {'key': 'table', 'type': 'DataTableResponseObject'}, + 'rendering_properties': {'key': 'renderingProperties', 'type': 'Rendering'}, + } + + def __init__( + self, + *, + table: Optional["DataTableResponseObject"] = None, + rendering_properties: Optional["Rendering"] = None, + **kwargs + ): + super(DiagnosticData, self).__init__(**kwargs) + self.table = table + self.rendering_properties = rendering_properties + + +class DiagnosticDetectorCollection(msrest.serialization.Model): + """Collection of Diagnostic Detectors. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.DetectorDefinition] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DetectorDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DetectorDefinition"], + **kwargs + ): + super(DiagnosticDetectorCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DiagnosticDetectorResponse(ProxyOnlyResource): + """Class representing Response from Diagnostic Detectors. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param issue_detected: Flag representing Issue was detected. + :type issue_detected: bool + :param detector_definition: Detector's definition. + :type detector_definition: ~azure.mgmt.web.v2020_09_01.models.DetectorDefinition + :param metrics: Metrics provided by the detector. + :type metrics: list[~azure.mgmt.web.v2020_09_01.models.DiagnosticMetricSet] + :param abnormal_time_periods: List of Correlated events found by the detector. + :type abnormal_time_periods: + list[~azure.mgmt.web.v2020_09_01.models.DetectorAbnormalTimePeriod] + :param data: Additional Data that detector wants to send. + :type data: list[list[~azure.mgmt.web.v2020_09_01.models.NameValuePair]] + :param response_meta_data: Meta Data. + :type response_meta_data: ~azure.mgmt.web.v2020_09_01.models.ResponseMetaData + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'issue_detected': {'key': 'properties.issueDetected', 'type': 'bool'}, + 'detector_definition': {'key': 'properties.detectorDefinition', 'type': 'DetectorDefinition'}, + 'metrics': {'key': 'properties.metrics', 'type': '[DiagnosticMetricSet]'}, + 'abnormal_time_periods': {'key': 'properties.abnormalTimePeriods', 'type': '[DetectorAbnormalTimePeriod]'}, + 'data': {'key': 'properties.data', 'type': '[[NameValuePair]]'}, + 'response_meta_data': {'key': 'properties.responseMetaData', 'type': 'ResponseMetaData'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + issue_detected: Optional[bool] = None, + detector_definition: Optional["DetectorDefinition"] = None, + metrics: Optional[List["DiagnosticMetricSet"]] = None, + abnormal_time_periods: Optional[List["DetectorAbnormalTimePeriod"]] = None, + data: Optional[List[List["NameValuePair"]]] = None, + response_meta_data: Optional["ResponseMetaData"] = None, + **kwargs + ): + super(DiagnosticDetectorResponse, self).__init__(kind=kind, **kwargs) + self.start_time = start_time + self.end_time = end_time + self.issue_detected = issue_detected + self.detector_definition = detector_definition + self.metrics = metrics + self.abnormal_time_periods = abnormal_time_periods + self.data = data + self.response_meta_data = response_meta_data + + +class DiagnosticMetricSample(msrest.serialization.Model): + """Class representing Diagnostic Metric. + + :param timestamp: Time at which metric is measured. + :type timestamp: ~datetime.datetime + :param role_instance: Role Instance. Null if this counter is not per instance + This is returned and should be whichever instance name we desire to be returned + i.e. CPU and Memory return RDWORKERNAME (LargeDed..._IN_0) + where RDWORKERNAME is Machine name below and RoleInstance name in parenthesis. + :type role_instance: str + :param total: Total value of the metric. If multiple measurements are made this will have sum + of all. + :type total: float + :param maximum: Maximum of the metric sampled during the time period. + :type maximum: float + :param minimum: Minimum of the metric sampled during the time period. + :type minimum: float + :param is_aggregated: Whether the values are aggregates across all workers or not. + :type is_aggregated: bool + """ + + _attribute_map = { + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'role_instance': {'key': 'roleInstance', 'type': 'str'}, + 'total': {'key': 'total', 'type': 'float'}, + 'maximum': {'key': 'maximum', 'type': 'float'}, + 'minimum': {'key': 'minimum', 'type': 'float'}, + 'is_aggregated': {'key': 'isAggregated', 'type': 'bool'}, + } + + def __init__( + self, + *, + timestamp: Optional[datetime.datetime] = None, + role_instance: Optional[str] = None, + total: Optional[float] = None, + maximum: Optional[float] = None, + minimum: Optional[float] = None, + is_aggregated: Optional[bool] = None, + **kwargs + ): + super(DiagnosticMetricSample, self).__init__(**kwargs) + self.timestamp = timestamp + self.role_instance = role_instance + self.total = total + self.maximum = maximum + self.minimum = minimum + self.is_aggregated = is_aggregated + + +class DiagnosticMetricSet(msrest.serialization.Model): + """Class representing Diagnostic Metric information. + + :param name: Name of the metric. + :type name: str + :param unit: Metric's unit. + :type unit: str + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param time_grain: Presented time grain. Supported grains at the moment are PT1M, PT1H, P1D. + :type time_grain: str + :param values: Collection of metric values for the selected period based on the + {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain}. + :type values: list[~azure.mgmt.web.v2020_09_01.models.DiagnosticMetricSample] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[DiagnosticMetricSample]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + unit: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + values: Optional[List["DiagnosticMetricSample"]] = None, + **kwargs + ): + super(DiagnosticMetricSet, self).__init__(**kwargs) + self.name = name + self.unit = unit + self.start_time = start_time + self.end_time = end_time + self.time_grain = time_grain + self.values = values + + +class Dimension(msrest.serialization.Model): + """Dimension of a resource metric. For e.g. instance specific HTTP requests for a web app, +where instance name is dimension of the metric HTTP request. + + :param name: + :type name: str + :param display_name: + :type display_name: str + :param internal_name: + :type internal_name: str + :param to_be_exported_for_shoebox: + :type to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + internal_name: Optional[str] = None, + to_be_exported_for_shoebox: Optional[bool] = None, + **kwargs + ): + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.internal_name = internal_name + self.to_be_exported_for_shoebox = to_be_exported_for_shoebox + + +class Domain(Resource): + """Information about a domain. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param contact_admin: Administrative contact. + :type contact_admin: ~azure.mgmt.web.v2020_09_01.models.Contact + :param contact_billing: Billing contact. + :type contact_billing: ~azure.mgmt.web.v2020_09_01.models.Contact + :param contact_registrant: Registrant contact. + :type contact_registrant: ~azure.mgmt.web.v2020_09_01.models.Contact + :param contact_tech: Technical contact. + :type contact_tech: ~azure.mgmt.web.v2020_09_01.models.Contact + :ivar registration_status: Domain registration status. Possible values include: "Active", + "Awaiting", "Cancelled", "Confiscated", "Disabled", "Excluded", "Expired", "Failed", "Held", + "Locked", "Parked", "Pending", "Reserved", "Reverted", "Suspended", "Transferred", "Unknown", + "Unlocked", "Unparked", "Updated", "JsonConverterFailed". + :vartype registration_status: str or ~azure.mgmt.web.v2020_09_01.models.DomainStatus + :ivar provisioning_state: Domain provisioning state. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.ProvisioningState + :ivar name_servers: Name servers. + :vartype name_servers: list[str] + :param privacy: :code:`true` if domain privacy is enabled for this domain; + otherwise, :code:`false`. + :type privacy: bool + :ivar created_time: Domain creation timestamp. + :vartype created_time: ~datetime.datetime + :ivar expiration_time: Domain expiration timestamp. + :vartype expiration_time: ~datetime.datetime + :ivar last_renewed_time: Timestamp when the domain was renewed last time. + :vartype last_renewed_time: ~datetime.datetime + :param auto_renew: :code:`true` if the domain should be automatically renewed; + otherwise, :code:`false`. + :type auto_renew: bool + :ivar ready_for_dns_record_management: :code:`true` if Azure can assign this + domain to App Service apps; otherwise, :code:`false`. This value will be + :code:`true` if domain registration status is active and + it is hosted on name servers Azure has programmatic access to. + :vartype ready_for_dns_record_management: bool + :ivar managed_host_names: All hostnames derived from the domain and assigned to Azure + resources. + :vartype managed_host_names: list[~azure.mgmt.web.v2020_09_01.models.HostName] + :param consent: Legal agreement consent. + :type consent: ~azure.mgmt.web.v2020_09_01.models.DomainPurchaseConsent + :ivar domain_not_renewable_reasons: Reasons why domain is not renewable. + :vartype domain_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2020_09_01.models.DomainPropertiesDomainNotRenewableReasonsItem] + :param dns_type: Current DNS type. Possible values include: "AzureDns", + "DefaultDomainRegistrarDns". + :type dns_type: str or ~azure.mgmt.web.v2020_09_01.models.DnsType + :param dns_zone_id: Azure DNS Zone to use. + :type dns_zone_id: str + :param target_dns_type: Target DNS type (would be used for migration). Possible values include: + "AzureDns", "DefaultDomainRegistrarDns". + :type target_dns_type: str or ~azure.mgmt.web.v2020_09_01.models.DnsType + :param auth_code: + :type auth_code: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'registration_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'name_servers': {'readonly': True}, + 'created_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'last_renewed_time': {'readonly': True}, + 'ready_for_dns_record_management': {'readonly': True}, + 'managed_host_names': {'readonly': True}, + 'domain_not_renewable_reasons': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'contact_admin': {'key': 'properties.contactAdmin', 'type': 'Contact'}, + 'contact_billing': {'key': 'properties.contactBilling', 'type': 'Contact'}, + 'contact_registrant': {'key': 'properties.contactRegistrant', 'type': 'Contact'}, + 'contact_tech': {'key': 'properties.contactTech', 'type': 'Contact'}, + 'registration_status': {'key': 'properties.registrationStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name_servers': {'key': 'properties.nameServers', 'type': '[str]'}, + 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'last_renewed_time': {'key': 'properties.lastRenewedTime', 'type': 'iso-8601'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'ready_for_dns_record_management': {'key': 'properties.readyForDnsRecordManagement', 'type': 'bool'}, + 'managed_host_names': {'key': 'properties.managedHostNames', 'type': '[HostName]'}, + 'consent': {'key': 'properties.consent', 'type': 'DomainPurchaseConsent'}, + 'domain_not_renewable_reasons': {'key': 'properties.domainNotRenewableReasons', 'type': '[str]'}, + 'dns_type': {'key': 'properties.dnsType', 'type': 'str'}, + 'dns_zone_id': {'key': 'properties.dnsZoneId', 'type': 'str'}, + 'target_dns_type': {'key': 'properties.targetDnsType', 'type': 'str'}, + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + contact_admin: Optional["Contact"] = None, + contact_billing: Optional["Contact"] = None, + contact_registrant: Optional["Contact"] = None, + contact_tech: Optional["Contact"] = None, + privacy: Optional[bool] = None, + auto_renew: Optional[bool] = True, + consent: Optional["DomainPurchaseConsent"] = None, + dns_type: Optional[Union[str, "DnsType"]] = None, + dns_zone_id: Optional[str] = None, + target_dns_type: Optional[Union[str, "DnsType"]] = None, + auth_code: Optional[str] = None, + **kwargs + ): + super(Domain, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.contact_admin = contact_admin + self.contact_billing = contact_billing + self.contact_registrant = contact_registrant + self.contact_tech = contact_tech + self.registration_status = None + self.provisioning_state = None + self.name_servers = None + self.privacy = privacy + self.created_time = None + self.expiration_time = None + self.last_renewed_time = None + self.auto_renew = auto_renew + self.ready_for_dns_record_management = None + self.managed_host_names = None + self.consent = consent + self.domain_not_renewable_reasons = None + self.dns_type = dns_type + self.dns_zone_id = dns_zone_id + self.target_dns_type = target_dns_type + self.auth_code = auth_code + + +class DomainAvailabilityCheckResult(msrest.serialization.Model): + """Domain availability check result. + + :param name: Name of the domain. + :type name: str + :param available: :code:`true` if domain can be purchased using CreateDomain API; + otherwise, :code:`false`. + :type available: bool + :param domain_type: Valid values are Regular domain: Azure will charge the full price of domain + registration, SoftDeleted: Purchasing this domain will simply restore it and this operation + will not cost anything. Possible values include: "Regular", "SoftDeleted". + :type domain_type: str or ~azure.mgmt.web.v2020_09_01.models.DomainType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'available': {'key': 'available', 'type': 'bool'}, + 'domain_type': {'key': 'domainType', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + available: Optional[bool] = None, + domain_type: Optional[Union[str, "DomainType"]] = None, + **kwargs + ): + super(DomainAvailabilityCheckResult, self).__init__(**kwargs) + self.name = name + self.available = available + self.domain_type = domain_type + + +class DomainCollection(msrest.serialization.Model): + """Collection of domains. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.Domain] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Domain]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Domain"], + **kwargs + ): + super(DomainCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DomainControlCenterSsoRequest(msrest.serialization.Model): + """Single sign-on request information for domain management. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar url: URL where the single sign-on request is to be made. + :vartype url: str + :ivar post_parameter_key: Post parameter key. + :vartype post_parameter_key: str + :ivar post_parameter_value: Post parameter value. Client should use 'application/x-www-form- + urlencoded' encoding for this value. + :vartype post_parameter_value: str + """ + + _validation = { + 'url': {'readonly': True}, + 'post_parameter_key': {'readonly': True}, + 'post_parameter_value': {'readonly': True}, + } + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'post_parameter_key': {'key': 'postParameterKey', 'type': 'str'}, + 'post_parameter_value': {'key': 'postParameterValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainControlCenterSsoRequest, self).__init__(**kwargs) + self.url = None + self.post_parameter_key = None + self.post_parameter_value = None + + +class DomainOwnershipIdentifier(ProxyOnlyResource): + """Domain ownership Identifier. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param ownership_id: Ownership Id. + :type ownership_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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'ownership_id': {'key': 'properties.ownershipId', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + ownership_id: Optional[str] = None, + **kwargs + ): + super(DomainOwnershipIdentifier, self).__init__(kind=kind, **kwargs) + self.ownership_id = ownership_id + + +class DomainOwnershipIdentifierCollection(msrest.serialization.Model): + """Collection of domain ownership identifiers. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.DomainOwnershipIdentifier] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DomainOwnershipIdentifier]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DomainOwnershipIdentifier"], + **kwargs + ): + super(DomainOwnershipIdentifierCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DomainPatchResource(ProxyOnlyResource): + """ARM resource for a domain. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param contact_admin: Administrative contact. + :type contact_admin: ~azure.mgmt.web.v2020_09_01.models.Contact + :param contact_billing: Billing contact. + :type contact_billing: ~azure.mgmt.web.v2020_09_01.models.Contact + :param contact_registrant: Registrant contact. + :type contact_registrant: ~azure.mgmt.web.v2020_09_01.models.Contact + :param contact_tech: Technical contact. + :type contact_tech: ~azure.mgmt.web.v2020_09_01.models.Contact + :ivar registration_status: Domain registration status. Possible values include: "Active", + "Awaiting", "Cancelled", "Confiscated", "Disabled", "Excluded", "Expired", "Failed", "Held", + "Locked", "Parked", "Pending", "Reserved", "Reverted", "Suspended", "Transferred", "Unknown", + "Unlocked", "Unparked", "Updated", "JsonConverterFailed". + :vartype registration_status: str or ~azure.mgmt.web.v2020_09_01.models.DomainStatus + :ivar provisioning_state: Domain provisioning state. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2020_09_01.models.ProvisioningState + :ivar name_servers: Name servers. + :vartype name_servers: list[str] + :param privacy: :code:`true` if domain privacy is enabled for this domain; + otherwise, :code:`false`. + :type privacy: bool + :ivar created_time: Domain creation timestamp. + :vartype created_time: ~datetime.datetime + :ivar expiration_time: Domain expiration timestamp. + :vartype expiration_time: ~datetime.datetime + :ivar last_renewed_time: Timestamp when the domain was renewed last time. + :vartype last_renewed_time: ~datetime.datetime + :param auto_renew: :code:`true` if the domain should be automatically renewed; + otherwise, :code:`false`. + :type auto_renew: bool + :ivar ready_for_dns_record_management: :code:`true` if Azure can assign this + domain to App Service apps; otherwise, :code:`false`. This value will be + :code:`true` if domain registration status is active and + it is hosted on name servers Azure has programmatic access to. + :vartype ready_for_dns_record_management: bool + :ivar managed_host_names: All hostnames derived from the domain and assigned to Azure + resources. + :vartype managed_host_names: list[~azure.mgmt.web.v2020_09_01.models.HostName] + :param consent: Legal agreement consent. + :type consent: ~azure.mgmt.web.v2020_09_01.models.DomainPurchaseConsent + :ivar domain_not_renewable_reasons: Reasons why domain is not renewable. + :vartype domain_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2020_09_01.models.DomainPatchResourcePropertiesDomainNotRenewableReasonsItem] + :param dns_type: Current DNS type. Possible values include: "AzureDns", + "DefaultDomainRegistrarDns". + :type dns_type: str or ~azure.mgmt.web.v2020_09_01.models.DnsType + :param dns_zone_id: Azure DNS Zone to use. + :type dns_zone_id: str + :param target_dns_type: Target DNS type (would be used for migration). Possible values include: + "AzureDns", "DefaultDomainRegistrarDns". + :type target_dns_type: str or ~azure.mgmt.web.v2020_09_01.models.DnsType + :param auth_code: + :type auth_code: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'registration_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'name_servers': {'readonly': True}, + 'created_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'last_renewed_time': {'readonly': True}, + 'ready_for_dns_record_management': {'readonly': True}, + 'managed_host_names': {'readonly': True}, + 'domain_not_renewable_reasons': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'contact_admin': {'key': 'properties.contactAdmin', 'type': 'Contact'}, + 'contact_billing': {'key': 'properties.contactBilling', 'type': 'Contact'}, + 'contact_registrant': {'key': 'properties.contactRegistrant', 'type': 'Contact'}, + 'contact_tech': {'key': 'properties.contactTech', 'type': 'Contact'}, + 'registration_status': {'key': 'properties.registrationStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name_servers': {'key': 'properties.nameServers', 'type': '[str]'}, + 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'last_renewed_time': {'key': 'properties.lastRenewedTime', 'type': 'iso-8601'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'ready_for_dns_record_management': {'key': 'properties.readyForDnsRecordManagement', 'type': 'bool'}, + 'managed_host_names': {'key': 'properties.managedHostNames', 'type': '[HostName]'}, + 'consent': {'key': 'properties.consent', 'type': 'DomainPurchaseConsent'}, + 'domain_not_renewable_reasons': {'key': 'properties.domainNotRenewableReasons', 'type': '[str]'}, + 'dns_type': {'key': 'properties.dnsType', 'type': 'str'}, + 'dns_zone_id': {'key': 'properties.dnsZoneId', 'type': 'str'}, + 'target_dns_type': {'key': 'properties.targetDnsType', 'type': 'str'}, + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + contact_admin: Optional["Contact"] = None, + contact_billing: Optional["Contact"] = None, + contact_registrant: Optional["Contact"] = None, + contact_tech: Optional["Contact"] = None, + privacy: Optional[bool] = None, + auto_renew: Optional[bool] = True, + consent: Optional["DomainPurchaseConsent"] = None, + dns_type: Optional[Union[str, "DnsType"]] = None, + dns_zone_id: Optional[str] = None, + target_dns_type: Optional[Union[str, "DnsType"]] = None, + auth_code: Optional[str] = None, + **kwargs + ): + super(DomainPatchResource, self).__init__(kind=kind, **kwargs) + self.contact_admin = contact_admin + self.contact_billing = contact_billing + self.contact_registrant = contact_registrant + self.contact_tech = contact_tech + self.registration_status = None + self.provisioning_state = None + self.name_servers = None + self.privacy = privacy + self.created_time = None + self.expiration_time = None + self.last_renewed_time = None + self.auto_renew = auto_renew + self.ready_for_dns_record_management = None + self.managed_host_names = None + self.consent = consent + self.domain_not_renewable_reasons = None + self.dns_type = dns_type + self.dns_zone_id = dns_zone_id + self.target_dns_type = target_dns_type + self.auth_code = auth_code + + +class DomainPurchaseConsent(msrest.serialization.Model): + """Domain purchase consent object, representing acceptance of applicable legal agreements. + + :param agreement_keys: List of applicable legal agreement keys. This list can be retrieved + using ListLegalAgreements API under :code:`TopLevelDomain` resource. + :type agreement_keys: list[str] + :param agreed_by: Client IP address. + :type agreed_by: str + :param agreed_at: Timestamp when the agreements were accepted. + :type agreed_at: ~datetime.datetime + """ + + _attribute_map = { + 'agreement_keys': {'key': 'agreementKeys', 'type': '[str]'}, + 'agreed_by': {'key': 'agreedBy', 'type': 'str'}, + 'agreed_at': {'key': 'agreedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + agreement_keys: Optional[List[str]] = None, + agreed_by: Optional[str] = None, + agreed_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(DomainPurchaseConsent, self).__init__(**kwargs) + self.agreement_keys = agreement_keys + self.agreed_by = agreed_by + self.agreed_at = agreed_at + + +class DomainRecommendationSearchParameters(msrest.serialization.Model): + """Domain recommendation search parameters. + + :param keywords: Keywords to be used for generating domain recommendations. + :type keywords: str + :param max_domain_recommendations: Maximum number of recommendations. + :type max_domain_recommendations: int + """ + + _attribute_map = { + 'keywords': {'key': 'keywords', 'type': 'str'}, + 'max_domain_recommendations': {'key': 'maxDomainRecommendations', 'type': 'int'}, + } + + def __init__( + self, + *, + keywords: Optional[str] = None, + max_domain_recommendations: Optional[int] = None, + **kwargs + ): + super(DomainRecommendationSearchParameters, self).__init__(**kwargs) + self.keywords = keywords + self.max_domain_recommendations = max_domain_recommendations + + +class EnabledConfig(msrest.serialization.Model): + """Enabled configuration. + + :param enabled: True if configuration is enabled, false if it is disabled and null if + configuration is not set. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + **kwargs + ): + super(EnabledConfig, self).__init__(**kwargs) + self.enabled = enabled + + +class EndpointDependency(msrest.serialization.Model): + """A domain name that a service is reached at, including details of the current connection status. + + :param domain_name: The domain name of the dependency. + :type domain_name: str + :param endpoint_details: The IP Addresses and Ports used when connecting to DomainName. + :type endpoint_details: list[~azure.mgmt.web.v2020_09_01.models.EndpointDetail] + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'endpoint_details': {'key': 'endpointDetails', 'type': '[EndpointDetail]'}, + } + + def __init__( + self, + *, + domain_name: Optional[str] = None, + endpoint_details: Optional[List["EndpointDetail"]] = None, + **kwargs + ): + super(EndpointDependency, self).__init__(**kwargs) + self.domain_name = domain_name + self.endpoint_details = endpoint_details + + +class EndpointDetail(msrest.serialization.Model): + """Current TCP connectivity information from the App Service Environment to a single endpoint. + + :param ip_address: An IP Address that Domain Name currently resolves to. + :type ip_address: str + :param port: The port an endpoint is connected to. + :type port: int + :param latency: The time in milliseconds it takes for a TCP connection to be created from the + App Service Environment to this IpAddress at this Port. + :type latency: float + :param is_accessible: Whether it is possible to create a TCP connection from the App Service + Environment to this IpAddress at this Port. + :type is_accessible: bool + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'latency': {'key': 'latency', 'type': 'float'}, + 'is_accessible': {'key': 'isAccessible', 'type': 'bool'}, + } + + def __init__( + self, + *, + ip_address: Optional[str] = None, + port: Optional[int] = None, + latency: Optional[float] = None, + is_accessible: Optional[bool] = None, + **kwargs + ): + super(EndpointDetail, self).__init__(**kwargs) + self.ip_address = ip_address + self.port = port + self.latency = latency + self.is_accessible = is_accessible + + +class ErrorEntity(msrest.serialization.Model): + """Body of the error response returned from the API. + + :param extended_code: Type of error. + :type extended_code: str + :param message_template: Message template. + :type message_template: str + :param parameters: Parameters for the template. + :type parameters: list[str] + :param inner_errors: Inner errors. + :type inner_errors: list[~azure.mgmt.web.v2020_09_01.models.ErrorEntity] + :param code: Basic error code. + :type code: str + :param message: Any details of the error. + :type message: str + """ + + _attribute_map = { + 'extended_code': {'key': 'extendedCode', 'type': 'str'}, + 'message_template': {'key': 'messageTemplate', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '[str]'}, + 'inner_errors': {'key': 'innerErrors', 'type': '[ErrorEntity]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + extended_code: Optional[str] = None, + message_template: Optional[str] = None, + parameters: Optional[List[str]] = None, + inner_errors: Optional[List["ErrorEntity"]] = None, + code: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ErrorEntity, self).__init__(**kwargs) + self.extended_code = extended_code + self.message_template = message_template + self.parameters = parameters + self.inner_errors = inner_errors + self.code = code + self.message = message + + +class Experiments(msrest.serialization.Model): + """Routing rules in production experiments. + + :param ramp_up_rules: List of ramp-up rules. + :type ramp_up_rules: list[~azure.mgmt.web.v2020_09_01.models.RampUpRule] + """ + + _attribute_map = { + 'ramp_up_rules': {'key': 'rampUpRules', 'type': '[RampUpRule]'}, + } + + def __init__( + self, + *, + ramp_up_rules: Optional[List["RampUpRule"]] = None, + **kwargs + ): + super(Experiments, self).__init__(**kwargs) + self.ramp_up_rules = ramp_up_rules + + +class Facebook(ProxyOnlyResource): + """Facebook. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_09_01.models.AppRegistration + :param graph_api_version: + :type graph_api_version: str + :param login: + :type login: ~azure.mgmt.web.v2020_09_01.models.LoginScopes + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'AppRegistration'}, + 'graph_api_version': {'key': 'properties.graphApiVersion', 'type': 'str'}, + 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + registration: Optional["AppRegistration"] = None, + graph_api_version: Optional[str] = None, + login: Optional["LoginScopes"] = None, + **kwargs + ): + super(Facebook, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.registration = registration + self.graph_api_version = graph_api_version + self.login = login + + +class FileSystemApplicationLogsConfig(msrest.serialization.Model): + """Application logs to file system configuration. + + :param level: Log level. Possible values include: "Off", "Verbose", "Information", "Warning", + "Error". + :type level: str or ~azure.mgmt.web.v2020_09_01.models.LogLevel + """ + + _attribute_map = { + 'level': {'key': 'level', 'type': 'str'}, + } + + def __init__( + self, + *, + level: Optional[Union[str, "LogLevel"]] = None, + **kwargs + ): + super(FileSystemApplicationLogsConfig, self).__init__(**kwargs) + self.level = level + + +class FileSystemHttpLogsConfig(msrest.serialization.Model): + """Http logs to file system configuration. + + :param retention_in_mb: Maximum size in megabytes that http log files can use. + When reached old log files will be removed to make space for new ones. + Value can range between 25 and 100. + :type retention_in_mb: int + :param retention_in_days: Retention in days. + Remove files older than X days. + 0 or lower means no retention. + :type retention_in_days: int + :param enabled: True if configuration is enabled, false if it is disabled and null if + configuration is not set. + :type enabled: bool + """ + + _validation = { + 'retention_in_mb': {'maximum': 100, 'minimum': 25}, + } + + _attribute_map = { + 'retention_in_mb': {'key': 'retentionInMb', 'type': 'int'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + retention_in_mb: Optional[int] = None, + retention_in_days: Optional[int] = None, + enabled: Optional[bool] = None, + **kwargs + ): + super(FileSystemHttpLogsConfig, self).__init__(**kwargs) + self.retention_in_mb = retention_in_mb + self.retention_in_days = retention_in_days + self.enabled = enabled + + +class FileSystemTokenStore(ProxyOnlyResource): + """FileSystemTokenStore. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param directory: + :type directory: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'directory': {'key': 'properties.directory', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + directory: Optional[str] = None, + **kwargs + ): + super(FileSystemTokenStore, self).__init__(kind=kind, **kwargs) + self.directory = directory + + +class ForwardProxy(ProxyOnlyResource): + """ForwardProxy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param convention: Possible values include: "NoProxy", "Standard", "Custom". + :type convention: str or ~azure.mgmt.web.v2020_09_01.models.ForwardProxyConvention + :param custom_host_header_name: + :type custom_host_header_name: str + :param custom_proto_header_name: + :type custom_proto_header_name: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'convention': {'key': 'properties.convention', 'type': 'str'}, + 'custom_host_header_name': {'key': 'properties.customHostHeaderName', 'type': 'str'}, + 'custom_proto_header_name': {'key': 'properties.customProtoHeaderName', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + convention: Optional[Union[str, "ForwardProxyConvention"]] = None, + custom_host_header_name: Optional[str] = None, + custom_proto_header_name: Optional[str] = None, + **kwargs + ): + super(ForwardProxy, self).__init__(kind=kind, **kwargs) + self.convention = convention + self.custom_host_header_name = custom_host_header_name + self.custom_proto_header_name = custom_proto_header_name + + +class FunctionEnvelope(ProxyOnlyResource): + """Function information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param function_app_id: Function App ID. + :type function_app_id: str + :param script_root_path_href: Script root path URI. + :type script_root_path_href: str + :param script_href: Script URI. + :type script_href: str + :param config_href: Config URI. + :type config_href: str + :param test_data_href: Test data URI. + :type test_data_href: str + :param secrets_file_href: Secrets file URI. + :type secrets_file_href: str + :param href: Function URI. + :type href: str + :param config: Config information. + :type config: object + :param files: File list. + :type files: dict[str, str] + :param test_data: Test data used when testing via the Azure Portal. + :type test_data: str + :param invoke_url_template: The invocation URL. + :type invoke_url_template: str + :param language: The function language. + :type language: str + :param is_disabled: Gets or sets a value indicating whether the function is disabled. + :type is_disabled: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'function_app_id': {'key': 'properties.function_app_id', 'type': 'str'}, + 'script_root_path_href': {'key': 'properties.script_root_path_href', 'type': 'str'}, + 'script_href': {'key': 'properties.script_href', 'type': 'str'}, + 'config_href': {'key': 'properties.config_href', 'type': 'str'}, + 'test_data_href': {'key': 'properties.test_data_href', 'type': 'str'}, + 'secrets_file_href': {'key': 'properties.secrets_file_href', 'type': 'str'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'config': {'key': 'properties.config', 'type': 'object'}, + 'files': {'key': 'properties.files', 'type': '{str}'}, + 'test_data': {'key': 'properties.test_data', 'type': 'str'}, + 'invoke_url_template': {'key': 'properties.invoke_url_template', 'type': 'str'}, + 'language': {'key': 'properties.language', 'type': 'str'}, + 'is_disabled': {'key': 'properties.isDisabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + function_app_id: Optional[str] = None, + script_root_path_href: Optional[str] = None, + script_href: Optional[str] = None, + config_href: Optional[str] = None, + test_data_href: Optional[str] = None, + secrets_file_href: Optional[str] = None, + href: Optional[str] = None, + config: Optional[object] = None, + files: Optional[Dict[str, str]] = None, + test_data: Optional[str] = None, + invoke_url_template: Optional[str] = None, + language: Optional[str] = None, + is_disabled: Optional[bool] = None, + **kwargs + ): + super(FunctionEnvelope, self).__init__(kind=kind, **kwargs) + self.function_app_id = function_app_id + self.script_root_path_href = script_root_path_href + self.script_href = script_href + self.config_href = config_href + self.test_data_href = test_data_href + self.secrets_file_href = secrets_file_href + self.href = href + self.config = config + self.files = files + self.test_data = test_data + self.invoke_url_template = invoke_url_template + self.language = language + self.is_disabled = is_disabled + + +class FunctionEnvelopeCollection(msrest.serialization.Model): + """Collection of Kudu function information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.FunctionEnvelope] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FunctionEnvelope]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["FunctionEnvelope"], + **kwargs + ): + super(FunctionEnvelopeCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class FunctionSecrets(msrest.serialization.Model): + """Function secrets. + + :param key: Secret key. + :type key: str + :param trigger_url: Trigger URL. + :type trigger_url: str + """ + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'trigger_url': {'key': 'trigger_url', 'type': 'str'}, + } + + def __init__( + self, + *, + key: Optional[str] = None, + trigger_url: Optional[str] = None, + **kwargs + ): + super(FunctionSecrets, self).__init__(**kwargs) + self.key = key + self.trigger_url = trigger_url + + +class GeoRegion(ProxyOnlyResource): + """Geographical region. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar description: Region description. + :vartype description: str + :ivar display_name: Display name for region. + :vartype display_name: str + :ivar org_domain: Display name for region. + :vartype org_domain: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'description': {'readonly': True}, + 'display_name': {'readonly': True}, + 'org_domain': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'org_domain': {'key': 'properties.orgDomain', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(GeoRegion, self).__init__(kind=kind, **kwargs) + self.description = None + self.display_name = None + self.org_domain = None + + +class GeoRegionCollection(msrest.serialization.Model): + """Collection of geographical regions. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.GeoRegion] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GeoRegion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["GeoRegion"], + **kwargs + ): + super(GeoRegionCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class GitHub(ProxyOnlyResource): + """GitHub. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_09_01.models.ClientRegistration + :param login: + :type login: ~azure.mgmt.web.v2020_09_01.models.LoginScopes + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + registration: Optional["ClientRegistration"] = None, + login: Optional["LoginScopes"] = None, + **kwargs + ): + super(GitHub, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.registration = registration + self.login = login + + +class GlobalCsmSkuDescription(msrest.serialization.Model): + """A Global SKU Description. + + :param name: Name of the resource SKU. + :type name: str + :param tier: Service Tier of the resource SKU. + :type tier: str + :param size: Size specifier of the resource SKU. + :type size: str + :param family: Family code of the resource SKU. + :type family: str + :param capacity: Min, max, and default scale values of the SKU. + :type capacity: ~azure.mgmt.web.v2020_09_01.models.SkuCapacity + :param locations: Locations of the SKU. + :type locations: list[str] + :param capabilities: Capabilities of the SKU, e.g., is traffic manager enabled?. + :type capabilities: list[~azure.mgmt.web.v2020_09_01.models.Capability] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[Capability]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + tier: Optional[str] = None, + size: Optional[str] = None, + family: Optional[str] = None, + capacity: Optional["SkuCapacity"] = None, + locations: Optional[List[str]] = None, + capabilities: Optional[List["Capability"]] = None, + **kwargs + ): + super(GlobalCsmSkuDescription, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.size = size + self.family = family + self.capacity = capacity + self.locations = locations + self.capabilities = capabilities + + +class GlobalValidation(ProxyOnlyResource): + """GlobalValidation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param require_authentication: + :type require_authentication: bool + :param unauthenticated_client_action: Possible values include: "RedirectToLoginPage", + "AllowAnonymous", "Return401", "Return403". + :type unauthenticated_client_action: str or + ~azure.mgmt.web.v2020_09_01.models.UnauthenticatedClientActionV2 + :param redirect_to_provider: + :type redirect_to_provider: str + :param excluded_paths: + :type excluded_paths: list[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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'require_authentication': {'key': 'properties.requireAuthentication', 'type': 'bool'}, + 'unauthenticated_client_action': {'key': 'properties.unauthenticatedClientAction', 'type': 'str'}, + 'redirect_to_provider': {'key': 'properties.redirectToProvider', 'type': 'str'}, + 'excluded_paths': {'key': 'properties.excludedPaths', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + require_authentication: Optional[bool] = None, + unauthenticated_client_action: Optional[Union[str, "UnauthenticatedClientActionV2"]] = None, + redirect_to_provider: Optional[str] = None, + excluded_paths: Optional[List[str]] = None, + **kwargs + ): + super(GlobalValidation, self).__init__(kind=kind, **kwargs) + self.require_authentication = require_authentication + self.unauthenticated_client_action = unauthenticated_client_action + self.redirect_to_provider = redirect_to_provider + self.excluded_paths = excluded_paths + + +class Google(ProxyOnlyResource): + """Google. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_09_01.models.ClientRegistration + :param login: + :type login: ~azure.mgmt.web.v2020_09_01.models.LoginScopes + :param validation: + :type validation: ~azure.mgmt.web.v2020_09_01.models.AllowedAudiencesValidation + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'validation': {'key': 'properties.validation', 'type': 'AllowedAudiencesValidation'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + registration: Optional["ClientRegistration"] = None, + login: Optional["LoginScopes"] = None, + validation: Optional["AllowedAudiencesValidation"] = None, + **kwargs + ): + super(Google, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.registration = registration + self.login = login + self.validation = validation + + +class HandlerMapping(msrest.serialization.Model): + """The IIS handler mappings used to define which handler processes HTTP requests with certain extension. +For example, it is used to configure php-cgi.exe process to handle all HTTP requests with *.php extension. + + :param extension: Requests with this extension will be handled using the specified FastCGI + application. + :type extension: str + :param script_processor: The absolute path to the FastCGI application. + :type script_processor: str + :param arguments: Command-line arguments to be passed to the script processor. + :type arguments: str + """ + + _attribute_map = { + 'extension': {'key': 'extension', 'type': 'str'}, + 'script_processor': {'key': 'scriptProcessor', 'type': 'str'}, + 'arguments': {'key': 'arguments', 'type': 'str'}, + } + + def __init__( + self, + *, + extension: Optional[str] = None, + script_processor: Optional[str] = None, + arguments: Optional[str] = None, + **kwargs + ): + super(HandlerMapping, self).__init__(**kwargs) + self.extension = extension + self.script_processor = script_processor + self.arguments = arguments + + +class HostingEnvironmentDeploymentInfo(msrest.serialization.Model): + """Information needed to create resources on an App Service Environment. + + :param name: Name of the App Service Environment. + :type name: str + :param location: Location of the App Service Environment. + :type 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 + ): + super(HostingEnvironmentDeploymentInfo, self).__init__(**kwargs) + self.name = name + self.location = location + + +class HostingEnvironmentDiagnostics(msrest.serialization.Model): + """Diagnostics for an App Service Environment. + + :param name: Name/identifier of the diagnostics. + :type name: str + :param diagnostics_output: Diagnostics output. + :type diagnostics_output: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'diagnostics_output': {'key': 'diagnosticsOutput', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + diagnostics_output: Optional[str] = None, + **kwargs + ): + super(HostingEnvironmentDiagnostics, self).__init__(**kwargs) + self.name = name + self.diagnostics_output = diagnostics_output + + +class HostingEnvironmentProfile(msrest.serialization.Model): + """Specification for an App Service Environment to use for this resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID of the App Service Environment. + :type id: str + :ivar name: Name of the App Service Environment. + :vartype name: str + :ivar type: Resource type of the App Service Environment. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(HostingEnvironmentProfile, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + + +class HostKeys(msrest.serialization.Model): + """Functions host level keys. + + :param master_key: Secret key. + :type master_key: str + :param function_keys: Host level function keys. + :type function_keys: dict[str, str] + :param system_keys: System keys. + :type system_keys: dict[str, str] + """ + + _attribute_map = { + 'master_key': {'key': 'masterKey', 'type': 'str'}, + 'function_keys': {'key': 'functionKeys', 'type': '{str}'}, + 'system_keys': {'key': 'systemKeys', 'type': '{str}'}, + } + + def __init__( + self, + *, + master_key: Optional[str] = None, + function_keys: Optional[Dict[str, str]] = None, + system_keys: Optional[Dict[str, str]] = None, + **kwargs + ): + super(HostKeys, self).__init__(**kwargs) + self.master_key = master_key + self.function_keys = function_keys + self.system_keys = system_keys + + +class HostName(msrest.serialization.Model): + """Details of a hostname derived from a domain. + + :param name: Name of the hostname. + :type name: str + :param site_names: List of apps the hostname is assigned to. This list will have more than one + app only if the hostname is pointing to a Traffic Manager. + :type site_names: list[str] + :param azure_resource_name: Name of the Azure resource the hostname is assigned to. If it is + assigned to a Traffic Manager then it will be the Traffic Manager name otherwise it will be the + app name. + :type azure_resource_name: str + :param azure_resource_type: Type of the Azure resource the hostname is assigned to. Possible + values include: "Website", "TrafficManager". + :type azure_resource_type: str or ~azure.mgmt.web.v2020_09_01.models.AzureResourceType + :param custom_host_name_dns_record_type: Type of the DNS record. Possible values include: + "CName", "A". + :type custom_host_name_dns_record_type: str or + ~azure.mgmt.web.v2020_09_01.models.CustomHostNameDnsRecordType + :param host_name_type: Type of the hostname. Possible values include: "Verified", "Managed". + :type host_name_type: str or ~azure.mgmt.web.v2020_09_01.models.HostNameType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'site_names': {'key': 'siteNames', 'type': '[str]'}, + 'azure_resource_name': {'key': 'azureResourceName', 'type': 'str'}, + 'azure_resource_type': {'key': 'azureResourceType', 'type': 'str'}, + 'custom_host_name_dns_record_type': {'key': 'customHostNameDnsRecordType', 'type': 'str'}, + 'host_name_type': {'key': 'hostNameType', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + site_names: Optional[List[str]] = None, + azure_resource_name: Optional[str] = None, + azure_resource_type: Optional[Union[str, "AzureResourceType"]] = None, + custom_host_name_dns_record_type: Optional[Union[str, "CustomHostNameDnsRecordType"]] = None, + host_name_type: Optional[Union[str, "HostNameType"]] = None, + **kwargs + ): + super(HostName, self).__init__(**kwargs) + self.name = name + self.site_names = site_names + self.azure_resource_name = azure_resource_name + self.azure_resource_type = azure_resource_type + self.custom_host_name_dns_record_type = custom_host_name_dns_record_type + self.host_name_type = host_name_type + + +class HostNameBinding(ProxyOnlyResource): + """A hostname binding object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param site_name: App Service app name. + :type site_name: str + :param domain_id: Fully qualified ARM domain resource URI. + :type domain_id: str + :param azure_resource_name: Azure resource name. + :type azure_resource_name: str + :param azure_resource_type: Azure resource type. Possible values include: "Website", + "TrafficManager". + :type azure_resource_type: str or ~azure.mgmt.web.v2020_09_01.models.AzureResourceType + :param custom_host_name_dns_record_type: Custom DNS record type. Possible values include: + "CName", "A". + :type custom_host_name_dns_record_type: str or + ~azure.mgmt.web.v2020_09_01.models.CustomHostNameDnsRecordType + :param host_name_type: Hostname type. Possible values include: "Verified", "Managed". + :type host_name_type: str or ~azure.mgmt.web.v2020_09_01.models.HostNameType + :param ssl_state: SSL type. Possible values include: "Disabled", "SniEnabled", + "IpBasedEnabled". + :type ssl_state: str or ~azure.mgmt.web.v2020_09_01.models.SslState + :param thumbprint: SSL certificate thumbprint. + :type thumbprint: str + :ivar virtual_ip: Virtual IP address assigned to the hostname if IP based SSL is enabled. + :vartype virtual_ip: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'virtual_ip': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'domain_id': {'key': 'properties.domainId', 'type': 'str'}, + 'azure_resource_name': {'key': 'properties.azureResourceName', 'type': 'str'}, + 'azure_resource_type': {'key': 'properties.azureResourceType', 'type': 'str'}, + 'custom_host_name_dns_record_type': {'key': 'properties.customHostNameDnsRecordType', 'type': 'str'}, + 'host_name_type': {'key': 'properties.hostNameType', 'type': 'str'}, + 'ssl_state': {'key': 'properties.sslState', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'virtual_ip': {'key': 'properties.virtualIP', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + site_name: Optional[str] = None, + domain_id: Optional[str] = None, + azure_resource_name: Optional[str] = None, + azure_resource_type: Optional[Union[str, "AzureResourceType"]] = None, + custom_host_name_dns_record_type: Optional[Union[str, "CustomHostNameDnsRecordType"]] = None, + host_name_type: Optional[Union[str, "HostNameType"]] = None, + ssl_state: Optional[Union[str, "SslState"]] = None, + thumbprint: Optional[str] = None, + **kwargs + ): + super(HostNameBinding, self).__init__(kind=kind, **kwargs) + self.site_name = site_name + self.domain_id = domain_id + self.azure_resource_name = azure_resource_name + self.azure_resource_type = azure_resource_type + self.custom_host_name_dns_record_type = custom_host_name_dns_record_type + self.host_name_type = host_name_type + self.ssl_state = ssl_state + self.thumbprint = thumbprint + self.virtual_ip = None + + +class HostNameBindingCollection(msrest.serialization.Model): + """Collection of hostname bindings. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.HostNameBinding] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HostNameBinding]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["HostNameBinding"], + **kwargs + ): + super(HostNameBindingCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class HostNameSslState(msrest.serialization.Model): + """SSL-enabled hostname. + + :param name: Hostname. + :type name: str + :param ssl_state: SSL type. Possible values include: "Disabled", "SniEnabled", + "IpBasedEnabled". + :type ssl_state: str or ~azure.mgmt.web.v2020_09_01.models.SslState + :param virtual_ip: Virtual IP address assigned to the hostname if IP based SSL is enabled. + :type virtual_ip: str + :param thumbprint: SSL certificate thumbprint. + :type thumbprint: str + :param to_update: Set to :code:`true` to update existing hostname. + :type to_update: bool + :param host_type: Indicates whether the hostname is a standard or repository hostname. Possible + values include: "Standard", "Repository". + :type host_type: str or ~azure.mgmt.web.v2020_09_01.models.HostType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'ssl_state': {'key': 'sslState', 'type': 'str'}, + 'virtual_ip': {'key': 'virtualIP', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'to_update': {'key': 'toUpdate', 'type': 'bool'}, + 'host_type': {'key': 'hostType', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + ssl_state: Optional[Union[str, "SslState"]] = None, + virtual_ip: Optional[str] = None, + thumbprint: Optional[str] = None, + to_update: Optional[bool] = None, + host_type: Optional[Union[str, "HostType"]] = None, + **kwargs + ): + super(HostNameSslState, self).__init__(**kwargs) + self.name = name + self.ssl_state = ssl_state + self.virtual_ip = virtual_ip + self.thumbprint = thumbprint + self.to_update = to_update + self.host_type = host_type + + +class HttpLogsConfig(msrest.serialization.Model): + """Http logs configuration. + + :param file_system: Http logs to file system configuration. + :type file_system: ~azure.mgmt.web.v2020_09_01.models.FileSystemHttpLogsConfig + :param azure_blob_storage: Http logs to azure blob storage configuration. + :type azure_blob_storage: ~azure.mgmt.web.v2020_09_01.models.AzureBlobStorageHttpLogsConfig + """ + + _attribute_map = { + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemHttpLogsConfig'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'AzureBlobStorageHttpLogsConfig'}, + } + + def __init__( + self, + *, + file_system: Optional["FileSystemHttpLogsConfig"] = None, + azure_blob_storage: Optional["AzureBlobStorageHttpLogsConfig"] = None, + **kwargs + ): + super(HttpLogsConfig, self).__init__(**kwargs) + self.file_system = file_system + self.azure_blob_storage = azure_blob_storage + + +class HttpSettings(ProxyOnlyResource): + """HttpSettings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param require_https: + :type require_https: bool + :param routes: + :type routes: ~azure.mgmt.web.v2020_09_01.models.HttpSettingsRoutes + :param forward_proxy: + :type forward_proxy: ~azure.mgmt.web.v2020_09_01.models.ForwardProxy + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'require_https': {'key': 'properties.requireHttps', 'type': 'bool'}, + 'routes': {'key': 'properties.routes', 'type': 'HttpSettingsRoutes'}, + 'forward_proxy': {'key': 'properties.forwardProxy', 'type': 'ForwardProxy'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + require_https: Optional[bool] = None, + routes: Optional["HttpSettingsRoutes"] = None, + forward_proxy: Optional["ForwardProxy"] = None, + **kwargs + ): + super(HttpSettings, self).__init__(kind=kind, **kwargs) + self.require_https = require_https + self.routes = routes + self.forward_proxy = forward_proxy + + +class HttpSettingsRoutes(ProxyOnlyResource): + """HttpSettingsRoutes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param api_prefix: + :type api_prefix: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'api_prefix': {'key': 'properties.apiPrefix', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + api_prefix: Optional[str] = None, + **kwargs + ): + super(HttpSettingsRoutes, self).__init__(kind=kind, **kwargs) + self.api_prefix = api_prefix + + +class HybridConnection(ProxyOnlyResource): + """Hybrid Connection contract. This is used to configure a Hybrid Connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param service_bus_namespace: The name of the Service Bus namespace. + :type service_bus_namespace: str + :param relay_name: The name of the Service Bus relay. + :type relay_name: str + :param relay_arm_uri: The ARM URI to the Service Bus relay. + :type relay_arm_uri: str + :param hostname: The hostname of the endpoint. + :type hostname: str + :param port: The port of the endpoint. + :type port: int + :param send_key_name: The name of the Service Bus key which has Send permissions. This is used + to authenticate to Service Bus. + :type send_key_name: str + :param send_key_value: The value of the Service Bus key. This is used to authenticate to + Service Bus. In ARM this key will not be returned + normally, use the POST /listKeys API instead. + :type send_key_value: str + :param service_bus_suffix: The suffix for the service bus endpoint. By default this is + .servicebus.windows.net. + :type service_bus_suffix: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'service_bus_namespace': {'key': 'properties.serviceBusNamespace', 'type': 'str'}, + 'relay_name': {'key': 'properties.relayName', 'type': 'str'}, + 'relay_arm_uri': {'key': 'properties.relayArmUri', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'send_key_name': {'key': 'properties.sendKeyName', 'type': 'str'}, + 'send_key_value': {'key': 'properties.sendKeyValue', 'type': 'str'}, + 'service_bus_suffix': {'key': 'properties.serviceBusSuffix', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + service_bus_namespace: Optional[str] = None, + relay_name: Optional[str] = None, + relay_arm_uri: Optional[str] = None, + hostname: Optional[str] = None, + port: Optional[int] = None, + send_key_name: Optional[str] = None, + send_key_value: Optional[str] = None, + service_bus_suffix: Optional[str] = None, + **kwargs + ): + super(HybridConnection, self).__init__(kind=kind, **kwargs) + self.service_bus_namespace = service_bus_namespace + self.relay_name = relay_name + self.relay_arm_uri = relay_arm_uri + self.hostname = hostname + self.port = port + self.send_key_name = send_key_name + self.send_key_value = send_key_value + self.service_bus_suffix = service_bus_suffix + + +class HybridConnectionCollection(msrest.serialization.Model): + """Collection of hostname bindings. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.HybridConnection] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HybridConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["HybridConnection"], + **kwargs + ): + super(HybridConnectionCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class HybridConnectionKey(ProxyOnlyResource): + """Hybrid Connection key contract. This has the send key name and value for a Hybrid Connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar send_key_name: The name of the send key. + :vartype send_key_name: str + :ivar send_key_value: The value of the send key. + :vartype send_key_value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'send_key_name': {'readonly': True}, + 'send_key_value': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'send_key_name': {'key': 'properties.sendKeyName', 'type': 'str'}, + 'send_key_value': {'key': 'properties.sendKeyValue', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(HybridConnectionKey, self).__init__(kind=kind, **kwargs) + self.send_key_name = None + self.send_key_value = None + + +class HybridConnectionLimits(ProxyOnlyResource): + """Hybrid Connection limits contract. This is used to return the plan limits of Hybrid Connections. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar current: The current number of Hybrid Connections. + :vartype current: int + :ivar maximum: The maximum number of Hybrid Connections allowed. + :vartype maximum: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'current': {'readonly': True}, + 'maximum': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'current': {'key': 'properties.current', 'type': 'int'}, + 'maximum': {'key': 'properties.maximum', 'type': 'int'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(HybridConnectionLimits, self).__init__(kind=kind, **kwargs) + self.current = None + self.maximum = None + + +class Identifier(ProxyOnlyResource): + """A domain specific resource identifier. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param value: String representation of the identity. + :type value: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'value': {'key': 'properties.id', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(Identifier, self).__init__(kind=kind, **kwargs) + self.value = value + + +class IdentifierCollection(msrest.serialization.Model): + """Collection of identifiers. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.Identifier] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Identifier]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Identifier"], + **kwargs + ): + super(IdentifierCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class IdentityProviders(ProxyOnlyResource): + """IdentityProviders. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param azure_active_directory: + :type azure_active_directory: ~azure.mgmt.web.v2020_09_01.models.AzureActiveDirectory + :param facebook: + :type facebook: ~azure.mgmt.web.v2020_09_01.models.Facebook + :param git_hub: + :type git_hub: ~azure.mgmt.web.v2020_09_01.models.GitHub + :param google: + :type google: ~azure.mgmt.web.v2020_09_01.models.Google + :param twitter: + :type twitter: ~azure.mgmt.web.v2020_09_01.models.Twitter + :param custom_open_id_connect_providers: Dictionary of :code:``. + :type custom_open_id_connect_providers: dict[str, + ~azure.mgmt.web.v2020_09_01.models.CustomOpenIdConnectProvider] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'azure_active_directory': {'key': 'properties.azureActiveDirectory', 'type': 'AzureActiveDirectory'}, + 'facebook': {'key': 'properties.facebook', 'type': 'Facebook'}, + 'git_hub': {'key': 'properties.gitHub', 'type': 'GitHub'}, + 'google': {'key': 'properties.google', 'type': 'Google'}, + 'twitter': {'key': 'properties.twitter', 'type': 'Twitter'}, + 'custom_open_id_connect_providers': {'key': 'properties.customOpenIdConnectProviders', 'type': '{CustomOpenIdConnectProvider}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + azure_active_directory: Optional["AzureActiveDirectory"] = None, + facebook: Optional["Facebook"] = None, + git_hub: Optional["GitHub"] = None, + google: Optional["Google"] = None, + twitter: Optional["Twitter"] = None, + custom_open_id_connect_providers: Optional[Dict[str, "CustomOpenIdConnectProvider"]] = None, + **kwargs + ): + super(IdentityProviders, self).__init__(kind=kind, **kwargs) + self.azure_active_directory = azure_active_directory + self.facebook = facebook + self.git_hub = git_hub + self.google = google + self.twitter = twitter + self.custom_open_id_connect_providers = custom_open_id_connect_providers + + +class InboundEnvironmentEndpoint(msrest.serialization.Model): + """The IP Addresses and Ports that require inbound network access to and within the subnet of the App Service Environment. + + :param description: Short text describing the purpose of the network traffic. + :type description: str + :param endpoints: The IP addresses that network traffic will originate from in cidr notation. + :type endpoints: list[str] + :param ports: The ports that network traffic will arrive to the App Service Environment at. + :type ports: list[str] + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[str]'}, + 'ports': {'key': 'ports', 'type': '[str]'}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + endpoints: Optional[List[str]] = None, + ports: Optional[List[str]] = None, + **kwargs + ): + super(InboundEnvironmentEndpoint, self).__init__(**kwargs) + self.description = description + self.endpoints = endpoints + self.ports = ports + + +class InboundEnvironmentEndpointCollection(msrest.serialization.Model): + """Collection of Inbound Environment Endpoints. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.InboundEnvironmentEndpoint] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InboundEnvironmentEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["InboundEnvironmentEndpoint"], + **kwargs + ): + super(InboundEnvironmentEndpointCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class IpSecurityRestriction(msrest.serialization.Model): + """IP security restriction on an app. + + :param ip_address: IP address the security restriction is valid for. + It can be in form of pure ipv4 address (required SubnetMask property) or + CIDR notation such as ipv4/mask (leading bit match). For CIDR, + SubnetMask property must not be specified. + :type ip_address: str + :param subnet_mask: Subnet mask for the range of IP addresses the restriction is valid for. + :type subnet_mask: str + :param vnet_subnet_resource_id: Virtual network resource id. + :type vnet_subnet_resource_id: str + :param vnet_traffic_tag: (internal) Vnet traffic tag. + :type vnet_traffic_tag: int + :param subnet_traffic_tag: (internal) Subnet traffic tag. + :type subnet_traffic_tag: int + :param action: Allow or Deny access for this IP range. + :type action: str + :param tag: Defines what this IP filter will be used for. This is to support IP filtering on + proxies. Possible values include: "Default", "XffProxy", "ServiceTag". + :type tag: str or ~azure.mgmt.web.v2020_09_01.models.IpFilterTag + :param priority: Priority of IP restriction rule. + :type priority: int + :param name: IP restriction rule name. + :type name: str + :param description: IP restriction rule description. + :type description: str + :param headers: IP restriction rule headers. + X-Forwarded-Host (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded- + Host#Examples). + The matching logic is .. + + + * If the property is null or empty (default), all hosts(or lack of) are allowed. + * A value is compared using ordinal-ignore-case (excluding port number). + * Subdomain wildcards are permitted but don't match the root domain. For example, + *.contoso.com matches the subdomain foo.contoso.com + but not the root domain contoso.com or multi-level foo.bar.contoso.com + * Unicode host names are allowed but are converted to Punycode for matching. + + X-Forwarded-For (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded- + For#Examples). + The matching logic is .. + + + * If the property is null or empty (default), any forwarded-for chains (or lack of) are + allowed. + * If any address (excluding port number) in the chain (comma separated) matches the CIDR + defined by the property. + + X-Azure-FDID and X-FD-HealthProbe. + The matching logic is exact match. + :type headers: dict[str, list[str]] + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet_mask': {'key': 'subnetMask', 'type': 'str'}, + 'vnet_subnet_resource_id': {'key': 'vnetSubnetResourceId', 'type': 'str'}, + 'vnet_traffic_tag': {'key': 'vnetTrafficTag', 'type': 'int'}, + 'subnet_traffic_tag': {'key': 'subnetTrafficTag', 'type': 'int'}, + 'action': {'key': 'action', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '{[str]}'}, + } + + def __init__( + self, + *, + ip_address: Optional[str] = None, + subnet_mask: Optional[str] = None, + vnet_subnet_resource_id: Optional[str] = None, + vnet_traffic_tag: Optional[int] = None, + subnet_traffic_tag: Optional[int] = None, + action: Optional[str] = None, + tag: Optional[Union[str, "IpFilterTag"]] = None, + priority: Optional[int] = None, + name: Optional[str] = None, + description: Optional[str] = None, + headers: Optional[Dict[str, List[str]]] = None, + **kwargs + ): + super(IpSecurityRestriction, self).__init__(**kwargs) + self.ip_address = ip_address + self.subnet_mask = subnet_mask + self.vnet_subnet_resource_id = vnet_subnet_resource_id + self.vnet_traffic_tag = vnet_traffic_tag + self.subnet_traffic_tag = subnet_traffic_tag + self.action = action + self.tag = tag + self.priority = priority + self.name = name + self.description = description + self.headers = headers + + +class JwtClaimChecks(ProxyOnlyResource): + """JwtClaimChecks. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param allowed_groups: + :type allowed_groups: list[str] + :param allowed_client_applications: + :type allowed_client_applications: list[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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'allowed_groups': {'key': 'properties.allowedGroups', 'type': '[str]'}, + 'allowed_client_applications': {'key': 'properties.allowedClientApplications', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + allowed_groups: Optional[List[str]] = None, + allowed_client_applications: Optional[List[str]] = None, + **kwargs + ): + super(JwtClaimChecks, self).__init__(kind=kind, **kwargs) + self.allowed_groups = allowed_groups + self.allowed_client_applications = allowed_client_applications + + +class KeyInfo(msrest.serialization.Model): + """Function key info. + + :param name: Key name. + :type name: str + :param value: Key value. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(KeyInfo, self).__init__(**kwargs) + self.name = name + self.value = value + + +class LocalizableString(msrest.serialization.Model): + """Localizable string object containing the name and a localized value. + + :param value: Non-localized name. + :type value: str + :param localized_value: Localized name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[str] = None, + localized_value: Optional[str] = None, + **kwargs + ): + super(LocalizableString, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value + + +class Login(ProxyOnlyResource): + """Login. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param routes: + :type routes: ~azure.mgmt.web.v2020_09_01.models.LoginRoutes + :param token_store: + :type token_store: ~azure.mgmt.web.v2020_09_01.models.TokenStore + :param preserve_url_fragments_for_logins: + :type preserve_url_fragments_for_logins: bool + :param allowed_external_redirect_urls: + :type allowed_external_redirect_urls: list[str] + :param cookie_expiration: + :type cookie_expiration: ~azure.mgmt.web.v2020_09_01.models.CookieExpiration + :param nonce: + :type nonce: ~azure.mgmt.web.v2020_09_01.models.Nonce + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'routes': {'key': 'properties.routes', 'type': 'LoginRoutes'}, + 'token_store': {'key': 'properties.tokenStore', 'type': 'TokenStore'}, + 'preserve_url_fragments_for_logins': {'key': 'properties.preserveUrlFragmentsForLogins', 'type': 'bool'}, + 'allowed_external_redirect_urls': {'key': 'properties.allowedExternalRedirectUrls', 'type': '[str]'}, + 'cookie_expiration': {'key': 'properties.cookieExpiration', 'type': 'CookieExpiration'}, + 'nonce': {'key': 'properties.nonce', 'type': 'Nonce'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + routes: Optional["LoginRoutes"] = None, + token_store: Optional["TokenStore"] = None, + preserve_url_fragments_for_logins: Optional[bool] = None, + allowed_external_redirect_urls: Optional[List[str]] = None, + cookie_expiration: Optional["CookieExpiration"] = None, + nonce: Optional["Nonce"] = None, + **kwargs + ): + super(Login, self).__init__(kind=kind, **kwargs) + self.routes = routes + self.token_store = token_store + self.preserve_url_fragments_for_logins = preserve_url_fragments_for_logins + self.allowed_external_redirect_urls = allowed_external_redirect_urls + self.cookie_expiration = cookie_expiration + self.nonce = nonce + + +class LoginRoutes(ProxyOnlyResource): + """LoginRoutes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param logout_endpoint: + :type logout_endpoint: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'logout_endpoint': {'key': 'properties.logoutEndpoint', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + logout_endpoint: Optional[str] = None, + **kwargs + ): + super(LoginRoutes, self).__init__(kind=kind, **kwargs) + self.logout_endpoint = logout_endpoint + + +class LoginScopes(ProxyOnlyResource): + """LoginScopes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param scopes: + :type scopes: list[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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + scopes: Optional[List[str]] = None, + **kwargs + ): + super(LoginScopes, self).__init__(kind=kind, **kwargs) + self.scopes = scopes + + +class LogSpecification(msrest.serialization.Model): + """Log Definition of a single resource metric. + + :param name: + :type name: str + :param display_name: + :type display_name: str + :param blob_duration: + :type blob_duration: str + :param log_filter_pattern: + :type log_filter_pattern: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + 'log_filter_pattern': {'key': 'logFilterPattern', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + blob_duration: Optional[str] = None, + log_filter_pattern: Optional[str] = None, + **kwargs + ): + super(LogSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.blob_duration = blob_duration + self.log_filter_pattern = log_filter_pattern + + +class ManagedServiceIdentity(msrest.serialization.Model): + """Managed service identity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Type of managed service identity. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type: str or ~azure.mgmt.web.v2020_09_01.models.ManagedServiceIdentityType + :ivar tenant_id: Tenant of managed service identity. + :vartype tenant_id: str + :ivar principal_id: Principal Id of managed service identity. + :vartype principal_id: str + :param user_assigned_identities: The list of user assigned identities associated with the + resource. The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + :type user_assigned_identities: dict[str, + ~azure.mgmt.web.v2020_09_01.models.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties] + """ + + _validation = { + 'tenant_id': {'readonly': True}, + 'principal_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "ManagedServiceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + **kwargs + ): + super(ManagedServiceIdentity, self).__init__(**kwargs) + self.type = type + self.tenant_id = None + self.principal_id = None + self.user_assigned_identities = user_assigned_identities + + +class MetricAvailability(msrest.serialization.Model): + """Retention policy of a resource metric. + + :param time_grain: + :type time_grain: str + :param blob_duration: + :type blob_duration: str + """ + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__( + self, + *, + time_grain: Optional[str] = None, + blob_duration: Optional[str] = None, + **kwargs + ): + super(MetricAvailability, self).__init__(**kwargs) + self.time_grain = time_grain + self.blob_duration = blob_duration + + +class MetricSpecification(msrest.serialization.Model): + """Definition of a single resource metric. + + :param name: + :type name: str + :param display_name: + :type display_name: str + :param display_description: + :type display_description: str + :param unit: + :type unit: str + :param aggregation_type: + :type aggregation_type: str + :param supports_instance_level_aggregation: + :type supports_instance_level_aggregation: bool + :param enable_regional_mdm_account: + :type enable_regional_mdm_account: bool + :param source_mdm_account: + :type source_mdm_account: str + :param source_mdm_namespace: + :type source_mdm_namespace: str + :param metric_filter_pattern: + :type metric_filter_pattern: str + :param fill_gap_with_zero: + :type fill_gap_with_zero: bool + :param is_internal: + :type is_internal: bool + :param dimensions: + :type dimensions: list[~azure.mgmt.web.v2020_09_01.models.Dimension] + :param category: + :type category: str + :param availabilities: + :type availabilities: list[~azure.mgmt.web.v2020_09_01.models.MetricAvailability] + :param supported_time_grain_types: + :type supported_time_grain_types: list[str] + :param supported_aggregation_types: + :type supported_aggregation_types: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'supports_instance_level_aggregation': {'key': 'supportsInstanceLevelAggregation', 'type': 'bool'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'bool'}, + 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'metric_filter_pattern': {'key': 'metricFilterPattern', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'is_internal': {'key': 'isInternal', 'type': 'bool'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'category': {'key': 'category', 'type': 'str'}, + 'availabilities': {'key': 'availabilities', 'type': '[MetricAvailability]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + display_description: Optional[str] = None, + unit: Optional[str] = None, + aggregation_type: Optional[str] = None, + supports_instance_level_aggregation: Optional[bool] = None, + enable_regional_mdm_account: Optional[bool] = None, + source_mdm_account: Optional[str] = None, + source_mdm_namespace: Optional[str] = None, + metric_filter_pattern: Optional[str] = None, + fill_gap_with_zero: Optional[bool] = None, + is_internal: Optional[bool] = None, + dimensions: Optional[List["Dimension"]] = None, + category: Optional[str] = None, + availabilities: Optional[List["MetricAvailability"]] = None, + supported_time_grain_types: Optional[List[str]] = None, + supported_aggregation_types: Optional[List[str]] = None, + **kwargs + ): + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.supports_instance_level_aggregation = supports_instance_level_aggregation + self.enable_regional_mdm_account = enable_regional_mdm_account + self.source_mdm_account = source_mdm_account + self.source_mdm_namespace = source_mdm_namespace + self.metric_filter_pattern = metric_filter_pattern + self.fill_gap_with_zero = fill_gap_with_zero + self.is_internal = is_internal + self.dimensions = dimensions + self.category = category + self.availabilities = availabilities + self.supported_time_grain_types = supported_time_grain_types + self.supported_aggregation_types = supported_aggregation_types + + +class MigrateMySqlRequest(ProxyOnlyResource): + """MySQL migration request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param connection_string: Connection string to the remote MySQL database. + :type connection_string: str + :param migration_type: The type of migration operation to be done. Possible values include: + "LocalToRemote", "RemoteToLocal". + :type migration_type: str or ~azure.mgmt.web.v2020_09_01.models.MySqlMigrationType + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'migration_type': {'key': 'properties.migrationType', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + connection_string: Optional[str] = None, + migration_type: Optional[Union[str, "MySqlMigrationType"]] = None, + **kwargs + ): + super(MigrateMySqlRequest, self).__init__(kind=kind, **kwargs) + self.connection_string = connection_string + self.migration_type = migration_type + + +class MigrateMySqlStatus(ProxyOnlyResource): + """MySQL migration status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar migration_operation_status: Status of the migration task. Possible values include: + "InProgress", "Failed", "Succeeded", "TimedOut", "Created". + :vartype migration_operation_status: str or ~azure.mgmt.web.v2020_09_01.models.OperationStatus + :ivar operation_id: Operation ID for the migration task. + :vartype operation_id: str + :ivar local_my_sql_enabled: True if the web app has in app MySql enabled. + :vartype local_my_sql_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'migration_operation_status': {'readonly': True}, + 'operation_id': {'readonly': True}, + 'local_my_sql_enabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'migration_operation_status': {'key': 'properties.migrationOperationStatus', 'type': 'str'}, + 'operation_id': {'key': 'properties.operationId', 'type': 'str'}, + 'local_my_sql_enabled': {'key': 'properties.localMySqlEnabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(MigrateMySqlStatus, self).__init__(kind=kind, **kwargs) + self.migration_operation_status = None + self.operation_id = None + self.local_my_sql_enabled = None + + +class MSDeploy(ProxyOnlyResource): + """MSDeploy ARM PUT information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param package_uri: Package URI. + :type package_uri: str + :param connection_string: SQL Connection String. + :type connection_string: str + :param db_type: Database Type. + :type db_type: str + :param set_parameters_xml_file_uri: URI of MSDeploy Parameters file. Must not be set if + SetParameters is used. + :type set_parameters_xml_file_uri: str + :param set_parameters: MSDeploy Parameters. Must not be set if SetParametersXmlFileUri is used. + :type set_parameters: dict[str, str] + :param skip_app_data: Controls whether the MSDeploy operation skips the App_Data directory. + If set to :code:`true`, the existing App_Data directory on the destination + will not be deleted, and any App_Data directory in the source will be ignored. + Setting is :code:`false` by default. + :type skip_app_data: bool + :param app_offline: Sets the AppOffline rule while the MSDeploy operation executes. + Setting is :code:`false` by default. + :type app_offline: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'package_uri': {'key': 'properties.packageUri', 'type': 'str'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'db_type': {'key': 'properties.dbType', 'type': 'str'}, + 'set_parameters_xml_file_uri': {'key': 'properties.setParametersXmlFileUri', 'type': 'str'}, + 'set_parameters': {'key': 'properties.setParameters', 'type': '{str}'}, + 'skip_app_data': {'key': 'properties.skipAppData', 'type': 'bool'}, + 'app_offline': {'key': 'properties.appOffline', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + package_uri: Optional[str] = None, + connection_string: Optional[str] = None, + db_type: Optional[str] = None, + set_parameters_xml_file_uri: Optional[str] = None, + set_parameters: Optional[Dict[str, str]] = None, + skip_app_data: Optional[bool] = None, + app_offline: Optional[bool] = None, + **kwargs + ): + super(MSDeploy, self).__init__(kind=kind, **kwargs) + self.package_uri = package_uri + self.connection_string = connection_string + self.db_type = db_type + self.set_parameters_xml_file_uri = set_parameters_xml_file_uri + self.set_parameters = set_parameters + self.skip_app_data = skip_app_data + self.app_offline = app_offline + + +class MSDeployLog(ProxyOnlyResource): + """MSDeploy log. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar entries: List of log entry messages. + :vartype entries: list[~azure.mgmt.web.v2020_09_01.models.MSDeployLogEntry] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'entries': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'entries': {'key': 'properties.entries', 'type': '[MSDeployLogEntry]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(MSDeployLog, self).__init__(kind=kind, **kwargs) + self.entries = None + + +class MSDeployLogEntry(msrest.serialization.Model): + """MSDeploy log entry. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar time: Timestamp of log entry. + :vartype time: ~datetime.datetime + :ivar type: Log entry type. Possible values include: "Message", "Warning", "Error". + :vartype type: str or ~azure.mgmt.web.v2020_09_01.models.MSDeployLogEntryType + :ivar message: Log entry message. + :vartype message: str + """ + + _validation = { + 'time': {'readonly': True}, + 'type': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MSDeployLogEntry, self).__init__(**kwargs) + self.time = None + self.type = None + self.message = None + + +class MSDeployStatus(ProxyOnlyResource): + """MSDeploy ARM response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar deployer: Username of deployer. + :vartype deployer: str + :ivar provisioning_state: Provisioning state. Possible values include: "accepted", "running", + "succeeded", "failed", "canceled". + :vartype provisioning_state: str or + ~azure.mgmt.web.v2020_09_01.models.MSDeployProvisioningState + :ivar start_time: Start time of deploy operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: End time of deploy operation. + :vartype end_time: ~datetime.datetime + :ivar complete: Whether the deployment operation has completed. + :vartype complete: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'deployer': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'complete': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'deployer': {'key': 'properties.deployer', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'complete': {'key': 'properties.complete', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(MSDeployStatus, self).__init__(kind=kind, **kwargs) + self.deployer = None + self.provisioning_state = None + self.start_time = None + self.end_time = None + self.complete = None + + +class NameIdentifier(msrest.serialization.Model): + """Identifies an object. + + :param name: Name of the object. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + **kwargs + ): + super(NameIdentifier, self).__init__(**kwargs) + self.name = name + + +class NameIdentifierCollection(msrest.serialization.Model): + """Collection of domain name identifiers. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.NameIdentifier] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NameIdentifier]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["NameIdentifier"], + **kwargs + ): + super(NameIdentifierCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class NameValuePair(msrest.serialization.Model): + """Name value pair. + + :param name: Pair name. + :type name: str + :param value: Pair value. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(NameValuePair, self).__init__(**kwargs) + self.name = name + self.value = value + + +class NetworkAccessControlEntry(msrest.serialization.Model): + """Network access control entry. + + :param action: Action object. Possible values include: "Permit", "Deny". + :type action: str or ~azure.mgmt.web.v2020_09_01.models.AccessControlEntryAction + :param description: Description of network access control entry. + :type description: str + :param order: Order of precedence. + :type order: int + :param remote_subnet: Remote subnet. + :type remote_subnet: str + """ + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'int'}, + 'remote_subnet': {'key': 'remoteSubnet', 'type': 'str'}, + } + + def __init__( + self, + *, + action: Optional[Union[str, "AccessControlEntryAction"]] = None, + description: Optional[str] = None, + order: Optional[int] = None, + remote_subnet: Optional[str] = None, + **kwargs + ): + super(NetworkAccessControlEntry, self).__init__(**kwargs) + self.action = action + self.description = description + self.order = order + self.remote_subnet = remote_subnet + + +class NetworkFeatures(ProxyOnlyResource): + """Full view of network features for an app (presently VNET integration and Hybrid Connections). + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar virtual_network_name: The Virtual Network name. + :vartype virtual_network_name: str + :ivar virtual_network_connection: The Virtual Network summary view. + :vartype virtual_network_connection: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :ivar hybrid_connections: The Hybrid Connections summary view. + :vartype hybrid_connections: + list[~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity] + :ivar hybrid_connections_v2: The Hybrid Connection V2 (Service Bus) view. + :vartype hybrid_connections_v2: list[~azure.mgmt.web.v2020_09_01.models.HybridConnection] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'virtual_network_name': {'readonly': True}, + 'virtual_network_connection': {'readonly': True}, + 'hybrid_connections': {'readonly': True}, + 'hybrid_connections_v2': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'virtual_network_name': {'key': 'properties.virtualNetworkName', 'type': 'str'}, + 'virtual_network_connection': {'key': 'properties.virtualNetworkConnection', 'type': 'VnetInfo'}, + 'hybrid_connections': {'key': 'properties.hybridConnections', 'type': '[RelayServiceConnectionEntity]'}, + 'hybrid_connections_v2': {'key': 'properties.hybridConnectionsV2', 'type': '[HybridConnection]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(NetworkFeatures, self).__init__(kind=kind, **kwargs) + self.virtual_network_name = None + self.virtual_network_connection = None + self.hybrid_connections = None + self.hybrid_connections_v2 = None + + +class NetworkTrace(msrest.serialization.Model): + """Network trace. + + :param path: Local file path for the captured network trace file. + :type path: str + :param status: Current status of the network trace operation, same as Operation.Status + (InProgress/Succeeded/Failed). + :type status: str + :param message: Detailed message of a network trace operation, e.g. error message in case of + failure. + :type message: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + path: Optional[str] = None, + status: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(NetworkTrace, self).__init__(**kwargs) + self.path = path + self.status = status + self.message = message + + +class Nonce(ProxyOnlyResource): + """Nonce. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param validate_nonce: + :type validate_nonce: bool + :param nonce_expiration_interval: + :type nonce_expiration_interval: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'validate_nonce': {'key': 'properties.validateNonce', 'type': 'bool'}, + 'nonce_expiration_interval': {'key': 'properties.nonceExpirationInterval', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + validate_nonce: Optional[bool] = None, + nonce_expiration_interval: Optional[str] = None, + **kwargs + ): + super(Nonce, self).__init__(kind=kind, **kwargs) + self.validate_nonce = validate_nonce + self.nonce_expiration_interval = nonce_expiration_interval + + +class OpenIdConnectClientCredential(ProxyOnlyResource): + """OpenIdConnectClientCredential. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar method: Default value: "ClientSecretPost". + :vartype method: str + :param client_secret_setting_name: + :type client_secret_setting_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'method': {'constant': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'method': {'key': 'properties.method', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + } + + method = "ClientSecretPost" + + def __init__( + self, + *, + kind: Optional[str] = None, + client_secret_setting_name: Optional[str] = None, + **kwargs + ): + super(OpenIdConnectClientCredential, self).__init__(kind=kind, **kwargs) + self.client_secret_setting_name = client_secret_setting_name + + +class OpenIdConnectConfig(ProxyOnlyResource): + """OpenIdConnectConfig. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param authorization_endpoint: + :type authorization_endpoint: str + :param token_endpoint: + :type token_endpoint: str + :param issuer: + :type issuer: str + :param certification_uri: + :type certification_uri: str + :param well_known_open_id_configuration: + :type well_known_open_id_configuration: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'authorization_endpoint': {'key': 'properties.authorizationEndpoint', 'type': 'str'}, + 'token_endpoint': {'key': 'properties.tokenEndpoint', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'certification_uri': {'key': 'properties.certificationUri', 'type': 'str'}, + 'well_known_open_id_configuration': {'key': 'properties.wellKnownOpenIdConfiguration', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + authorization_endpoint: Optional[str] = None, + token_endpoint: Optional[str] = None, + issuer: Optional[str] = None, + certification_uri: Optional[str] = None, + well_known_open_id_configuration: Optional[str] = None, + **kwargs + ): + super(OpenIdConnectConfig, self).__init__(kind=kind, **kwargs) + self.authorization_endpoint = authorization_endpoint + self.token_endpoint = token_endpoint + self.issuer = issuer + self.certification_uri = certification_uri + self.well_known_open_id_configuration = well_known_open_id_configuration + + +class OpenIdConnectLogin(ProxyOnlyResource): + """OpenIdConnectLogin. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param name_claim_type: + :type name_claim_type: str + :param scopes: + :type scopes: list[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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'name_claim_type': {'key': 'properties.nameClaimType', 'type': 'str'}, + 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + name_claim_type: Optional[str] = None, + scopes: Optional[List[str]] = None, + **kwargs + ): + super(OpenIdConnectLogin, self).__init__(kind=kind, **kwargs) + self.name_claim_type = name_claim_type + self.scopes = scopes + + +class OpenIdConnectRegistration(ProxyOnlyResource): + """OpenIdConnectRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param client_id: + :type client_id: str + :param client_credential: + :type client_credential: ~azure.mgmt.web.v2020_09_01.models.OpenIdConnectClientCredential + :param open_id_connect_configuration: + :type open_id_connect_configuration: ~azure.mgmt.web.v2020_09_01.models.OpenIdConnectConfig + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_credential': {'key': 'properties.clientCredential', 'type': 'OpenIdConnectClientCredential'}, + 'open_id_connect_configuration': {'key': 'properties.openIdConnectConfiguration', 'type': 'OpenIdConnectConfig'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + client_id: Optional[str] = None, + client_credential: Optional["OpenIdConnectClientCredential"] = None, + open_id_connect_configuration: Optional["OpenIdConnectConfig"] = None, + **kwargs + ): + super(OpenIdConnectRegistration, self).__init__(kind=kind, **kwargs) + self.client_id = client_id + self.client_credential = client_credential + self.open_id_connect_configuration = open_id_connect_configuration + + +class Operation(msrest.serialization.Model): + """An operation on a resource. + + :param id: Operation ID. + :type id: str + :param name: Operation name. + :type name: str + :param status: The current status of the operation. Possible values include: "InProgress", + "Failed", "Succeeded", "TimedOut", "Created". + :type status: str or ~azure.mgmt.web.v2020_09_01.models.OperationStatus + :param errors: Any errors associate with the operation. + :type errors: list[~azure.mgmt.web.v2020_09_01.models.ErrorEntity] + :param created_time: Time when operation has started. + :type created_time: ~datetime.datetime + :param modified_time: Time when operation has been updated. + :type modified_time: ~datetime.datetime + :param expiration_time: Time when operation will expire. + :type expiration_time: ~datetime.datetime + :param geo_master_operation_id: Applicable only for stamp operation ids. + :type geo_master_operation_id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[ErrorEntity]'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'modified_time': {'key': 'modifiedTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'expirationTime', 'type': 'iso-8601'}, + 'geo_master_operation_id': {'key': 'geoMasterOperationId', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + status: Optional[Union[str, "OperationStatus"]] = None, + errors: Optional[List["ErrorEntity"]] = None, + created_time: Optional[datetime.datetime] = None, + modified_time: Optional[datetime.datetime] = None, + expiration_time: Optional[datetime.datetime] = None, + geo_master_operation_id: Optional[str] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.id = id + self.name = name + self.status = status + self.errors = errors + self.created_time = created_time + self.modified_time = modified_time + self.expiration_time = expiration_time + self.geo_master_operation_id = geo_master_operation_id + + +class OutboundEnvironmentEndpoint(msrest.serialization.Model): + """Endpoints accessed for a common purpose that the App Service Environment requires outbound network access to. + + :param category: The type of service accessed by the App Service Environment, e.g., Azure + Storage, Azure SQL Database, and Azure Active Directory. + :type category: str + :param endpoints: The endpoints that the App Service Environment reaches the service at. + :type endpoints: list[~azure.mgmt.web.v2020_09_01.models.EndpointDependency] + """ + + _attribute_map = { + 'category': {'key': 'category', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[EndpointDependency]'}, + } + + def __init__( + self, + *, + category: Optional[str] = None, + endpoints: Optional[List["EndpointDependency"]] = None, + **kwargs + ): + super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) + self.category = category + self.endpoints = endpoints + + +class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): + """Collection of Outbound Environment Endpoints. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.OutboundEnvironmentEndpoint] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OutboundEnvironmentEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["OutboundEnvironmentEndpoint"], + **kwargs + ): + super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PerfMonCounterCollection(msrest.serialization.Model): + """Collection of performance monitor counters. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.PerfMonResponse] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PerfMonResponse]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["PerfMonResponse"], + **kwargs + ): + super(PerfMonCounterCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PerfMonResponse(msrest.serialization.Model): + """Performance monitor API response. + + :param code: The response code. + :type code: str + :param message: The message. + :type message: str + :param data: The performance monitor counters. + :type data: ~azure.mgmt.web.v2020_09_01.models.PerfMonSet + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'PerfMonSet'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + data: Optional["PerfMonSet"] = None, + **kwargs + ): + super(PerfMonResponse, self).__init__(**kwargs) + self.code = code + self.message = message + self.data = data + + +class PerfMonSample(msrest.serialization.Model): + """Performance monitor sample in a set. + + :param time: Point in time for which counter was measured. + :type time: ~datetime.datetime + :param instance_name: Name of the server on which the measurement is made. + :type instance_name: str + :param value: Value of counter at a certain time. + :type value: float + """ + + _attribute_map = { + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'instance_name': {'key': 'instanceName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__( + self, + *, + time: Optional[datetime.datetime] = None, + instance_name: Optional[str] = None, + value: Optional[float] = None, + **kwargs + ): + super(PerfMonSample, self).__init__(**kwargs) + self.time = time + self.instance_name = instance_name + self.value = value + + +class PerfMonSet(msrest.serialization.Model): + """Metric information. + + :param name: Unique key name of the counter. + :type name: str + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param time_grain: Presented time grain. + :type time_grain: str + :param values: Collection of workers that are active during this time. + :type values: list[~azure.mgmt.web.v2020_09_01.models.PerfMonSample] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[PerfMonSample]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + values: Optional[List["PerfMonSample"]] = None, + **kwargs + ): + super(PerfMonSet, self).__init__(**kwargs) + self.name = name + self.start_time = start_time + self.end_time = end_time + self.time_grain = time_grain + self.values = values + + +class PremierAddOn(Resource): + """Premier add-on. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param sku: Premier add on SKU. + :type sku: str + :param product: Premier add on Product. + :type product: str + :param vendor: Premier add on Vendor. + :type vendor: str + :param marketplace_publisher: Premier add on Marketplace publisher. + :type marketplace_publisher: str + :param marketplace_offer: Premier add on Marketplace offer. + :type marketplace_offer: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'marketplace_publisher': {'key': 'properties.marketplacePublisher', 'type': 'str'}, + 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional[str] = None, + product: Optional[str] = None, + vendor: Optional[str] = None, + marketplace_publisher: Optional[str] = None, + marketplace_offer: Optional[str] = None, + **kwargs + ): + super(PremierAddOn, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.sku = sku + self.product = product + self.vendor = vendor + self.marketplace_publisher = marketplace_publisher + self.marketplace_offer = marketplace_offer + + +class PremierAddOnOffer(ProxyOnlyResource): + """Premier add-on offer. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param sku: Premier add on SKU. + :type sku: str + :param product: Premier add on offer Product. + :type product: str + :param vendor: Premier add on offer Vendor. + :type vendor: str + :param promo_code_required: :code:`true` if promotion code is required; otherwise, + :code:`false`. + :type promo_code_required: bool + :param quota: Premier add on offer Quota. + :type quota: int + :param web_hosting_plan_restrictions: App Service plans this offer is restricted to. Possible + values include: "None", "Free", "Shared", "Basic", "Standard", "Premium". + :type web_hosting_plan_restrictions: str or + ~azure.mgmt.web.v2020_09_01.models.AppServicePlanRestrictions + :param privacy_policy_url: Privacy policy URL. + :type privacy_policy_url: str + :param legal_terms_url: Legal terms URL. + :type legal_terms_url: str + :param marketplace_publisher: Marketplace publisher. + :type marketplace_publisher: str + :param marketplace_offer: Marketplace offer. + :type marketplace_offer: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'promo_code_required': {'key': 'properties.promoCodeRequired', 'type': 'bool'}, + 'quota': {'key': 'properties.quota', 'type': 'int'}, + 'web_hosting_plan_restrictions': {'key': 'properties.webHostingPlanRestrictions', 'type': 'str'}, + 'privacy_policy_url': {'key': 'properties.privacyPolicyUrl', 'type': 'str'}, + 'legal_terms_url': {'key': 'properties.legalTermsUrl', 'type': 'str'}, + 'marketplace_publisher': {'key': 'properties.marketplacePublisher', 'type': 'str'}, + 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + sku: Optional[str] = None, + product: Optional[str] = None, + vendor: Optional[str] = None, + promo_code_required: Optional[bool] = None, + quota: Optional[int] = None, + web_hosting_plan_restrictions: Optional[Union[str, "AppServicePlanRestrictions"]] = None, + privacy_policy_url: Optional[str] = None, + legal_terms_url: Optional[str] = None, + marketplace_publisher: Optional[str] = None, + marketplace_offer: Optional[str] = None, + **kwargs + ): + super(PremierAddOnOffer, self).__init__(kind=kind, **kwargs) + self.sku = sku + self.product = product + self.vendor = vendor + self.promo_code_required = promo_code_required + self.quota = quota + self.web_hosting_plan_restrictions = web_hosting_plan_restrictions + self.privacy_policy_url = privacy_policy_url + self.legal_terms_url = legal_terms_url + self.marketplace_publisher = marketplace_publisher + self.marketplace_offer = marketplace_offer + + +class PremierAddOnOfferCollection(msrest.serialization.Model): + """Collection of premier add-on offers. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.PremierAddOnOffer] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PremierAddOnOffer]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["PremierAddOnOffer"], + **kwargs + ): + super(PremierAddOnOfferCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PremierAddOnPatchResource(ProxyOnlyResource): + """ARM resource for a PremierAddOn. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param sku: Premier add on SKU. + :type sku: str + :param product: Premier add on Product. + :type product: str + :param vendor: Premier add on Vendor. + :type vendor: str + :param marketplace_publisher: Premier add on Marketplace publisher. + :type marketplace_publisher: str + :param marketplace_offer: Premier add on Marketplace offer. + :type marketplace_offer: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'marketplace_publisher': {'key': 'properties.marketplacePublisher', 'type': 'str'}, + 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + sku: Optional[str] = None, + product: Optional[str] = None, + vendor: Optional[str] = None, + marketplace_publisher: Optional[str] = None, + marketplace_offer: Optional[str] = None, + **kwargs + ): + super(PremierAddOnPatchResource, self).__init__(kind=kind, **kwargs) + self.sku = sku + self.product = product + self.vendor = vendor + self.marketplace_publisher = marketplace_publisher + self.marketplace_offer = marketplace_offer + + +class PrivateAccess(ProxyOnlyResource): + """Description of the parameters of Private Access for a Web Site. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param enabled: Whether private access is enabled or not. + :type enabled: bool + :param virtual_networks: The Virtual Networks (and subnets) allowed to access the site + privately. + :type virtual_networks: list[~azure.mgmt.web.v2020_09_01.models.PrivateAccessVirtualNetwork] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'virtual_networks': {'key': 'properties.virtualNetworks', 'type': '[PrivateAccessVirtualNetwork]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + virtual_networks: Optional[List["PrivateAccessVirtualNetwork"]] = None, + **kwargs + ): + super(PrivateAccess, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.virtual_networks = virtual_networks + + +class PrivateAccessSubnet(msrest.serialization.Model): + """Description of a Virtual Network subnet that is useable for private site access. + + :param name: The name of the subnet. + :type name: str + :param key: The key (ID) of the subnet. + :type key: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'int'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + key: Optional[int] = None, + **kwargs + ): + super(PrivateAccessSubnet, self).__init__(**kwargs) + self.name = name + self.key = key + + +class PrivateAccessVirtualNetwork(msrest.serialization.Model): + """Description of a Virtual Network that is useable for private site access. + + :param name: The name of the Virtual Network. + :type name: str + :param key: The key (ID) of the Virtual Network. + :type key: int + :param resource_id: The ARM uri of the Virtual Network. + :type resource_id: str + :param subnets: A List of subnets that access is allowed to on this Virtual Network. An empty + array (but not null) is interpreted to mean that all subnets are allowed within this Virtual + Network. + :type subnets: list[~azure.mgmt.web.v2020_09_01.models.PrivateAccessSubnet] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'int'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'subnets': {'key': 'subnets', 'type': '[PrivateAccessSubnet]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + key: Optional[int] = None, + resource_id: Optional[str] = None, + subnets: Optional[List["PrivateAccessSubnet"]] = None, + **kwargs + ): + super(PrivateAccessVirtualNetwork, self).__init__(**kwargs) + self.name = name + self.key = key + self.resource_id = resource_id + self.subnets = subnets + + +class PrivateEndpointConnectionResource(ProxyOnlyResource): + """Private Endpoint Connection ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar provisioning_state: + :vartype provisioning_state: str + :param private_endpoint: PrivateEndpoint of a remote private endpoint connection. + :type private_endpoint: ~azure.mgmt.web.v2020_09_01.models.ArmIdWrapper + :param private_link_service_connection_state: The state of a private link connection. + :type private_link_service_connection_state: + ~azure.mgmt.web.v2020_09_01.models.PrivateLinkConnectionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'ArmIdWrapper'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkConnectionState'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + private_endpoint: Optional["ArmIdWrapper"] = None, + private_link_service_connection_state: Optional["PrivateLinkConnectionState"] = None, + **kwargs + ): + super(PrivateEndpointConnectionResource, self).__init__(kind=kind, **kwargs) + self.provisioning_state = None + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + + +class PrivateLinkConnectionApprovalRequestResource(ProxyOnlyResource): + """Private Endpoint Connection Approval ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param private_link_service_connection_state: The state of a private link connection. + :type private_link_service_connection_state: + ~azure.mgmt.web.v2020_09_01.models.PrivateLinkConnectionState + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkConnectionState'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + private_link_service_connection_state: Optional["PrivateLinkConnectionState"] = None, + **kwargs + ): + super(PrivateLinkConnectionApprovalRequestResource, self).__init__(kind=kind, **kwargs) + self.private_link_service_connection_state = private_link_service_connection_state + + +class PrivateLinkConnectionState(msrest.serialization.Model): + """The state of a private link connection. + + :param status: Status of a private link connection. + :type status: str + :param description: Description of a private link connection. + :type description: str + :param actions_required: ActionsRequired for a private link connection. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[str] = None, + description: Optional[str] = None, + actions_required: Optional[str] = None, + **kwargs + ): + super(PrivateLinkConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + +class PrivateLinkResource(msrest.serialization.Model): + """A private link resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. + :type id: str + :param name: Required. Name of a private link resource. + :type name: str + :param type: Required. + :type type: str + :param properties: Required. Properties of a private link resource. + :type properties: ~azure.mgmt.web.v2020_09_01.models.PrivateLinkResourceProperties + """ + + _validation = { + 'id': {'required': True}, + 'name': {'required': True}, + 'type': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateLinkResourceProperties'}, + } + + def __init__( + self, + *, + id: str, + name: str, + type: str, + properties: "PrivateLinkResourceProperties", + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.properties = properties + + +class PrivateLinkResourceProperties(msrest.serialization.Model): + """Properties of a private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar group_id: GroupId of a private link resource. + :vartype group_id: str + :ivar required_members: RequiredMembers of a private link resource. + :vartype required_members: list[str] + :ivar required_zone_names: RequiredZoneNames of a private link resource. + :vartype required_zone_names: list[str] + """ + + _validation = { + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + 'required_zone_names': {'readonly': True}, + } + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourceProperties, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = None + + +class PrivateLinkResourcesWrapper(msrest.serialization.Model): + """Wrapper for a collection of private link resources. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. + :type value: list[~azure.mgmt.web.v2020_09_01.models.PrivateLinkResource] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + *, + value: List["PrivateLinkResource"], + **kwargs + ): + super(PrivateLinkResourcesWrapper, self).__init__(**kwargs) + self.value = value + + +class ProcessInfo(ProxyOnlyResource): + """Process Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar identifier: ARM Identifier for deployment. + :vartype identifier: int + :param deployment_name: Deployment name. + :type deployment_name: str + :param href: HRef URI. + :type href: str + :param minidump: Minidump URI. + :type minidump: str + :param is_profile_running: Is profile running?. + :type is_profile_running: bool + :param is_iis_profile_running: Is the IIS Profile running?. + :type is_iis_profile_running: bool + :param iis_profile_timeout_in_seconds: IIS Profile timeout (seconds). + :type iis_profile_timeout_in_seconds: float + :param parent: Parent process. + :type parent: str + :param children: Child process list. + :type children: list[str] + :param threads: Thread list. + :type threads: list[~azure.mgmt.web.v2020_09_01.models.ProcessThreadInfo] + :param open_file_handles: List of open files. + :type open_file_handles: list[str] + :param modules: List of modules. + :type modules: list[~azure.mgmt.web.v2020_09_01.models.ProcessModuleInfo] + :param file_name: File name of this process. + :type file_name: str + :param command_line: Command line. + :type command_line: str + :param user_name: User name. + :type user_name: str + :param handle_count: Handle count. + :type handle_count: int + :param module_count: Module count. + :type module_count: int + :param thread_count: Thread count. + :type thread_count: int + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param total_cpu_time: Total CPU time. + :type total_cpu_time: str + :param user_cpu_time: User CPU time. + :type user_cpu_time: str + :param privileged_cpu_time: Privileged CPU time. + :type privileged_cpu_time: str + :param working_set: Working set. + :type working_set: long + :param peak_working_set: Peak working set. + :type peak_working_set: long + :param private_memory: Private memory size. + :type private_memory: long + :param virtual_memory: Virtual memory size. + :type virtual_memory: long + :param peak_virtual_memory: Peak virtual memory usage. + :type peak_virtual_memory: long + :param paged_system_memory: Paged system memory. + :type paged_system_memory: long + :param non_paged_system_memory: Non-paged system memory. + :type non_paged_system_memory: long + :param paged_memory: Paged memory. + :type paged_memory: long + :param peak_paged_memory: Peak paged memory. + :type peak_paged_memory: long + :param time_stamp: Time stamp. + :type time_stamp: ~datetime.datetime + :param environment_variables: List of environment variables. + :type environment_variables: dict[str, str] + :param is_scm_site: Is this the SCM site?. + :type is_scm_site: bool + :param is_webjob: Is this a Web Job?. + :type is_webjob: bool + :param description: Description of process. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'identifier': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'identifier': {'key': 'properties.identifier', 'type': 'int'}, + 'deployment_name': {'key': 'properties.deployment_name', 'type': 'str'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'minidump': {'key': 'properties.minidump', 'type': 'str'}, + 'is_profile_running': {'key': 'properties.is_profile_running', 'type': 'bool'}, + 'is_iis_profile_running': {'key': 'properties.is_iis_profile_running', 'type': 'bool'}, + 'iis_profile_timeout_in_seconds': {'key': 'properties.iis_profile_timeout_in_seconds', 'type': 'float'}, + 'parent': {'key': 'properties.parent', 'type': 'str'}, + 'children': {'key': 'properties.children', 'type': '[str]'}, + 'threads': {'key': 'properties.threads', 'type': '[ProcessThreadInfo]'}, + 'open_file_handles': {'key': 'properties.open_file_handles', 'type': '[str]'}, + 'modules': {'key': 'properties.modules', 'type': '[ProcessModuleInfo]'}, + 'file_name': {'key': 'properties.file_name', 'type': 'str'}, + 'command_line': {'key': 'properties.command_line', 'type': 'str'}, + 'user_name': {'key': 'properties.user_name', 'type': 'str'}, + 'handle_count': {'key': 'properties.handle_count', 'type': 'int'}, + 'module_count': {'key': 'properties.module_count', 'type': 'int'}, + 'thread_count': {'key': 'properties.thread_count', 'type': 'int'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'total_cpu_time': {'key': 'properties.total_cpu_time', 'type': 'str'}, + 'user_cpu_time': {'key': 'properties.user_cpu_time', 'type': 'str'}, + 'privileged_cpu_time': {'key': 'properties.privileged_cpu_time', 'type': 'str'}, + 'working_set': {'key': 'properties.working_set', 'type': 'long'}, + 'peak_working_set': {'key': 'properties.peak_working_set', 'type': 'long'}, + 'private_memory': {'key': 'properties.private_memory', 'type': 'long'}, + 'virtual_memory': {'key': 'properties.virtual_memory', 'type': 'long'}, + 'peak_virtual_memory': {'key': 'properties.peak_virtual_memory', 'type': 'long'}, + 'paged_system_memory': {'key': 'properties.paged_system_memory', 'type': 'long'}, + 'non_paged_system_memory': {'key': 'properties.non_paged_system_memory', 'type': 'long'}, + 'paged_memory': {'key': 'properties.paged_memory', 'type': 'long'}, + 'peak_paged_memory': {'key': 'properties.peak_paged_memory', 'type': 'long'}, + 'time_stamp': {'key': 'properties.time_stamp', 'type': 'iso-8601'}, + 'environment_variables': {'key': 'properties.environment_variables', 'type': '{str}'}, + 'is_scm_site': {'key': 'properties.is_scm_site', 'type': 'bool'}, + 'is_webjob': {'key': 'properties.is_webjob', 'type': 'bool'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + deployment_name: Optional[str] = None, + href: Optional[str] = None, + minidump: Optional[str] = None, + is_profile_running: Optional[bool] = None, + is_iis_profile_running: Optional[bool] = None, + iis_profile_timeout_in_seconds: Optional[float] = None, + parent: Optional[str] = None, + children: Optional[List[str]] = None, + threads: Optional[List["ProcessThreadInfo"]] = None, + open_file_handles: Optional[List[str]] = None, + modules: Optional[List["ProcessModuleInfo"]] = None, + file_name: Optional[str] = None, + command_line: Optional[str] = None, + user_name: Optional[str] = None, + handle_count: Optional[int] = None, + module_count: Optional[int] = None, + thread_count: Optional[int] = None, + start_time: Optional[datetime.datetime] = None, + total_cpu_time: Optional[str] = None, + user_cpu_time: Optional[str] = None, + privileged_cpu_time: Optional[str] = None, + working_set: Optional[int] = None, + peak_working_set: Optional[int] = None, + private_memory: Optional[int] = None, + virtual_memory: Optional[int] = None, + peak_virtual_memory: Optional[int] = None, + paged_system_memory: Optional[int] = None, + non_paged_system_memory: Optional[int] = None, + paged_memory: Optional[int] = None, + peak_paged_memory: Optional[int] = None, + time_stamp: Optional[datetime.datetime] = None, + environment_variables: Optional[Dict[str, str]] = None, + is_scm_site: Optional[bool] = None, + is_webjob: Optional[bool] = None, + description: Optional[str] = None, + **kwargs + ): + super(ProcessInfo, self).__init__(kind=kind, **kwargs) + self.identifier = None + self.deployment_name = deployment_name + self.href = href + self.minidump = minidump + self.is_profile_running = is_profile_running + self.is_iis_profile_running = is_iis_profile_running + self.iis_profile_timeout_in_seconds = iis_profile_timeout_in_seconds + self.parent = parent + self.children = children + self.threads = threads + self.open_file_handles = open_file_handles + self.modules = modules + self.file_name = file_name + self.command_line = command_line + self.user_name = user_name + self.handle_count = handle_count + self.module_count = module_count + self.thread_count = thread_count + self.start_time = start_time + self.total_cpu_time = total_cpu_time + self.user_cpu_time = user_cpu_time + self.privileged_cpu_time = privileged_cpu_time + self.working_set = working_set + self.peak_working_set = peak_working_set + self.private_memory = private_memory + self.virtual_memory = virtual_memory + self.peak_virtual_memory = peak_virtual_memory + self.paged_system_memory = paged_system_memory + self.non_paged_system_memory = non_paged_system_memory + self.paged_memory = paged_memory + self.peak_paged_memory = peak_paged_memory + self.time_stamp = time_stamp + self.environment_variables = environment_variables + self.is_scm_site = is_scm_site + self.is_webjob = is_webjob + self.description = description + + +class ProcessInfoCollection(msrest.serialization.Model): + """Collection of Kudu process information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.ProcessInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProcessInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ProcessInfo"], + **kwargs + ): + super(ProcessInfoCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ProcessModuleInfo(ProxyOnlyResource): + """Process Module Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param base_address: Base address. Used as module identifier in ARM resource URI. + :type base_address: str + :param file_name: File name. + :type file_name: str + :param href: HRef URI. + :type href: str + :param file_path: File path. + :type file_path: str + :param module_memory_size: Module memory size. + :type module_memory_size: int + :param file_version: File version. + :type file_version: str + :param file_description: File description. + :type file_description: str + :param product: Product name. + :type product: str + :param product_version: Product version. + :type product_version: str + :param is_debug: Is debug?. + :type is_debug: bool + :param language: Module language (locale). + :type language: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'base_address': {'key': 'properties.base_address', 'type': 'str'}, + 'file_name': {'key': 'properties.file_name', 'type': 'str'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'file_path': {'key': 'properties.file_path', 'type': 'str'}, + 'module_memory_size': {'key': 'properties.module_memory_size', 'type': 'int'}, + 'file_version': {'key': 'properties.file_version', 'type': 'str'}, + 'file_description': {'key': 'properties.file_description', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'product_version': {'key': 'properties.product_version', 'type': 'str'}, + 'is_debug': {'key': 'properties.is_debug', 'type': 'bool'}, + 'language': {'key': 'properties.language', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + base_address: Optional[str] = None, + file_name: Optional[str] = None, + href: Optional[str] = None, + file_path: Optional[str] = None, + module_memory_size: Optional[int] = None, + file_version: Optional[str] = None, + file_description: Optional[str] = None, + product: Optional[str] = None, + product_version: Optional[str] = None, + is_debug: Optional[bool] = None, + language: Optional[str] = None, + **kwargs + ): + super(ProcessModuleInfo, self).__init__(kind=kind, **kwargs) + self.base_address = base_address + self.file_name = file_name + self.href = href + self.file_path = file_path + self.module_memory_size = module_memory_size + self.file_version = file_version + self.file_description = file_description + self.product = product + self.product_version = product_version + self.is_debug = is_debug + self.language = language + + +class ProcessModuleInfoCollection(msrest.serialization.Model): + """Collection of Kudu thread information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.ProcessModuleInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProcessModuleInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ProcessModuleInfo"], + **kwargs + ): + super(ProcessModuleInfoCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ProcessThreadInfo(ProxyOnlyResource): + """Process Thread Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar identifier: Site extension ID. + :vartype identifier: int + :param href: HRef URI. + :type href: str + :param process: Process URI. + :type process: str + :param start_address: Start address. + :type start_address: str + :param current_priority: Current thread priority. + :type current_priority: int + :param priority_level: Thread priority level. + :type priority_level: str + :param base_priority: Base priority. + :type base_priority: int + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param total_processor_time: Total processor time. + :type total_processor_time: str + :param user_processor_time: User processor time. + :type user_processor_time: str + :param state: Thread state. + :type state: str + :param wait_reason: Wait reason. + :type wait_reason: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'identifier': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'identifier': {'key': 'properties.identifier', 'type': 'int'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'process': {'key': 'properties.process', 'type': 'str'}, + 'start_address': {'key': 'properties.start_address', 'type': 'str'}, + 'current_priority': {'key': 'properties.current_priority', 'type': 'int'}, + 'priority_level': {'key': 'properties.priority_level', 'type': 'str'}, + 'base_priority': {'key': 'properties.base_priority', 'type': 'int'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'total_processor_time': {'key': 'properties.total_processor_time', 'type': 'str'}, + 'user_processor_time': {'key': 'properties.user_processor_time', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'wait_reason': {'key': 'properties.wait_reason', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + href: Optional[str] = None, + process: Optional[str] = None, + start_address: Optional[str] = None, + current_priority: Optional[int] = None, + priority_level: Optional[str] = None, + base_priority: Optional[int] = None, + start_time: Optional[datetime.datetime] = None, + total_processor_time: Optional[str] = None, + user_processor_time: Optional[str] = None, + state: Optional[str] = None, + wait_reason: Optional[str] = None, + **kwargs + ): + super(ProcessThreadInfo, self).__init__(kind=kind, **kwargs) + self.identifier = None + self.href = href + self.process = process + self.start_address = start_address + self.current_priority = current_priority + self.priority_level = priority_level + self.base_priority = base_priority + self.start_time = start_time + self.total_processor_time = total_processor_time + self.user_processor_time = user_processor_time + self.state = state + self.wait_reason = wait_reason + + +class ProcessThreadInfoCollection(msrest.serialization.Model): + """Collection of Kudu thread information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.ProcessThreadInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProcessThreadInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ProcessThreadInfo"], + **kwargs + ): + super(ProcessThreadInfoCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PublicCertificate(ProxyOnlyResource): + """Public certificate object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param blob: Public Certificate byte array. + :type blob: bytearray + :param public_certificate_location: Public Certificate Location. Possible values include: + "CurrentUserMy", "LocalMachineMy", "Unknown". + :type public_certificate_location: str or + ~azure.mgmt.web.v2020_09_01.models.PublicCertificateLocation + :ivar thumbprint: Certificate Thumbprint. + :vartype thumbprint: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'thumbprint': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'blob': {'key': 'properties.blob', 'type': 'bytearray'}, + 'public_certificate_location': {'key': 'properties.publicCertificateLocation', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + blob: Optional[bytearray] = None, + public_certificate_location: Optional[Union[str, "PublicCertificateLocation"]] = None, + **kwargs + ): + super(PublicCertificate, self).__init__(kind=kind, **kwargs) + self.blob = blob + self.public_certificate_location = public_certificate_location + self.thumbprint = None + + +class PublicCertificateCollection(msrest.serialization.Model): + """Collection of public certificates. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.PublicCertificate] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PublicCertificate]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["PublicCertificate"], + **kwargs + ): + super(PublicCertificateCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PushSettings(ProxyOnlyResource): + """Push settings for the App. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param is_push_enabled: Gets or sets a flag indicating whether the Push endpoint is enabled. + :type is_push_enabled: bool + :param tag_whitelist_json: Gets or sets a JSON string containing a list of tags that are + whitelisted for use by the push registration endpoint. + :type tag_whitelist_json: str + :param tags_requiring_auth: Gets or sets a JSON string containing a list of tags that require + user authentication to be used in the push registration endpoint. + Tags can consist of alphanumeric characters and the following: + '_', '@', '#', '.', ':', '-'. + Validation should be performed at the PushRequestHandler. + :type tags_requiring_auth: str + :param dynamic_tags_json: Gets or sets a JSON string containing a list of dynamic tags that + will be evaluated from user claims in the push registration endpoint. + :type dynamic_tags_json: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'is_push_enabled': {'key': 'properties.isPushEnabled', 'type': 'bool'}, + 'tag_whitelist_json': {'key': 'properties.tagWhitelistJson', 'type': 'str'}, + 'tags_requiring_auth': {'key': 'properties.tagsRequiringAuth', 'type': 'str'}, + 'dynamic_tags_json': {'key': 'properties.dynamicTagsJson', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + is_push_enabled: Optional[bool] = None, + tag_whitelist_json: Optional[str] = None, + tags_requiring_auth: Optional[str] = None, + dynamic_tags_json: Optional[str] = None, + **kwargs + ): + super(PushSettings, self).__init__(kind=kind, **kwargs) + self.is_push_enabled = is_push_enabled + self.tag_whitelist_json = tag_whitelist_json + self.tags_requiring_auth = tags_requiring_auth + self.dynamic_tags_json = dynamic_tags_json + + +class RampUpRule(msrest.serialization.Model): + """Routing rules for ramp up testing. This rule allows to redirect static traffic % to a slot or to gradually change routing % based on performance. + + :param action_host_name: Hostname of a slot to which the traffic will be redirected if decided + to. E.g. myapp-stage.azurewebsites.net. + :type action_host_name: str + :param reroute_percentage: Percentage of the traffic which will be redirected to + :code:`ActionHostName`. + :type reroute_percentage: float + :param change_step: In auto ramp up scenario this is the step to add/remove from + :code:`ReroutePercentage` until it reaches + \n:code:`MinReroutePercentage` or + :code:`MaxReroutePercentage`. Site metrics are checked every N minutes specified + in :code:`ChangeIntervalInMinutes`.\nCustom decision algorithm + can be provided in TiPCallback site extension which URL can be specified in + :code:`ChangeDecisionCallbackUrl`. + :type change_step: float + :param change_interval_in_minutes: Specifies interval in minutes to reevaluate + ReroutePercentage. + :type change_interval_in_minutes: int + :param min_reroute_percentage: Specifies lower boundary above which ReroutePercentage will + stay. + :type min_reroute_percentage: float + :param max_reroute_percentage: Specifies upper boundary below which ReroutePercentage will + stay. + :type max_reroute_percentage: float + :param change_decision_callback_url: Custom decision algorithm can be provided in TiPCallback + site extension which URL can be specified. See TiPCallback site extension for the scaffold and + contracts. + https://www.siteextensions.net/packages/TiPCallback/. + :type change_decision_callback_url: str + :param name: Name of the routing rule. The recommended name would be to point to the slot which + will receive the traffic in the experiment. + :type name: str + """ + + _attribute_map = { + 'action_host_name': {'key': 'actionHostName', 'type': 'str'}, + 'reroute_percentage': {'key': 'reroutePercentage', 'type': 'float'}, + 'change_step': {'key': 'changeStep', 'type': 'float'}, + 'change_interval_in_minutes': {'key': 'changeIntervalInMinutes', 'type': 'int'}, + 'min_reroute_percentage': {'key': 'minReroutePercentage', 'type': 'float'}, + 'max_reroute_percentage': {'key': 'maxReroutePercentage', 'type': 'float'}, + 'change_decision_callback_url': {'key': 'changeDecisionCallbackUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + action_host_name: Optional[str] = None, + reroute_percentage: Optional[float] = None, + change_step: Optional[float] = None, + change_interval_in_minutes: Optional[int] = None, + min_reroute_percentage: Optional[float] = None, + max_reroute_percentage: Optional[float] = None, + change_decision_callback_url: Optional[str] = None, + name: Optional[str] = None, + **kwargs + ): + super(RampUpRule, self).__init__(**kwargs) + self.action_host_name = action_host_name + self.reroute_percentage = reroute_percentage + self.change_step = change_step + self.change_interval_in_minutes = change_interval_in_minutes + self.min_reroute_percentage = min_reroute_percentage + self.max_reroute_percentage = max_reroute_percentage + self.change_decision_callback_url = change_decision_callback_url + self.name = name + + +class Recommendation(ProxyOnlyResource): + """Represents a recommendation result generated by the recommendation engine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param creation_time: Timestamp when this instance was created. + :type creation_time: ~datetime.datetime + :param recommendation_id: A GUID value that each recommendation object is associated with. + :type recommendation_id: str + :param resource_id: Full ARM resource ID string that this recommendation object is associated + with. + :type resource_id: str + :param resource_scope: Name of a resource type this recommendation applies, e.g. Subscription, + ServerFarm, Site. Possible values include: "ServerFarm", "Subscription", "WebSite". + :type resource_scope: str or ~azure.mgmt.web.v2020_09_01.models.ResourceScopeType + :param rule_name: Unique name of the rule. + :type rule_name: str + :param display_name: UI friendly name of the rule (may not be unique). + :type display_name: str + :param message: Recommendation text. + :type message: str + :param level: Level indicating how critical this recommendation can impact. Possible values + include: "Critical", "Warning", "Information", "NonUrgentSuggestion". + :type level: str or ~azure.mgmt.web.v2020_09_01.models.NotificationLevel + :param channels: List of channels that this recommendation can apply. Possible values include: + "Notification", "Api", "Email", "Webhook", "All". + :type channels: str or ~azure.mgmt.web.v2020_09_01.models.Channels + :ivar category_tags: The list of category tags that this recommendation belongs to. + :vartype category_tags: list[str] + :param action_name: Name of action recommended by this object. + :type action_name: str + :param enabled: True if this recommendation is still valid (i.e. "actionable"). False if it is + invalid. + :type enabled: int + :param states: The list of states of this recommendation. If it's null then it should be + considered "Active". + :type states: list[str] + :param start_time: The beginning time in UTC of a range that the recommendation refers to. + :type start_time: ~datetime.datetime + :param end_time: The end time in UTC of a range that the recommendation refers to. + :type end_time: ~datetime.datetime + :param next_notification_time: When to notify this recommendation next in UTC. Null means that + this will never be notified anymore. + :type next_notification_time: ~datetime.datetime + :param notification_expiration_time: Date and time in UTC when this notification expires. + :type notification_expiration_time: ~datetime.datetime + :param notified_time: Last timestamp in UTC this instance was actually notified. Null means + that this recommendation hasn't been notified yet. + :type notified_time: ~datetime.datetime + :param score: A metric value measured by the rule. + :type score: float + :param is_dynamic: True if this is associated with a dynamically added rule. + :type is_dynamic: bool + :param extension_name: Extension name of the portal if exists. + :type extension_name: str + :param blade_name: Deep link to a blade on the portal. + :type blade_name: str + :param forward_link: Forward link to an external document associated with the rule. + :type forward_link: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'category_tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'recommendation_id': {'key': 'properties.recommendationId', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'resource_scope': {'key': 'properties.resourceScope', 'type': 'str'}, + 'rule_name': {'key': 'properties.ruleName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'level': {'key': 'properties.level', 'type': 'str'}, + 'channels': {'key': 'properties.channels', 'type': 'str'}, + 'category_tags': {'key': 'properties.categoryTags', 'type': '[str]'}, + 'action_name': {'key': 'properties.actionName', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'int'}, + 'states': {'key': 'properties.states', 'type': '[str]'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'next_notification_time': {'key': 'properties.nextNotificationTime', 'type': 'iso-8601'}, + 'notification_expiration_time': {'key': 'properties.notificationExpirationTime', 'type': 'iso-8601'}, + 'notified_time': {'key': 'properties.notifiedTime', 'type': 'iso-8601'}, + 'score': {'key': 'properties.score', 'type': 'float'}, + 'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'}, + 'extension_name': {'key': 'properties.extensionName', 'type': 'str'}, + 'blade_name': {'key': 'properties.bladeName', 'type': 'str'}, + 'forward_link': {'key': 'properties.forwardLink', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + creation_time: Optional[datetime.datetime] = None, + recommendation_id: Optional[str] = None, + resource_id: Optional[str] = None, + resource_scope: Optional[Union[str, "ResourceScopeType"]] = None, + rule_name: Optional[str] = None, + display_name: Optional[str] = None, + message: Optional[str] = None, + level: Optional[Union[str, "NotificationLevel"]] = None, + channels: Optional[Union[str, "Channels"]] = None, + action_name: Optional[str] = None, + enabled: Optional[int] = None, + states: Optional[List[str]] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + next_notification_time: Optional[datetime.datetime] = None, + notification_expiration_time: Optional[datetime.datetime] = None, + notified_time: Optional[datetime.datetime] = None, + score: Optional[float] = None, + is_dynamic: Optional[bool] = None, + extension_name: Optional[str] = None, + blade_name: Optional[str] = None, + forward_link: Optional[str] = None, + **kwargs + ): + super(Recommendation, self).__init__(kind=kind, **kwargs) + self.creation_time = creation_time + self.recommendation_id = recommendation_id + self.resource_id = resource_id + self.resource_scope = resource_scope + self.rule_name = rule_name + self.display_name = display_name + self.message = message + self.level = level + self.channels = channels + self.category_tags = None + self.action_name = action_name + self.enabled = enabled + self.states = states + self.start_time = start_time + self.end_time = end_time + self.next_notification_time = next_notification_time + self.notification_expiration_time = notification_expiration_time + self.notified_time = notified_time + self.score = score + self.is_dynamic = is_dynamic + self.extension_name = extension_name + self.blade_name = blade_name + self.forward_link = forward_link + + +class RecommendationCollection(msrest.serialization.Model): + """Collection of recommendations. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.Recommendation] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Recommendation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Recommendation"], + **kwargs + ): + super(RecommendationCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class RecommendationRule(ProxyOnlyResource): + """Represents a recommendation rule that the recommendation engine can perform. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param recommendation_name: Unique name of the rule. + :type recommendation_name: str + :param display_name: UI friendly name of the rule. + :type display_name: str + :param message: Localized name of the rule (Good for UI). + :type message: str + :param recommendation_id: Recommendation ID of an associated recommendation object tied to the + rule, if exists. + If such an object doesn't exist, it is set to null. + :type recommendation_id: str + :param description: Localized detailed description of the rule. + :type description: str + :param action_name: Name of action that is recommended by this rule in string. + :type action_name: str + :param level: Level of impact indicating how critical this rule is. Possible values include: + "Critical", "Warning", "Information", "NonUrgentSuggestion". + :type level: str or ~azure.mgmt.web.v2020_09_01.models.NotificationLevel + :param channels: List of available channels that this rule applies. Possible values include: + "Notification", "Api", "Email", "Webhook", "All". + :type channels: str or ~azure.mgmt.web.v2020_09_01.models.Channels + :ivar category_tags: The list of category tags that this recommendation rule belongs to. + :vartype category_tags: list[str] + :param is_dynamic: True if this is associated with a dynamically added rule. + :type is_dynamic: bool + :param extension_name: Extension name of the portal if exists. Applicable to dynamic rule only. + :type extension_name: str + :param blade_name: Deep link to a blade on the portal. Applicable to dynamic rule only. + :type blade_name: str + :param forward_link: Forward link to an external document associated with the rule. Applicable + to dynamic rule only. + :type forward_link: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'category_tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'recommendation_name': {'key': 'properties.recommendationName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'recommendation_id': {'key': 'properties.recommendationId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'action_name': {'key': 'properties.actionName', 'type': 'str'}, + 'level': {'key': 'properties.level', 'type': 'str'}, + 'channels': {'key': 'properties.channels', 'type': 'str'}, + 'category_tags': {'key': 'properties.categoryTags', 'type': '[str]'}, + 'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'}, + 'extension_name': {'key': 'properties.extensionName', 'type': 'str'}, + 'blade_name': {'key': 'properties.bladeName', 'type': 'str'}, + 'forward_link': {'key': 'properties.forwardLink', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + recommendation_name: Optional[str] = None, + display_name: Optional[str] = None, + message: Optional[str] = None, + recommendation_id: Optional[str] = None, + description: Optional[str] = None, + action_name: Optional[str] = None, + level: Optional[Union[str, "NotificationLevel"]] = None, + channels: Optional[Union[str, "Channels"]] = None, + is_dynamic: Optional[bool] = None, + extension_name: Optional[str] = None, + blade_name: Optional[str] = None, + forward_link: Optional[str] = None, + **kwargs + ): + super(RecommendationRule, self).__init__(kind=kind, **kwargs) + self.recommendation_name = recommendation_name + self.display_name = display_name + self.message = message + self.recommendation_id = recommendation_id + self.description = description + self.action_name = action_name + self.level = level + self.channels = channels + self.category_tags = None + self.is_dynamic = is_dynamic + self.extension_name = extension_name + self.blade_name = blade_name + self.forward_link = forward_link + + +class ReissueCertificateOrderRequest(ProxyOnlyResource): + """Class representing certificate reissue request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param key_size: Certificate Key Size. + :type key_size: int + :param delay_existing_revoke_in_hours: Delay in hours to revoke existing certificate after the + new certificate is issued. + :type delay_existing_revoke_in_hours: int + :param csr: Csr to be used for re-key operation. + :type csr: str + :param is_private_key_external: Should we change the ASC type (from managed private key to + external private key and vice versa). + :type is_private_key_external: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'delay_existing_revoke_in_hours': {'key': 'properties.delayExistingRevokeInHours', 'type': 'int'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + key_size: Optional[int] = None, + delay_existing_revoke_in_hours: Optional[int] = None, + csr: Optional[str] = None, + is_private_key_external: Optional[bool] = None, + **kwargs + ): + super(ReissueCertificateOrderRequest, self).__init__(kind=kind, **kwargs) + self.key_size = key_size + self.delay_existing_revoke_in_hours = delay_existing_revoke_in_hours + self.csr = csr + self.is_private_key_external = is_private_key_external + + +class RelayServiceConnectionEntity(ProxyOnlyResource): + """Hybrid Connection for an App Service app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param entity_name: + :type entity_name: str + :param entity_connection_string: + :type entity_connection_string: str + :param resource_type: + :type resource_type: str + :param resource_connection_string: + :type resource_connection_string: str + :param hostname: + :type hostname: str + :param port: + :type port: int + :param biztalk_uri: + :type biztalk_uri: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'entity_name': {'key': 'properties.entityName', 'type': 'str'}, + 'entity_connection_string': {'key': 'properties.entityConnectionString', 'type': 'str'}, + 'resource_type': {'key': 'properties.resourceType', 'type': 'str'}, + 'resource_connection_string': {'key': 'properties.resourceConnectionString', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'biztalk_uri': {'key': 'properties.biztalkUri', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + entity_name: Optional[str] = None, + entity_connection_string: Optional[str] = None, + resource_type: Optional[str] = None, + resource_connection_string: Optional[str] = None, + hostname: Optional[str] = None, + port: Optional[int] = None, + biztalk_uri: Optional[str] = None, + **kwargs + ): + super(RelayServiceConnectionEntity, self).__init__(kind=kind, **kwargs) + self.entity_name = entity_name + self.entity_connection_string = entity_connection_string + self.resource_type = resource_type + self.resource_connection_string = resource_connection_string + self.hostname = hostname + self.port = port + self.biztalk_uri = biztalk_uri + + +class Rendering(msrest.serialization.Model): + """Instructions for rendering the data. + + :param type: Rendering Type. Possible values include: "NoGraph", "Table", "TimeSeries", + "TimeSeriesPerInstance". + :type type: str or ~azure.mgmt.web.v2020_09_01.models.RenderingType + :param title: Title of data. + :type title: str + :param description: Description of the data that will help it be interpreted. + :type description: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "RenderingType"]] = None, + title: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(Rendering, self).__init__(**kwargs) + self.type = type + self.title = title + self.description = description + + +class RenewCertificateOrderRequest(ProxyOnlyResource): + """Class representing certificate renew request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param key_size: Certificate Key Size. + :type key_size: int + :param csr: Csr to be used for re-key operation. + :type csr: str + :param is_private_key_external: Should we change the ASC type (from managed private key to + external private key and vice versa). + :type is_private_key_external: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + key_size: Optional[int] = None, + csr: Optional[str] = None, + is_private_key_external: Optional[bool] = None, + **kwargs + ): + super(RenewCertificateOrderRequest, self).__init__(kind=kind, **kwargs) + self.key_size = key_size + self.csr = csr + self.is_private_key_external = is_private_key_external + + +class RequestsBasedTrigger(msrest.serialization.Model): + """Trigger based on total requests. + + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + } + + def __init__( + self, + *, + count: Optional[int] = None, + time_interval: Optional[str] = None, + **kwargs + ): + super(RequestsBasedTrigger, self).__init__(**kwargs) + self.count = count + self.time_interval = time_interval + + +class ResourceCollection(msrest.serialization.Model): + """Collection of resources. + + 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. + + :param value: Required. Collection of resources. + :type value: list[str] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[str]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List[str], + **kwargs + ): + super(ResourceCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ResourceHealthMetadata(ProxyOnlyResource): + """Used for getting ResourceHealthCheck settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param category: The category that the resource matches in the RHC Policy File. + :type category: str + :param signal_availability: Is there a health signal for the resource. + :type signal_availability: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'signal_availability': {'key': 'properties.signalAvailability', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + category: Optional[str] = None, + signal_availability: Optional[bool] = None, + **kwargs + ): + super(ResourceHealthMetadata, self).__init__(kind=kind, **kwargs) + self.category = category + self.signal_availability = signal_availability + + +class ResourceHealthMetadataCollection(msrest.serialization.Model): + """Collection of resource health metadata. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.ResourceHealthMetadata] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceHealthMetadata]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ResourceHealthMetadata"], + **kwargs + ): + super(ResourceHealthMetadataCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ResourceMetricAvailability(msrest.serialization.Model): + """Metrics availability and retention. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar time_grain: Time grain . + :vartype time_grain: str + :ivar retention: Retention period for the current time grain. + :vartype retention: str + """ + + _validation = { + 'time_grain': {'readonly': True}, + 'retention': {'readonly': True}, + } + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'retention': {'key': 'retention', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceMetricAvailability, self).__init__(**kwargs) + self.time_grain = None + self.retention = None + + +class ResourceMetricDefinition(ProxyOnlyResource): + """Metadata for the metrics. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar unit: Unit of the metric. + :vartype unit: str + :ivar primary_aggregation_type: Primary aggregation type. + :vartype primary_aggregation_type: str + :ivar metric_availabilities: List of time grains supported for the metric together with + retention period. + :vartype metric_availabilities: + list[~azure.mgmt.web.v2020_09_01.models.ResourceMetricAvailability] + :ivar resource_uri: Resource URI. + :vartype resource_uri: str + :ivar properties: Resource metric definition properties. + :vartype properties: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'unit': {'readonly': True}, + 'primary_aggregation_type': {'readonly': True}, + 'metric_availabilities': {'readonly': True}, + 'resource_uri': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'unit': {'key': 'properties.unit', 'type': 'str'}, + 'primary_aggregation_type': {'key': 'properties.primaryAggregationType', 'type': 'str'}, + 'metric_availabilities': {'key': 'properties.metricAvailabilities', 'type': '[ResourceMetricAvailability]'}, + 'resource_uri': {'key': 'properties.resourceUri', 'type': 'str'}, + 'properties': {'key': 'properties.properties', 'type': '{str}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(ResourceMetricDefinition, self).__init__(kind=kind, **kwargs) + self.unit = None + self.primary_aggregation_type = None + self.metric_availabilities = None + self.resource_uri = None + self.properties = None + + +class ResourceMetricDefinitionCollection(msrest.serialization.Model): + """Collection of metric definitions. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.ResourceMetricDefinition] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceMetricDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ResourceMetricDefinition"], + **kwargs + ): + super(ResourceMetricDefinitionCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ResourceNameAvailability(msrest.serialization.Model): + """Information regarding availability of a resource name. + + :param name_available: :code:`true` indicates name is valid and available. + :code:`false` indicates the name is invalid, unavailable, or both. + :type name_available: bool + :param reason: :code:`Invalid` indicates the name provided does not match Azure + App Service naming requirements. :code:`AlreadyExists` indicates that the name is + already in use and is therefore unavailable. Possible values include: "Invalid", + "AlreadyExists". + :type reason: str or ~azure.mgmt.web.v2020_09_01.models.InAvailabilityReasonType + :param message: If reason == invalid, provide the user with the reason why the given name is + invalid, and provide the resource naming requirements so that the user can select a valid name. + If reason == AlreadyExists, explain that resource name is already in use, and direct them to + select a different name. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + name_available: Optional[bool] = None, + reason: Optional[Union[str, "InAvailabilityReasonType"]] = None, + message: Optional[str] = None, + **kwargs + ): + super(ResourceNameAvailability, self).__init__(**kwargs) + self.name_available = name_available + self.reason = reason + self.message = message + + +class ResourceNameAvailabilityRequest(msrest.serialization.Model): + """Resource name availability request content. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name to verify. + :type name: str + :param type: Required. Resource type used for verification. Possible values include: "Site", + "Slot", "HostingEnvironment", "PublishingUser", "Microsoft.Web/sites", + "Microsoft.Web/sites/slots", "Microsoft.Web/hostingEnvironments", + "Microsoft.Web/publishingUsers". + :type type: str or ~azure.mgmt.web.v2020_09_01.models.CheckNameResourceTypes + :param is_fqdn: Is fully qualified domain name. + :type is_fqdn: bool + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_fqdn': {'key': 'isFqdn', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: str, + type: Union[str, "CheckNameResourceTypes"], + is_fqdn: Optional[bool] = None, + **kwargs + ): + super(ResourceNameAvailabilityRequest, self).__init__(**kwargs) + self.name = name + self.type = type + self.is_fqdn = is_fqdn + + +class ResponseMetaData(msrest.serialization.Model): + """ResponseMetaData. + + :param data_source: Source of the Data. + :type data_source: ~azure.mgmt.web.v2020_09_01.models.DataSource + """ + + _attribute_map = { + 'data_source': {'key': 'dataSource', 'type': 'DataSource'}, + } + + def __init__( + self, + *, + data_source: Optional["DataSource"] = None, + **kwargs + ): + super(ResponseMetaData, self).__init__(**kwargs) + self.data_source = data_source + + +class RestoreRequest(ProxyOnlyResource): + """Description of a restore request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param storage_account_url: SAS URL to the container. + :type storage_account_url: str + :param blob_name: Name of a blob which contains the backup. + :type blob_name: str + :param overwrite: :code:`true` if the restore operation can overwrite target app; + otherwise, :code:`false`. :code:`true` is needed if trying to restore + over an existing app. + :type overwrite: bool + :param site_name: Name of an app. + :type site_name: str + :param databases: Collection of databases which should be restored. This list has to match the + list of databases included in the backup. + :type databases: list[~azure.mgmt.web.v2020_09_01.models.DatabaseBackupSetting] + :param ignore_conflicting_host_names: Changes a logic when restoring an app with custom + domains. :code:`true` to remove custom domains automatically. If + :code:`false`, custom domains are added to + the app's object when it is being restored, but that might fail due to conflicts during the + operation. + :type ignore_conflicting_host_names: bool + :param ignore_databases: Ignore the databases and only restore the site content. + :type ignore_databases: bool + :param app_service_plan: Specify app service plan that will own restored site. + :type app_service_plan: str + :param operation_type: Operation type. Possible values include: "Default", "Clone", + "Relocation", "Snapshot", "CloudFS". Default value: "Default". + :type operation_type: str or ~azure.mgmt.web.v2020_09_01.models.BackupRestoreOperationType + :param adjust_connection_strings: :code:`true` if SiteConfig.ConnectionStrings + should be set in new app; otherwise, :code:`false`. + :type adjust_connection_strings: bool + :param hosting_environment: App Service Environment name, if needed (only when restoring an app + to an App Service Environment). + :type hosting_environment: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'storage_account_url': {'key': 'properties.storageAccountUrl', 'type': 'str'}, + 'blob_name': {'key': 'properties.blobName', 'type': 'str'}, + 'overwrite': {'key': 'properties.overwrite', 'type': 'bool'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'databases': {'key': 'properties.databases', 'type': '[DatabaseBackupSetting]'}, + 'ignore_conflicting_host_names': {'key': 'properties.ignoreConflictingHostNames', 'type': 'bool'}, + 'ignore_databases': {'key': 'properties.ignoreDatabases', 'type': 'bool'}, + 'app_service_plan': {'key': 'properties.appServicePlan', 'type': 'str'}, + 'operation_type': {'key': 'properties.operationType', 'type': 'str'}, + 'adjust_connection_strings': {'key': 'properties.adjustConnectionStrings', 'type': 'bool'}, + 'hosting_environment': {'key': 'properties.hostingEnvironment', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + storage_account_url: Optional[str] = None, + blob_name: Optional[str] = None, + overwrite: Optional[bool] = None, + site_name: Optional[str] = None, + databases: Optional[List["DatabaseBackupSetting"]] = None, + ignore_conflicting_host_names: Optional[bool] = False, + ignore_databases: Optional[bool] = False, + app_service_plan: Optional[str] = None, + operation_type: Optional[Union[str, "BackupRestoreOperationType"]] = "Default", + adjust_connection_strings: Optional[bool] = None, + hosting_environment: Optional[str] = None, + **kwargs + ): + super(RestoreRequest, self).__init__(kind=kind, **kwargs) + self.storage_account_url = storage_account_url + self.blob_name = blob_name + self.overwrite = overwrite + self.site_name = site_name + self.databases = databases + self.ignore_conflicting_host_names = ignore_conflicting_host_names + self.ignore_databases = ignore_databases + self.app_service_plan = app_service_plan + self.operation_type = operation_type + self.adjust_connection_strings = adjust_connection_strings + self.hosting_environment = hosting_environment + + +class ServiceSpecification(msrest.serialization.Model): + """Resource metrics service provided by Microsoft.Insights resource provider. + + :param metric_specifications: + :type metric_specifications: list[~azure.mgmt.web.v2020_09_01.models.MetricSpecification] + :param log_specifications: + :type log_specifications: list[~azure.mgmt.web.v2020_09_01.models.LogSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + } + + def __init__( + self, + *, + metric_specifications: Optional[List["MetricSpecification"]] = None, + log_specifications: Optional[List["LogSpecification"]] = None, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + self.log_specifications = log_specifications + + +class Site(Resource): + """A web app, a mobile app backend, or an API app. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param identity: Managed service identity. + :type identity: ~azure.mgmt.web.v2020_09_01.models.ManagedServiceIdentity + :ivar state: Current state of the app. + :vartype state: str + :ivar host_names: Hostnames associated with the app. + :vartype host_names: list[str] + :ivar repository_site_name: Name of the repository site. + :vartype repository_site_name: str + :ivar usage_state: State indicating whether the app has exceeded its quota usage. Read-only. + Possible values include: "Normal", "Exceeded". + :vartype usage_state: str or ~azure.mgmt.web.v2020_09_01.models.UsageState + :param enabled: :code:`true` if the app is enabled; otherwise, + :code:`false`. Setting this value to false disables the app (takes the app + offline). + :type enabled: bool + :ivar enabled_host_names: Enabled hostnames for the app.Hostnames need to be assigned (see + HostNames) AND enabled. Otherwise, + the app is not served on those hostnames. + :vartype enabled_host_names: list[str] + :ivar availability_state: Management information availability state for the app. Possible + values include: "Normal", "Limited", "DisasterRecoveryMode". + :vartype availability_state: str or ~azure.mgmt.web.v2020_09_01.models.SiteAvailabilityState + :param host_name_ssl_states: Hostname SSL states are used to manage the SSL bindings for app's + hostnames. + :type host_name_ssl_states: list[~azure.mgmt.web.v2020_09_01.models.HostNameSslState] + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param reserved: :code:`true` if reserved; otherwise, :code:`false`. + :type reserved: bool + :param is_xenon: Obsolete: Hyper-V sandbox. + :type is_xenon: bool + :param hyper_v: Hyper-V sandbox. + :type hyper_v: bool + :ivar last_modified_time_utc: Last time the app was modified, in UTC. Read-only. + :vartype last_modified_time_utc: ~datetime.datetime + :param site_config: Configuration of the app. + :type site_config: ~azure.mgmt.web.v2020_09_01.models.SiteConfig + :ivar traffic_manager_host_names: Azure Traffic Manager hostnames associated with the app. + Read-only. + :vartype traffic_manager_host_names: list[str] + :param scm_site_also_stopped: :code:`true` to stop SCM (KUDU) site when the app is + stopped; otherwise, :code:`false`. The default is :code:`false`. + :type scm_site_also_stopped: bool + :ivar target_swap_slot: Specifies which deployment slot this app will swap into. Read-only. + :vartype target_swap_slot: str + :param hosting_environment_profile: App Service Environment to use for the app. + :type hosting_environment_profile: ~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentProfile + :param client_affinity_enabled: :code:`true` to enable client affinity; + :code:`false` to stop sending session affinity cookies, which route client + requests in the same session to the same instance. Default is :code:`true`. + :type client_affinity_enabled: bool + :param client_cert_enabled: :code:`true` to enable client certificate + authentication (TLS mutual authentication); otherwise, :code:`false`. Default is + :code:`false`. + :type client_cert_enabled: bool + :param client_cert_mode: This composes with ClientCertEnabled setting. + + + * ClientCertEnabled: false means ClientCert is ignored. + * ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + * ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or + accepted. Possible values include: "Required", "Optional". + :type client_cert_mode: str or ~azure.mgmt.web.v2020_09_01.models.ClientCertMode + :param client_cert_exclusion_paths: client certificate authentication comma-separated exclusion + paths. + :type client_cert_exclusion_paths: str + :param host_names_disabled: :code:`true` to disable the public hostnames of the + app; otherwise, :code:`false`. + If :code:`true`, the app is only accessible via API management process. + :type host_names_disabled: bool + :param custom_domain_verification_id: Unique identifier that verifies the custom domains + assigned to the app. Customer will add this id to a txt record for verification. + :type custom_domain_verification_id: str + :ivar outbound_ip_addresses: List of IP addresses that the app uses for outbound connections + (e.g. database access). Includes VIPs from tenants that site can be hosted with current + settings. Read-only. + :vartype outbound_ip_addresses: str + :ivar possible_outbound_ip_addresses: List of IP addresses that the app uses for outbound + connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read- + only. + :vartype possible_outbound_ip_addresses: str + :param container_size: Size of the function container. + :type container_size: int + :param daily_memory_time_quota: Maximum allowed daily memory-time quota (applicable on dynamic + apps only). + :type daily_memory_time_quota: int + :ivar suspended_till: App suspended till in case memory-time quota is exceeded. + :vartype suspended_till: ~datetime.datetime + :ivar max_number_of_workers: Maximum number of workers. + This only applies to Functions container. + :vartype max_number_of_workers: int + :param cloning_info: If specified during app creation, the app is cloned from a source app. + :type cloning_info: ~azure.mgmt.web.v2020_09_01.models.CloningInfo + :ivar resource_group: Name of the resource group the app belongs to. Read-only. + :vartype resource_group: str + :ivar is_default_container: :code:`true` if the app is a default container; + otherwise, :code:`false`. + :vartype is_default_container: bool + :ivar default_host_name: Default hostname of the app. Read-only. + :vartype default_host_name: str + :ivar slot_swap_status: Status of the last deployment slot swap operation. + :vartype slot_swap_status: ~azure.mgmt.web.v2020_09_01.models.SlotSwapStatus + :param https_only: HttpsOnly: configures a web site to accept only https requests. Issues + redirect for + http requests. + :type https_only: bool + :param redundancy_mode: Site redundancy mode. Possible values include: "None", "Manual", + "Failover", "ActiveActive", "GeoRedundant". + :type redundancy_mode: str or ~azure.mgmt.web.v2020_09_01.models.RedundancyMode + :ivar in_progress_operation_id: Specifies an operation id if this site has a pending operation. + :vartype in_progress_operation_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'state': {'readonly': True}, + 'host_names': {'readonly': True}, + 'repository_site_name': {'readonly': True}, + 'usage_state': {'readonly': True}, + 'enabled_host_names': {'readonly': True}, + 'availability_state': {'readonly': True}, + 'last_modified_time_utc': {'readonly': True}, + 'traffic_manager_host_names': {'readonly': True}, + 'target_swap_slot': {'readonly': True}, + 'outbound_ip_addresses': {'readonly': True}, + 'possible_outbound_ip_addresses': {'readonly': True}, + 'suspended_till': {'readonly': True}, + 'max_number_of_workers': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'is_default_container': {'readonly': True}, + 'default_host_name': {'readonly': True}, + 'slot_swap_status': {'readonly': True}, + 'in_progress_operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'repository_site_name': {'key': 'properties.repositorySiteName', 'type': 'str'}, + 'usage_state': {'key': 'properties.usageState', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'enabled_host_names': {'key': 'properties.enabledHostNames', 'type': '[str]'}, + 'availability_state': {'key': 'properties.availabilityState', 'type': 'str'}, + 'host_name_ssl_states': {'key': 'properties.hostNameSslStates', 'type': '[HostNameSslState]'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'last_modified_time_utc': {'key': 'properties.lastModifiedTimeUtc', 'type': 'iso-8601'}, + 'site_config': {'key': 'properties.siteConfig', 'type': 'SiteConfig'}, + 'traffic_manager_host_names': {'key': 'properties.trafficManagerHostNames', 'type': '[str]'}, + 'scm_site_also_stopped': {'key': 'properties.scmSiteAlsoStopped', 'type': 'bool'}, + 'target_swap_slot': {'key': 'properties.targetSwapSlot', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'client_affinity_enabled': {'key': 'properties.clientAffinityEnabled', 'type': 'bool'}, + 'client_cert_enabled': {'key': 'properties.clientCertEnabled', 'type': 'bool'}, + 'client_cert_mode': {'key': 'properties.clientCertMode', 'type': 'str'}, + 'client_cert_exclusion_paths': {'key': 'properties.clientCertExclusionPaths', 'type': 'str'}, + 'host_names_disabled': {'key': 'properties.hostNamesDisabled', 'type': 'bool'}, + 'custom_domain_verification_id': {'key': 'properties.customDomainVerificationId', 'type': 'str'}, + 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': 'str'}, + 'possible_outbound_ip_addresses': {'key': 'properties.possibleOutboundIpAddresses', 'type': 'str'}, + 'container_size': {'key': 'properties.containerSize', 'type': 'int'}, + 'daily_memory_time_quota': {'key': 'properties.dailyMemoryTimeQuota', 'type': 'int'}, + 'suspended_till': {'key': 'properties.suspendedTill', 'type': 'iso-8601'}, + 'max_number_of_workers': {'key': 'properties.maxNumberOfWorkers', 'type': 'int'}, + 'cloning_info': {'key': 'properties.cloningInfo', 'type': 'CloningInfo'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'is_default_container': {'key': 'properties.isDefaultContainer', 'type': 'bool'}, + 'default_host_name': {'key': 'properties.defaultHostName', 'type': 'str'}, + 'slot_swap_status': {'key': 'properties.slotSwapStatus', 'type': 'SlotSwapStatus'}, + 'https_only': {'key': 'properties.httpsOnly', 'type': 'bool'}, + 'redundancy_mode': {'key': 'properties.redundancyMode', 'type': 'str'}, + 'in_progress_operation_id': {'key': 'properties.inProgressOperationId', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, + enabled: Optional[bool] = None, + host_name_ssl_states: Optional[List["HostNameSslState"]] = None, + server_farm_id: Optional[str] = None, + reserved: Optional[bool] = False, + is_xenon: Optional[bool] = False, + hyper_v: Optional[bool] = False, + site_config: Optional["SiteConfig"] = None, + scm_site_also_stopped: Optional[bool] = False, + hosting_environment_profile: Optional["HostingEnvironmentProfile"] = None, + client_affinity_enabled: Optional[bool] = None, + client_cert_enabled: Optional[bool] = None, + client_cert_mode: Optional[Union[str, "ClientCertMode"]] = None, + client_cert_exclusion_paths: Optional[str] = None, + host_names_disabled: Optional[bool] = None, + custom_domain_verification_id: Optional[str] = None, + container_size: Optional[int] = None, + daily_memory_time_quota: Optional[int] = None, + cloning_info: Optional["CloningInfo"] = None, + https_only: Optional[bool] = None, + redundancy_mode: Optional[Union[str, "RedundancyMode"]] = None, + **kwargs + ): + super(Site, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.identity = identity + self.state = None + self.host_names = None + self.repository_site_name = None + self.usage_state = None + self.enabled = enabled + self.enabled_host_names = None + self.availability_state = None + self.host_name_ssl_states = host_name_ssl_states + self.server_farm_id = server_farm_id + self.reserved = reserved + self.is_xenon = is_xenon + self.hyper_v = hyper_v + self.last_modified_time_utc = None + self.site_config = site_config + self.traffic_manager_host_names = None + self.scm_site_also_stopped = scm_site_also_stopped + self.target_swap_slot = None + self.hosting_environment_profile = hosting_environment_profile + self.client_affinity_enabled = client_affinity_enabled + self.client_cert_enabled = client_cert_enabled + self.client_cert_mode = client_cert_mode + self.client_cert_exclusion_paths = client_cert_exclusion_paths + self.host_names_disabled = host_names_disabled + self.custom_domain_verification_id = custom_domain_verification_id + self.outbound_ip_addresses = None + self.possible_outbound_ip_addresses = None + self.container_size = container_size + self.daily_memory_time_quota = daily_memory_time_quota + self.suspended_till = None + self.max_number_of_workers = None + self.cloning_info = cloning_info + self.resource_group = None + self.is_default_container = None + self.default_host_name = None + self.slot_swap_status = None + self.https_only = https_only + self.redundancy_mode = redundancy_mode + self.in_progress_operation_id = None + + +class SiteAuthSettings(ProxyOnlyResource): + """Configuration settings for the Azure App Service Authentication / Authorization feature. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param enabled: :code:`true` if the Authentication / Authorization feature is + enabled for the current app; otherwise, :code:`false`. + :type enabled: bool + :param runtime_version: The RuntimeVersion of the Authentication / Authorization feature in use + for the current app. + The setting in this value can control the behavior of certain features in the Authentication / + Authorization module. + :type runtime_version: str + :param unauthenticated_client_action: The action to take when an unauthenticated client + attempts to access the app. Possible values include: "RedirectToLoginPage", "AllowAnonymous". + :type unauthenticated_client_action: str or + ~azure.mgmt.web.v2020_09_01.models.UnauthenticatedClientAction + :param token_store_enabled: :code:`true` to durably store platform-specific + security tokens that are obtained during login flows; otherwise, :code:`false`. + The default is :code:`false`. + :type token_store_enabled: bool + :param allowed_external_redirect_urls: External URLs that can be redirected to as part of + logging in or logging out of the app. Note that the query string part of the URL is ignored. + This is an advanced setting typically only needed by Windows Store application backends. + Note that URLs within the current domain are always implicitly allowed. + :type allowed_external_redirect_urls: list[str] + :param default_provider: The default authentication provider to use when multiple providers are + configured. + This setting is only needed if multiple providers are configured and the unauthenticated + client + action is set to "RedirectToLoginPage". Possible values include: "AzureActiveDirectory", + "Facebook", "Google", "MicrosoftAccount", "Twitter", "Github". + :type default_provider: str or ~azure.mgmt.web.v2020_09_01.models.BuiltInAuthenticationProvider + :param token_refresh_extension_hours: The number of hours after session token expiration that a + session token can be used to + call the token refresh API. The default is 72 hours. + :type token_refresh_extension_hours: float + :param client_id: The Client ID of this relying party application, known as the client_id. + This setting is required for enabling OpenID Connection authentication with Azure Active + Directory or + other 3rd party OpenID Connect providers. + More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. + :type client_id: str + :param client_secret: The Client Secret of this relying party application (in Azure Active + Directory, this is also referred to as the Key). + This setting is optional. If no client secret is configured, the OpenID Connect implicit auth + flow is used to authenticate end users. + Otherwise, the OpenID Connect Authorization Code Flow is used to authenticate end users. + More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. + :type client_secret: str + :param client_secret_setting_name: The app setting name that contains the client secret of the + relying party application. + :type client_secret_setting_name: str + :param client_secret_certificate_thumbprint: An alternative to the client secret, that is the + thumbprint of a certificate used for signing purposes. This property acts as + a replacement for the Client Secret. It is also optional. + :type client_secret_certificate_thumbprint: str + :param issuer: The OpenID Connect Issuer URI that represents the entity which issues access + tokens for this application. + When using Azure Active Directory, this value is the URI of the directory tenant, e.g. + https://sts.windows.net/{tenant-guid}/. + This URI is a case-sensitive identifier for the token issuer. + More information on OpenID Connect Discovery: http://openid.net/specs/openid-connect- + discovery-1_0.html. + :type issuer: str + :param validate_issuer: Gets a value indicating whether the issuer should be a valid HTTPS url + and be validated as such. + :type validate_issuer: bool + :param allowed_audiences: Allowed audience values to consider when validating JWTs issued by + Azure Active Directory. Note that the :code:`ClientID` value is always considered + an + allowed audience, regardless of this setting. + :type allowed_audiences: list[str] + :param additional_login_params: Login parameters to send to the OpenID Connect authorization + endpoint when + a user logs in. Each parameter must be in the form "key=value". + :type additional_login_params: list[str] + :param aad_claims_authorization: Gets a JSON string containing the Azure AD Acl settings. + :type aad_claims_authorization: str + :param google_client_id: The OpenID Connect Client ID for the Google web application. + This setting is required for enabling Google Sign-In. + Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + :type google_client_id: str + :param google_client_secret: The client secret associated with the Google web application. + This setting is required for enabling Google Sign-In. + Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + :type google_client_secret: str + :param google_client_secret_setting_name: The app setting name that contains the client secret + associated with + the Google web application. + :type google_client_secret_setting_name: str + :param google_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of Google + Sign-In authentication. + This setting is optional. If not specified, "openid", "profile", and "email" are used as + default scopes. + Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + :type google_o_auth_scopes: list[str] + :param facebook_app_id: The App ID of the Facebook app used for login. + This setting is required for enabling Facebook Login. + Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + :type facebook_app_id: str + :param facebook_app_secret: The App Secret of the Facebook app used for Facebook Login. + This setting is required for enabling Facebook Login. + Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + :type facebook_app_secret: str + :param facebook_app_secret_setting_name: The app setting name that contains the app secret used + for Facebook Login. + :type facebook_app_secret_setting_name: str + :param facebook_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of Facebook + Login authentication. + This setting is optional. + Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + :type facebook_o_auth_scopes: list[str] + :param git_hub_client_id: The Client Id of the GitHub app used for login. + This setting is required for enabling Github login. + :type git_hub_client_id: str + :param git_hub_client_secret: The Client Secret of the GitHub app used for Github Login. + This setting is required for enabling Github login. + :type git_hub_client_secret: str + :param git_hub_client_secret_setting_name: The app setting name that contains the client secret + of the Github + app used for GitHub Login. + :type git_hub_client_secret_setting_name: str + :param git_hub_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of GitHub + Login authentication. + This setting is optional. + :type git_hub_o_auth_scopes: list[str] + :param twitter_consumer_key: The OAuth 1.0a consumer key of the Twitter application used for + sign-in. + This setting is required for enabling Twitter Sign-In. + Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. + :type twitter_consumer_key: str + :param twitter_consumer_secret: The OAuth 1.0a consumer secret of the Twitter application used + for sign-in. + This setting is required for enabling Twitter Sign-In. + Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. + :type twitter_consumer_secret: str + :param twitter_consumer_secret_setting_name: The app setting name that contains the OAuth 1.0a + consumer secret of the Twitter + application used for sign-in. + :type twitter_consumer_secret_setting_name: str + :param microsoft_account_client_id: The OAuth 2.0 client ID that was created for the app used + for authentication. + This setting is required for enabling Microsoft Account authentication. + Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm. + :type microsoft_account_client_id: str + :param microsoft_account_client_secret: The OAuth 2.0 client secret that was created for the + app used for authentication. + This setting is required for enabling Microsoft Account authentication. + Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm. + :type microsoft_account_client_secret: str + :param microsoft_account_client_secret_setting_name: The app setting name containing the OAuth + 2.0 client secret that was created for the + app used for authentication. + :type microsoft_account_client_secret_setting_name: str + :param microsoft_account_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of + Microsoft Account authentication. + This setting is optional. If not specified, "wl.basic" is used as the default scope. + Microsoft Account Scopes and permissions documentation: https://msdn.microsoft.com/en- + us/library/dn631845.aspx. + :type microsoft_account_o_auth_scopes: list[str] + :param is_auth_from_file: "true" if the auth config settings should be read from a file, + "false" otherwise. + :type is_auth_from_file: str + :param auth_file_path: The path of the config file containing auth settings. + If the path is relative, base will the site's root directory. + :type auth_file_path: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'runtime_version': {'key': 'properties.runtimeVersion', 'type': 'str'}, + 'unauthenticated_client_action': {'key': 'properties.unauthenticatedClientAction', 'type': 'str'}, + 'token_store_enabled': {'key': 'properties.tokenStoreEnabled', 'type': 'bool'}, + 'allowed_external_redirect_urls': {'key': 'properties.allowedExternalRedirectUrls', 'type': '[str]'}, + 'default_provider': {'key': 'properties.defaultProvider', 'type': 'str'}, + 'token_refresh_extension_hours': {'key': 'properties.tokenRefreshExtensionHours', 'type': 'float'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_secret_certificate_thumbprint': {'key': 'properties.clientSecretCertificateThumbprint', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'validate_issuer': {'key': 'properties.validateIssuer', 'type': 'bool'}, + 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + 'additional_login_params': {'key': 'properties.additionalLoginParams', 'type': '[str]'}, + 'aad_claims_authorization': {'key': 'properties.aadClaimsAuthorization', 'type': 'str'}, + 'google_client_id': {'key': 'properties.googleClientId', 'type': 'str'}, + 'google_client_secret': {'key': 'properties.googleClientSecret', 'type': 'str'}, + 'google_client_secret_setting_name': {'key': 'properties.googleClientSecretSettingName', 'type': 'str'}, + 'google_o_auth_scopes': {'key': 'properties.googleOAuthScopes', 'type': '[str]'}, + 'facebook_app_id': {'key': 'properties.facebookAppId', 'type': 'str'}, + 'facebook_app_secret': {'key': 'properties.facebookAppSecret', 'type': 'str'}, + 'facebook_app_secret_setting_name': {'key': 'properties.facebookAppSecretSettingName', 'type': 'str'}, + 'facebook_o_auth_scopes': {'key': 'properties.facebookOAuthScopes', 'type': '[str]'}, + 'git_hub_client_id': {'key': 'properties.gitHubClientId', 'type': 'str'}, + 'git_hub_client_secret': {'key': 'properties.gitHubClientSecret', 'type': 'str'}, + 'git_hub_client_secret_setting_name': {'key': 'properties.gitHubClientSecretSettingName', 'type': 'str'}, + 'git_hub_o_auth_scopes': {'key': 'properties.gitHubOAuthScopes', 'type': '[str]'}, + 'twitter_consumer_key': {'key': 'properties.twitterConsumerKey', 'type': 'str'}, + 'twitter_consumer_secret': {'key': 'properties.twitterConsumerSecret', 'type': 'str'}, + 'twitter_consumer_secret_setting_name': {'key': 'properties.twitterConsumerSecretSettingName', 'type': 'str'}, + 'microsoft_account_client_id': {'key': 'properties.microsoftAccountClientId', 'type': 'str'}, + 'microsoft_account_client_secret': {'key': 'properties.microsoftAccountClientSecret', 'type': 'str'}, + 'microsoft_account_client_secret_setting_name': {'key': 'properties.microsoftAccountClientSecretSettingName', 'type': 'str'}, + 'microsoft_account_o_auth_scopes': {'key': 'properties.microsoftAccountOAuthScopes', 'type': '[str]'}, + 'is_auth_from_file': {'key': 'properties.isAuthFromFile', 'type': 'str'}, + 'auth_file_path': {'key': 'properties.authFilePath', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + runtime_version: Optional[str] = None, + unauthenticated_client_action: Optional[Union[str, "UnauthenticatedClientAction"]] = None, + token_store_enabled: Optional[bool] = None, + allowed_external_redirect_urls: Optional[List[str]] = None, + default_provider: Optional[Union[str, "BuiltInAuthenticationProvider"]] = None, + token_refresh_extension_hours: Optional[float] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + client_secret_setting_name: Optional[str] = None, + client_secret_certificate_thumbprint: Optional[str] = None, + issuer: Optional[str] = None, + validate_issuer: Optional[bool] = None, + allowed_audiences: Optional[List[str]] = None, + additional_login_params: Optional[List[str]] = None, + aad_claims_authorization: Optional[str] = None, + google_client_id: Optional[str] = None, + google_client_secret: Optional[str] = None, + google_client_secret_setting_name: Optional[str] = None, + google_o_auth_scopes: Optional[List[str]] = None, + facebook_app_id: Optional[str] = None, + facebook_app_secret: Optional[str] = None, + facebook_app_secret_setting_name: Optional[str] = None, + facebook_o_auth_scopes: Optional[List[str]] = None, + git_hub_client_id: Optional[str] = None, + git_hub_client_secret: Optional[str] = None, + git_hub_client_secret_setting_name: Optional[str] = None, + git_hub_o_auth_scopes: Optional[List[str]] = None, + twitter_consumer_key: Optional[str] = None, + twitter_consumer_secret: Optional[str] = None, + twitter_consumer_secret_setting_name: Optional[str] = None, + microsoft_account_client_id: Optional[str] = None, + microsoft_account_client_secret: Optional[str] = None, + microsoft_account_client_secret_setting_name: Optional[str] = None, + microsoft_account_o_auth_scopes: Optional[List[str]] = None, + is_auth_from_file: Optional[str] = None, + auth_file_path: Optional[str] = None, + **kwargs + ): + super(SiteAuthSettings, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.runtime_version = runtime_version + self.unauthenticated_client_action = unauthenticated_client_action + self.token_store_enabled = token_store_enabled + self.allowed_external_redirect_urls = allowed_external_redirect_urls + self.default_provider = default_provider + self.token_refresh_extension_hours = token_refresh_extension_hours + self.client_id = client_id + self.client_secret = client_secret + self.client_secret_setting_name = client_secret_setting_name + self.client_secret_certificate_thumbprint = client_secret_certificate_thumbprint + self.issuer = issuer + self.validate_issuer = validate_issuer + self.allowed_audiences = allowed_audiences + self.additional_login_params = additional_login_params + self.aad_claims_authorization = aad_claims_authorization + self.google_client_id = google_client_id + self.google_client_secret = google_client_secret + self.google_client_secret_setting_name = google_client_secret_setting_name + self.google_o_auth_scopes = google_o_auth_scopes + self.facebook_app_id = facebook_app_id + self.facebook_app_secret = facebook_app_secret + self.facebook_app_secret_setting_name = facebook_app_secret_setting_name + self.facebook_o_auth_scopes = facebook_o_auth_scopes + self.git_hub_client_id = git_hub_client_id + self.git_hub_client_secret = git_hub_client_secret + self.git_hub_client_secret_setting_name = git_hub_client_secret_setting_name + self.git_hub_o_auth_scopes = git_hub_o_auth_scopes + self.twitter_consumer_key = twitter_consumer_key + self.twitter_consumer_secret = twitter_consumer_secret + self.twitter_consumer_secret_setting_name = twitter_consumer_secret_setting_name + self.microsoft_account_client_id = microsoft_account_client_id + self.microsoft_account_client_secret = microsoft_account_client_secret + self.microsoft_account_client_secret_setting_name = microsoft_account_client_secret_setting_name + self.microsoft_account_o_auth_scopes = microsoft_account_o_auth_scopes + self.is_auth_from_file = is_auth_from_file + self.auth_file_path = auth_file_path + + +class SiteAuthSettingsV2(ProxyOnlyResource): + """SiteAuthSettingsV2. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param platform: + :type platform: ~azure.mgmt.web.v2020_09_01.models.AuthPlatform + :param global_validation: + :type global_validation: ~azure.mgmt.web.v2020_09_01.models.GlobalValidation + :param identity_providers: + :type identity_providers: ~azure.mgmt.web.v2020_09_01.models.IdentityProviders + :param login: + :type login: ~azure.mgmt.web.v2020_09_01.models.Login + :param http_settings: + :type http_settings: ~azure.mgmt.web.v2020_09_01.models.HttpSettings + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'platform': {'key': 'properties.platform', 'type': 'AuthPlatform'}, + 'global_validation': {'key': 'properties.globalValidation', 'type': 'GlobalValidation'}, + 'identity_providers': {'key': 'properties.identityProviders', 'type': 'IdentityProviders'}, + 'login': {'key': 'properties.login', 'type': 'Login'}, + 'http_settings': {'key': 'properties.httpSettings', 'type': 'HttpSettings'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + platform: Optional["AuthPlatform"] = None, + global_validation: Optional["GlobalValidation"] = None, + identity_providers: Optional["IdentityProviders"] = None, + login: Optional["Login"] = None, + http_settings: Optional["HttpSettings"] = None, + **kwargs + ): + super(SiteAuthSettingsV2, self).__init__(kind=kind, **kwargs) + self.platform = platform + self.global_validation = global_validation + self.identity_providers = identity_providers + self.login = login + self.http_settings = http_settings + + +class SiteCloneability(msrest.serialization.Model): + """Represents whether or not an app is cloneable. + + :param result: Name of app. Possible values include: "Cloneable", "PartiallyCloneable", + "NotCloneable". + :type result: str or ~azure.mgmt.web.v2020_09_01.models.CloneAbilityResult + :param blocking_features: List of features enabled on app that prevent cloning. + :type blocking_features: list[~azure.mgmt.web.v2020_09_01.models.SiteCloneabilityCriterion] + :param unsupported_features: List of features enabled on app that are non-blocking but cannot + be cloned. The app can still be cloned + but the features in this list will not be set up on cloned app. + :type unsupported_features: list[~azure.mgmt.web.v2020_09_01.models.SiteCloneabilityCriterion] + :param blocking_characteristics: List of blocking application characteristics. + :type blocking_characteristics: + list[~azure.mgmt.web.v2020_09_01.models.SiteCloneabilityCriterion] + """ + + _attribute_map = { + 'result': {'key': 'result', 'type': 'str'}, + 'blocking_features': {'key': 'blockingFeatures', 'type': '[SiteCloneabilityCriterion]'}, + 'unsupported_features': {'key': 'unsupportedFeatures', 'type': '[SiteCloneabilityCriterion]'}, + 'blocking_characteristics': {'key': 'blockingCharacteristics', 'type': '[SiteCloneabilityCriterion]'}, + } + + def __init__( + self, + *, + result: Optional[Union[str, "CloneAbilityResult"]] = None, + blocking_features: Optional[List["SiteCloneabilityCriterion"]] = None, + unsupported_features: Optional[List["SiteCloneabilityCriterion"]] = None, + blocking_characteristics: Optional[List["SiteCloneabilityCriterion"]] = None, + **kwargs + ): + super(SiteCloneability, self).__init__(**kwargs) + self.result = result + self.blocking_features = blocking_features + self.unsupported_features = unsupported_features + self.blocking_characteristics = blocking_characteristics + + +class SiteCloneabilityCriterion(msrest.serialization.Model): + """An app cloneability criterion. + + :param name: Name of criterion. + :type name: str + :param description: Description of criterion. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(SiteCloneabilityCriterion, self).__init__(**kwargs) + self.name = name + self.description = description + + +class SiteConfig(msrest.serialization.Model): + """Configuration of an App Service app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param number_of_workers: Number of workers. + :type number_of_workers: int + :param default_documents: Default documents. + :type default_documents: list[str] + :param net_framework_version: .NET Framework version. + :type net_framework_version: str + :param php_version: Version of PHP. + :type php_version: str + :param python_version: Version of Python. + :type python_version: str + :param node_version: Version of Node.js. + :type node_version: str + :param power_shell_version: Version of PowerShell. + :type power_shell_version: str + :param linux_fx_version: Linux App Framework and version. + :type linux_fx_version: str + :param windows_fx_version: Xenon App Framework and version. + :type windows_fx_version: str + :param request_tracing_enabled: :code:`true` if request tracing is enabled; + otherwise, :code:`false`. + :type request_tracing_enabled: bool + :param request_tracing_expiration_time: Request tracing expiration time. + :type request_tracing_expiration_time: ~datetime.datetime + :param remote_debugging_enabled: :code:`true` if remote debugging is enabled; + otherwise, :code:`false`. + :type remote_debugging_enabled: bool + :param remote_debugging_version: Remote debugging version. + :type remote_debugging_version: str + :param http_logging_enabled: :code:`true` if HTTP logging is enabled; otherwise, + :code:`false`. + :type http_logging_enabled: bool + :param logs_directory_size_limit: HTTP logs directory size limit. + :type logs_directory_size_limit: int + :param detailed_error_logging_enabled: :code:`true` if detailed error logging is + enabled; otherwise, :code:`false`. + :type detailed_error_logging_enabled: bool + :param publishing_username: Publishing user name. + :type publishing_username: str + :param app_settings: Application settings. + :type app_settings: list[~azure.mgmt.web.v2020_09_01.models.NameValuePair] + :param connection_strings: Connection strings. + :type connection_strings: list[~azure.mgmt.web.v2020_09_01.models.ConnStringInfo] + :ivar machine_key: Site MachineKey. + :vartype machine_key: ~azure.mgmt.web.v2020_09_01.models.SiteMachineKey + :param handler_mappings: Handler mappings. + :type handler_mappings: list[~azure.mgmt.web.v2020_09_01.models.HandlerMapping] + :param document_root: Document root. + :type document_root: str + :param scm_type: SCM type. Possible values include: "None", "Dropbox", "Tfs", "LocalGit", + "GitHub", "CodePlexGit", "CodePlexHg", "BitbucketGit", "BitbucketHg", "ExternalGit", + "ExternalHg", "OneDrive", "VSO", "VSTSRM". + :type scm_type: str or ~azure.mgmt.web.v2020_09_01.models.ScmType + :param use32_bit_worker_process: :code:`true` to use 32-bit worker process; + otherwise, :code:`false`. + :type use32_bit_worker_process: bool + :param web_sockets_enabled: :code:`true` if WebSocket is enabled; otherwise, + :code:`false`. + :type web_sockets_enabled: bool + :param always_on: :code:`true` if Always On is enabled; otherwise, + :code:`false`. + :type always_on: bool + :param java_version: Java version. + :type java_version: str + :param java_container: Java container. + :type java_container: str + :param java_container_version: Java container version. + :type java_container_version: str + :param app_command_line: App command line to launch. + :type app_command_line: str + :param managed_pipeline_mode: Managed pipeline mode. Possible values include: "Integrated", + "Classic". + :type managed_pipeline_mode: str or ~azure.mgmt.web.v2020_09_01.models.ManagedPipelineMode + :param virtual_applications: Virtual applications. + :type virtual_applications: list[~azure.mgmt.web.v2020_09_01.models.VirtualApplication] + :param load_balancing: Site load balancing. Possible values include: "WeightedRoundRobin", + "LeastRequests", "LeastResponseTime", "WeightedTotalTraffic", "RequestHash". + :type load_balancing: str or ~azure.mgmt.web.v2020_09_01.models.SiteLoadBalancing + :param experiments: This is work around for polymorphic types. + :type experiments: ~azure.mgmt.web.v2020_09_01.models.Experiments + :param limits: Site limits. + :type limits: ~azure.mgmt.web.v2020_09_01.models.SiteLimits + :param auto_heal_enabled: :code:`true` if Auto Heal is enabled; otherwise, + :code:`false`. + :type auto_heal_enabled: bool + :param auto_heal_rules: Auto Heal rules. + :type auto_heal_rules: ~azure.mgmt.web.v2020_09_01.models.AutoHealRules + :param tracing_options: Tracing options. + :type tracing_options: str + :param vnet_name: Virtual Network name. + :type vnet_name: str + :param vnet_route_all_enabled: Virtual Network Route All enabled. This causes all outbound + traffic to have Virtual Network Security Groups and User Defined Routes applied. + :type vnet_route_all_enabled: bool + :param vnet_private_ports_count: The number of private ports assigned to this app. These will + be assigned dynamically on runtime. + :type vnet_private_ports_count: int + :param cors: Cross-Origin Resource Sharing (CORS) settings. + :type cors: ~azure.mgmt.web.v2020_09_01.models.CorsSettings + :param push: Push endpoint settings. + :type push: ~azure.mgmt.web.v2020_09_01.models.PushSettings + :param api_definition: Information about the formal API definition for the app. + :type api_definition: ~azure.mgmt.web.v2020_09_01.models.ApiDefinitionInfo + :param api_management_config: Azure API management settings linked to the app. + :type api_management_config: ~azure.mgmt.web.v2020_09_01.models.ApiManagementConfig + :param auto_swap_slot_name: Auto-swap slot name. + :type auto_swap_slot_name: str + :param local_my_sql_enabled: :code:`true` to enable local MySQL; otherwise, + :code:`false`. + :type local_my_sql_enabled: bool + :param managed_service_identity_id: Managed Service Identity Id. + :type managed_service_identity_id: int + :param x_managed_service_identity_id: Explicit Managed Service Identity Id. + :type x_managed_service_identity_id: int + :param ip_security_restrictions: IP security restrictions for main. + :type ip_security_restrictions: list[~azure.mgmt.web.v2020_09_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions: IP security restrictions for scm. + :type scm_ip_security_restrictions: + list[~azure.mgmt.web.v2020_09_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions_use_main: IP security restrictions for scm to use main. + :type scm_ip_security_restrictions_use_main: bool + :param http20_enabled: Http20Enabled: configures a web site to allow clients to connect over + http2.0. + :type http20_enabled: bool + :param min_tls_version: MinTlsVersion: configures the minimum version of TLS required for SSL + requests. Possible values include: "1.0", "1.1", "1.2". + :type min_tls_version: str or ~azure.mgmt.web.v2020_09_01.models.SupportedTlsVersions + :param scm_min_tls_version: ScmMinTlsVersion: configures the minimum version of TLS required + for SSL requests for SCM site. Possible values include: "1.0", "1.1", "1.2". + :type scm_min_tls_version: str or ~azure.mgmt.web.v2020_09_01.models.SupportedTlsVersions + :param ftps_state: State of FTP / FTPS service. Possible values include: "AllAllowed", + "FtpsOnly", "Disabled". + :type ftps_state: str or ~azure.mgmt.web.v2020_09_01.models.FtpsState + :param pre_warmed_instance_count: Number of preWarmed instances. + This setting only applies to the Consumption and Elastic Plans. + :type pre_warmed_instance_count: int + :param health_check_path: Health check path. + :type health_check_path: str + """ + + _validation = { + 'machine_key': {'readonly': True}, + 'pre_warmed_instance_count': {'maximum': 10, 'minimum': 0}, + } + + _attribute_map = { + 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, + 'default_documents': {'key': 'defaultDocuments', 'type': '[str]'}, + 'net_framework_version': {'key': 'netFrameworkVersion', 'type': 'str'}, + 'php_version': {'key': 'phpVersion', 'type': 'str'}, + 'python_version': {'key': 'pythonVersion', 'type': 'str'}, + 'node_version': {'key': 'nodeVersion', 'type': 'str'}, + 'power_shell_version': {'key': 'powerShellVersion', 'type': 'str'}, + 'linux_fx_version': {'key': 'linuxFxVersion', 'type': 'str'}, + 'windows_fx_version': {'key': 'windowsFxVersion', 'type': 'str'}, + 'request_tracing_enabled': {'key': 'requestTracingEnabled', 'type': 'bool'}, + 'request_tracing_expiration_time': {'key': 'requestTracingExpirationTime', 'type': 'iso-8601'}, + 'remote_debugging_enabled': {'key': 'remoteDebuggingEnabled', 'type': 'bool'}, + 'remote_debugging_version': {'key': 'remoteDebuggingVersion', 'type': 'str'}, + 'http_logging_enabled': {'key': 'httpLoggingEnabled', 'type': 'bool'}, + 'logs_directory_size_limit': {'key': 'logsDirectorySizeLimit', 'type': 'int'}, + 'detailed_error_logging_enabled': {'key': 'detailedErrorLoggingEnabled', 'type': 'bool'}, + 'publishing_username': {'key': 'publishingUsername', 'type': 'str'}, + 'app_settings': {'key': 'appSettings', 'type': '[NameValuePair]'}, + 'connection_strings': {'key': 'connectionStrings', 'type': '[ConnStringInfo]'}, + 'machine_key': {'key': 'machineKey', 'type': 'SiteMachineKey'}, + 'handler_mappings': {'key': 'handlerMappings', 'type': '[HandlerMapping]'}, + 'document_root': {'key': 'documentRoot', 'type': 'str'}, + 'scm_type': {'key': 'scmType', 'type': 'str'}, + 'use32_bit_worker_process': {'key': 'use32BitWorkerProcess', 'type': 'bool'}, + 'web_sockets_enabled': {'key': 'webSocketsEnabled', 'type': 'bool'}, + 'always_on': {'key': 'alwaysOn', 'type': 'bool'}, + 'java_version': {'key': 'javaVersion', 'type': 'str'}, + 'java_container': {'key': 'javaContainer', 'type': 'str'}, + 'java_container_version': {'key': 'javaContainerVersion', 'type': 'str'}, + 'app_command_line': {'key': 'appCommandLine', 'type': 'str'}, + 'managed_pipeline_mode': {'key': 'managedPipelineMode', 'type': 'str'}, + 'virtual_applications': {'key': 'virtualApplications', 'type': '[VirtualApplication]'}, + 'load_balancing': {'key': 'loadBalancing', 'type': 'str'}, + 'experiments': {'key': 'experiments', 'type': 'Experiments'}, + 'limits': {'key': 'limits', 'type': 'SiteLimits'}, + 'auto_heal_enabled': {'key': 'autoHealEnabled', 'type': 'bool'}, + 'auto_heal_rules': {'key': 'autoHealRules', 'type': 'AutoHealRules'}, + 'tracing_options': {'key': 'tracingOptions', 'type': 'str'}, + 'vnet_name': {'key': 'vnetName', 'type': 'str'}, + 'vnet_route_all_enabled': {'key': 'vnetRouteAllEnabled', 'type': 'bool'}, + 'vnet_private_ports_count': {'key': 'vnetPrivatePortsCount', 'type': 'int'}, + 'cors': {'key': 'cors', 'type': 'CorsSettings'}, + 'push': {'key': 'push', 'type': 'PushSettings'}, + 'api_definition': {'key': 'apiDefinition', 'type': 'ApiDefinitionInfo'}, + 'api_management_config': {'key': 'apiManagementConfig', 'type': 'ApiManagementConfig'}, + 'auto_swap_slot_name': {'key': 'autoSwapSlotName', 'type': 'str'}, + 'local_my_sql_enabled': {'key': 'localMySqlEnabled', 'type': 'bool'}, + 'managed_service_identity_id': {'key': 'managedServiceIdentityId', 'type': 'int'}, + 'x_managed_service_identity_id': {'key': 'xManagedServiceIdentityId', 'type': 'int'}, + 'ip_security_restrictions': {'key': 'ipSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions': {'key': 'scmIpSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions_use_main': {'key': 'scmIpSecurityRestrictionsUseMain', 'type': 'bool'}, + 'http20_enabled': {'key': 'http20Enabled', 'type': 'bool'}, + 'min_tls_version': {'key': 'minTlsVersion', 'type': 'str'}, + 'scm_min_tls_version': {'key': 'scmMinTlsVersion', 'type': 'str'}, + 'ftps_state': {'key': 'ftpsState', 'type': 'str'}, + 'pre_warmed_instance_count': {'key': 'preWarmedInstanceCount', 'type': 'int'}, + 'health_check_path': {'key': 'healthCheckPath', 'type': 'str'}, + } + + def __init__( + self, + *, + number_of_workers: Optional[int] = None, + default_documents: Optional[List[str]] = None, + net_framework_version: Optional[str] = "v4.6", + php_version: Optional[str] = None, + python_version: Optional[str] = None, + node_version: Optional[str] = None, + power_shell_version: Optional[str] = None, + linux_fx_version: Optional[str] = None, + windows_fx_version: Optional[str] = None, + request_tracing_enabled: Optional[bool] = None, + request_tracing_expiration_time: Optional[datetime.datetime] = None, + remote_debugging_enabled: Optional[bool] = None, + remote_debugging_version: Optional[str] = None, + http_logging_enabled: Optional[bool] = None, + logs_directory_size_limit: Optional[int] = None, + detailed_error_logging_enabled: Optional[bool] = None, + publishing_username: Optional[str] = None, + app_settings: Optional[List["NameValuePair"]] = None, + connection_strings: Optional[List["ConnStringInfo"]] = None, + handler_mappings: Optional[List["HandlerMapping"]] = None, + document_root: Optional[str] = None, + scm_type: Optional[Union[str, "ScmType"]] = None, + use32_bit_worker_process: Optional[bool] = None, + web_sockets_enabled: Optional[bool] = None, + always_on: Optional[bool] = None, + java_version: Optional[str] = None, + java_container: Optional[str] = None, + java_container_version: Optional[str] = None, + app_command_line: Optional[str] = None, + managed_pipeline_mode: Optional[Union[str, "ManagedPipelineMode"]] = None, + virtual_applications: Optional[List["VirtualApplication"]] = None, + load_balancing: Optional[Union[str, "SiteLoadBalancing"]] = None, + experiments: Optional["Experiments"] = None, + limits: Optional["SiteLimits"] = None, + auto_heal_enabled: Optional[bool] = None, + auto_heal_rules: Optional["AutoHealRules"] = None, + tracing_options: Optional[str] = None, + vnet_name: Optional[str] = None, + vnet_route_all_enabled: Optional[bool] = None, + vnet_private_ports_count: Optional[int] = None, + cors: Optional["CorsSettings"] = None, + push: Optional["PushSettings"] = None, + api_definition: Optional["ApiDefinitionInfo"] = None, + api_management_config: Optional["ApiManagementConfig"] = None, + auto_swap_slot_name: Optional[str] = None, + local_my_sql_enabled: Optional[bool] = False, + managed_service_identity_id: Optional[int] = None, + x_managed_service_identity_id: Optional[int] = None, + ip_security_restrictions: Optional[List["IpSecurityRestriction"]] = None, + scm_ip_security_restrictions: Optional[List["IpSecurityRestriction"]] = None, + scm_ip_security_restrictions_use_main: Optional[bool] = None, + http20_enabled: Optional[bool] = True, + min_tls_version: Optional[Union[str, "SupportedTlsVersions"]] = None, + scm_min_tls_version: Optional[Union[str, "SupportedTlsVersions"]] = None, + ftps_state: Optional[Union[str, "FtpsState"]] = None, + pre_warmed_instance_count: Optional[int] = None, + health_check_path: Optional[str] = None, + **kwargs + ): + super(SiteConfig, self).__init__(**kwargs) + self.number_of_workers = number_of_workers + self.default_documents = default_documents + self.net_framework_version = net_framework_version + self.php_version = php_version + self.python_version = python_version + self.node_version = node_version + self.power_shell_version = power_shell_version + self.linux_fx_version = linux_fx_version + self.windows_fx_version = windows_fx_version + self.request_tracing_enabled = request_tracing_enabled + self.request_tracing_expiration_time = request_tracing_expiration_time + self.remote_debugging_enabled = remote_debugging_enabled + self.remote_debugging_version = remote_debugging_version + self.http_logging_enabled = http_logging_enabled + self.logs_directory_size_limit = logs_directory_size_limit + self.detailed_error_logging_enabled = detailed_error_logging_enabled + self.publishing_username = publishing_username + self.app_settings = app_settings + self.connection_strings = connection_strings + self.machine_key = None + self.handler_mappings = handler_mappings + self.document_root = document_root + self.scm_type = scm_type + self.use32_bit_worker_process = use32_bit_worker_process + self.web_sockets_enabled = web_sockets_enabled + self.always_on = always_on + self.java_version = java_version + self.java_container = java_container + self.java_container_version = java_container_version + self.app_command_line = app_command_line + self.managed_pipeline_mode = managed_pipeline_mode + self.virtual_applications = virtual_applications + self.load_balancing = load_balancing + self.experiments = experiments + self.limits = limits + self.auto_heal_enabled = auto_heal_enabled + self.auto_heal_rules = auto_heal_rules + self.tracing_options = tracing_options + self.vnet_name = vnet_name + self.vnet_route_all_enabled = vnet_route_all_enabled + self.vnet_private_ports_count = vnet_private_ports_count + self.cors = cors + self.push = push + self.api_definition = api_definition + self.api_management_config = api_management_config + self.auto_swap_slot_name = auto_swap_slot_name + self.local_my_sql_enabled = local_my_sql_enabled + self.managed_service_identity_id = managed_service_identity_id + self.x_managed_service_identity_id = x_managed_service_identity_id + self.ip_security_restrictions = ip_security_restrictions + self.scm_ip_security_restrictions = scm_ip_security_restrictions + self.scm_ip_security_restrictions_use_main = scm_ip_security_restrictions_use_main + self.http20_enabled = http20_enabled + self.min_tls_version = min_tls_version + self.scm_min_tls_version = scm_min_tls_version + self.ftps_state = ftps_state + self.pre_warmed_instance_count = pre_warmed_instance_count + self.health_check_path = health_check_path + + +class SiteConfigResource(ProxyOnlyResource): + """Web app configuration ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param number_of_workers: Number of workers. + :type number_of_workers: int + :param default_documents: Default documents. + :type default_documents: list[str] + :param net_framework_version: .NET Framework version. + :type net_framework_version: str + :param php_version: Version of PHP. + :type php_version: str + :param python_version: Version of Python. + :type python_version: str + :param node_version: Version of Node.js. + :type node_version: str + :param power_shell_version: Version of PowerShell. + :type power_shell_version: str + :param linux_fx_version: Linux App Framework and version. + :type linux_fx_version: str + :param windows_fx_version: Xenon App Framework and version. + :type windows_fx_version: str + :param request_tracing_enabled: :code:`true` if request tracing is enabled; + otherwise, :code:`false`. + :type request_tracing_enabled: bool + :param request_tracing_expiration_time: Request tracing expiration time. + :type request_tracing_expiration_time: ~datetime.datetime + :param remote_debugging_enabled: :code:`true` if remote debugging is enabled; + otherwise, :code:`false`. + :type remote_debugging_enabled: bool + :param remote_debugging_version: Remote debugging version. + :type remote_debugging_version: str + :param http_logging_enabled: :code:`true` if HTTP logging is enabled; otherwise, + :code:`false`. + :type http_logging_enabled: bool + :param logs_directory_size_limit: HTTP logs directory size limit. + :type logs_directory_size_limit: int + :param detailed_error_logging_enabled: :code:`true` if detailed error logging is + enabled; otherwise, :code:`false`. + :type detailed_error_logging_enabled: bool + :param publishing_username: Publishing user name. + :type publishing_username: str + :param app_settings: Application settings. + :type app_settings: list[~azure.mgmt.web.v2020_09_01.models.NameValuePair] + :param connection_strings: Connection strings. + :type connection_strings: list[~azure.mgmt.web.v2020_09_01.models.ConnStringInfo] + :ivar machine_key: Site MachineKey. + :vartype machine_key: ~azure.mgmt.web.v2020_09_01.models.SiteMachineKey + :param handler_mappings: Handler mappings. + :type handler_mappings: list[~azure.mgmt.web.v2020_09_01.models.HandlerMapping] + :param document_root: Document root. + :type document_root: str + :param scm_type: SCM type. Possible values include: "None", "Dropbox", "Tfs", "LocalGit", + "GitHub", "CodePlexGit", "CodePlexHg", "BitbucketGit", "BitbucketHg", "ExternalGit", + "ExternalHg", "OneDrive", "VSO", "VSTSRM". + :type scm_type: str or ~azure.mgmt.web.v2020_09_01.models.ScmType + :param use32_bit_worker_process: :code:`true` to use 32-bit worker process; + otherwise, :code:`false`. + :type use32_bit_worker_process: bool + :param web_sockets_enabled: :code:`true` if WebSocket is enabled; otherwise, + :code:`false`. + :type web_sockets_enabled: bool + :param always_on: :code:`true` if Always On is enabled; otherwise, + :code:`false`. + :type always_on: bool + :param java_version: Java version. + :type java_version: str + :param java_container: Java container. + :type java_container: str + :param java_container_version: Java container version. + :type java_container_version: str + :param app_command_line: App command line to launch. + :type app_command_line: str + :param managed_pipeline_mode: Managed pipeline mode. Possible values include: "Integrated", + "Classic". + :type managed_pipeline_mode: str or ~azure.mgmt.web.v2020_09_01.models.ManagedPipelineMode + :param virtual_applications: Virtual applications. + :type virtual_applications: list[~azure.mgmt.web.v2020_09_01.models.VirtualApplication] + :param load_balancing: Site load balancing. Possible values include: "WeightedRoundRobin", + "LeastRequests", "LeastResponseTime", "WeightedTotalTraffic", "RequestHash". + :type load_balancing: str or ~azure.mgmt.web.v2020_09_01.models.SiteLoadBalancing + :param experiments: This is work around for polymorphic types. + :type experiments: ~azure.mgmt.web.v2020_09_01.models.Experiments + :param limits: Site limits. + :type limits: ~azure.mgmt.web.v2020_09_01.models.SiteLimits + :param auto_heal_enabled: :code:`true` if Auto Heal is enabled; otherwise, + :code:`false`. + :type auto_heal_enabled: bool + :param auto_heal_rules: Auto Heal rules. + :type auto_heal_rules: ~azure.mgmt.web.v2020_09_01.models.AutoHealRules + :param tracing_options: Tracing options. + :type tracing_options: str + :param vnet_name: Virtual Network name. + :type vnet_name: str + :param vnet_route_all_enabled: Virtual Network Route All enabled. This causes all outbound + traffic to have Virtual Network Security Groups and User Defined Routes applied. + :type vnet_route_all_enabled: bool + :param vnet_private_ports_count: The number of private ports assigned to this app. These will + be assigned dynamically on runtime. + :type vnet_private_ports_count: int + :param cors: Cross-Origin Resource Sharing (CORS) settings. + :type cors: ~azure.mgmt.web.v2020_09_01.models.CorsSettings + :param push: Push endpoint settings. + :type push: ~azure.mgmt.web.v2020_09_01.models.PushSettings + :param api_definition: Information about the formal API definition for the app. + :type api_definition: ~azure.mgmt.web.v2020_09_01.models.ApiDefinitionInfo + :param api_management_config: Azure API management settings linked to the app. + :type api_management_config: ~azure.mgmt.web.v2020_09_01.models.ApiManagementConfig + :param auto_swap_slot_name: Auto-swap slot name. + :type auto_swap_slot_name: str + :param local_my_sql_enabled: :code:`true` to enable local MySQL; otherwise, + :code:`false`. + :type local_my_sql_enabled: bool + :param managed_service_identity_id: Managed Service Identity Id. + :type managed_service_identity_id: int + :param x_managed_service_identity_id: Explicit Managed Service Identity Id. + :type x_managed_service_identity_id: int + :param ip_security_restrictions: IP security restrictions for main. + :type ip_security_restrictions: list[~azure.mgmt.web.v2020_09_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions: IP security restrictions for scm. + :type scm_ip_security_restrictions: + list[~azure.mgmt.web.v2020_09_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions_use_main: IP security restrictions for scm to use main. + :type scm_ip_security_restrictions_use_main: bool + :param http20_enabled: Http20Enabled: configures a web site to allow clients to connect over + http2.0. + :type http20_enabled: bool + :param min_tls_version: MinTlsVersion: configures the minimum version of TLS required for SSL + requests. Possible values include: "1.0", "1.1", "1.2". + :type min_tls_version: str or ~azure.mgmt.web.v2020_09_01.models.SupportedTlsVersions + :param scm_min_tls_version: ScmMinTlsVersion: configures the minimum version of TLS required + for SSL requests for SCM site. Possible values include: "1.0", "1.1", "1.2". + :type scm_min_tls_version: str or ~azure.mgmt.web.v2020_09_01.models.SupportedTlsVersions + :param ftps_state: State of FTP / FTPS service. Possible values include: "AllAllowed", + "FtpsOnly", "Disabled". + :type ftps_state: str or ~azure.mgmt.web.v2020_09_01.models.FtpsState + :param pre_warmed_instance_count: Number of preWarmed instances. + This setting only applies to the Consumption and Elastic Plans. + :type pre_warmed_instance_count: int + :param health_check_path: Health check path. + :type health_check_path: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'machine_key': {'readonly': True}, + 'pre_warmed_instance_count': {'maximum': 10, 'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'number_of_workers': {'key': 'properties.numberOfWorkers', 'type': 'int'}, + 'default_documents': {'key': 'properties.defaultDocuments', 'type': '[str]'}, + 'net_framework_version': {'key': 'properties.netFrameworkVersion', 'type': 'str'}, + 'php_version': {'key': 'properties.phpVersion', 'type': 'str'}, + 'python_version': {'key': 'properties.pythonVersion', 'type': 'str'}, + 'node_version': {'key': 'properties.nodeVersion', 'type': 'str'}, + 'power_shell_version': {'key': 'properties.powerShellVersion', 'type': 'str'}, + 'linux_fx_version': {'key': 'properties.linuxFxVersion', 'type': 'str'}, + 'windows_fx_version': {'key': 'properties.windowsFxVersion', 'type': 'str'}, + 'request_tracing_enabled': {'key': 'properties.requestTracingEnabled', 'type': 'bool'}, + 'request_tracing_expiration_time': {'key': 'properties.requestTracingExpirationTime', 'type': 'iso-8601'}, + 'remote_debugging_enabled': {'key': 'properties.remoteDebuggingEnabled', 'type': 'bool'}, + 'remote_debugging_version': {'key': 'properties.remoteDebuggingVersion', 'type': 'str'}, + 'http_logging_enabled': {'key': 'properties.httpLoggingEnabled', 'type': 'bool'}, + 'logs_directory_size_limit': {'key': 'properties.logsDirectorySizeLimit', 'type': 'int'}, + 'detailed_error_logging_enabled': {'key': 'properties.detailedErrorLoggingEnabled', 'type': 'bool'}, + 'publishing_username': {'key': 'properties.publishingUsername', 'type': 'str'}, + 'app_settings': {'key': 'properties.appSettings', 'type': '[NameValuePair]'}, + 'connection_strings': {'key': 'properties.connectionStrings', 'type': '[ConnStringInfo]'}, + 'machine_key': {'key': 'properties.machineKey', 'type': 'SiteMachineKey'}, + 'handler_mappings': {'key': 'properties.handlerMappings', 'type': '[HandlerMapping]'}, + 'document_root': {'key': 'properties.documentRoot', 'type': 'str'}, + 'scm_type': {'key': 'properties.scmType', 'type': 'str'}, + 'use32_bit_worker_process': {'key': 'properties.use32BitWorkerProcess', 'type': 'bool'}, + 'web_sockets_enabled': {'key': 'properties.webSocketsEnabled', 'type': 'bool'}, + 'always_on': {'key': 'properties.alwaysOn', 'type': 'bool'}, + 'java_version': {'key': 'properties.javaVersion', 'type': 'str'}, + 'java_container': {'key': 'properties.javaContainer', 'type': 'str'}, + 'java_container_version': {'key': 'properties.javaContainerVersion', 'type': 'str'}, + 'app_command_line': {'key': 'properties.appCommandLine', 'type': 'str'}, + 'managed_pipeline_mode': {'key': 'properties.managedPipelineMode', 'type': 'str'}, + 'virtual_applications': {'key': 'properties.virtualApplications', 'type': '[VirtualApplication]'}, + 'load_balancing': {'key': 'properties.loadBalancing', 'type': 'str'}, + 'experiments': {'key': 'properties.experiments', 'type': 'Experiments'}, + 'limits': {'key': 'properties.limits', 'type': 'SiteLimits'}, + 'auto_heal_enabled': {'key': 'properties.autoHealEnabled', 'type': 'bool'}, + 'auto_heal_rules': {'key': 'properties.autoHealRules', 'type': 'AutoHealRules'}, + 'tracing_options': {'key': 'properties.tracingOptions', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_route_all_enabled': {'key': 'properties.vnetRouteAllEnabled', 'type': 'bool'}, + 'vnet_private_ports_count': {'key': 'properties.vnetPrivatePortsCount', 'type': 'int'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsSettings'}, + 'push': {'key': 'properties.push', 'type': 'PushSettings'}, + 'api_definition': {'key': 'properties.apiDefinition', 'type': 'ApiDefinitionInfo'}, + 'api_management_config': {'key': 'properties.apiManagementConfig', 'type': 'ApiManagementConfig'}, + 'auto_swap_slot_name': {'key': 'properties.autoSwapSlotName', 'type': 'str'}, + 'local_my_sql_enabled': {'key': 'properties.localMySqlEnabled', 'type': 'bool'}, + 'managed_service_identity_id': {'key': 'properties.managedServiceIdentityId', 'type': 'int'}, + 'x_managed_service_identity_id': {'key': 'properties.xManagedServiceIdentityId', 'type': 'int'}, + 'ip_security_restrictions': {'key': 'properties.ipSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions': {'key': 'properties.scmIpSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions_use_main': {'key': 'properties.scmIpSecurityRestrictionsUseMain', 'type': 'bool'}, + 'http20_enabled': {'key': 'properties.http20Enabled', 'type': 'bool'}, + 'min_tls_version': {'key': 'properties.minTlsVersion', 'type': 'str'}, + 'scm_min_tls_version': {'key': 'properties.scmMinTlsVersion', 'type': 'str'}, + 'ftps_state': {'key': 'properties.ftpsState', 'type': 'str'}, + 'pre_warmed_instance_count': {'key': 'properties.preWarmedInstanceCount', 'type': 'int'}, + 'health_check_path': {'key': 'properties.healthCheckPath', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + number_of_workers: Optional[int] = None, + default_documents: Optional[List[str]] = None, + net_framework_version: Optional[str] = "v4.6", + php_version: Optional[str] = None, + python_version: Optional[str] = None, + node_version: Optional[str] = None, + power_shell_version: Optional[str] = None, + linux_fx_version: Optional[str] = None, + windows_fx_version: Optional[str] = None, + request_tracing_enabled: Optional[bool] = None, + request_tracing_expiration_time: Optional[datetime.datetime] = None, + remote_debugging_enabled: Optional[bool] = None, + remote_debugging_version: Optional[str] = None, + http_logging_enabled: Optional[bool] = None, + logs_directory_size_limit: Optional[int] = None, + detailed_error_logging_enabled: Optional[bool] = None, + publishing_username: Optional[str] = None, + app_settings: Optional[List["NameValuePair"]] = None, + connection_strings: Optional[List["ConnStringInfo"]] = None, + handler_mappings: Optional[List["HandlerMapping"]] = None, + document_root: Optional[str] = None, + scm_type: Optional[Union[str, "ScmType"]] = None, + use32_bit_worker_process: Optional[bool] = None, + web_sockets_enabled: Optional[bool] = None, + always_on: Optional[bool] = None, + java_version: Optional[str] = None, + java_container: Optional[str] = None, + java_container_version: Optional[str] = None, + app_command_line: Optional[str] = None, + managed_pipeline_mode: Optional[Union[str, "ManagedPipelineMode"]] = None, + virtual_applications: Optional[List["VirtualApplication"]] = None, + load_balancing: Optional[Union[str, "SiteLoadBalancing"]] = None, + experiments: Optional["Experiments"] = None, + limits: Optional["SiteLimits"] = None, + auto_heal_enabled: Optional[bool] = None, + auto_heal_rules: Optional["AutoHealRules"] = None, + tracing_options: Optional[str] = None, + vnet_name: Optional[str] = None, + vnet_route_all_enabled: Optional[bool] = None, + vnet_private_ports_count: Optional[int] = None, + cors: Optional["CorsSettings"] = None, + push: Optional["PushSettings"] = None, + api_definition: Optional["ApiDefinitionInfo"] = None, + api_management_config: Optional["ApiManagementConfig"] = None, + auto_swap_slot_name: Optional[str] = None, + local_my_sql_enabled: Optional[bool] = False, + managed_service_identity_id: Optional[int] = None, + x_managed_service_identity_id: Optional[int] = None, + ip_security_restrictions: Optional[List["IpSecurityRestriction"]] = None, + scm_ip_security_restrictions: Optional[List["IpSecurityRestriction"]] = None, + scm_ip_security_restrictions_use_main: Optional[bool] = None, + http20_enabled: Optional[bool] = True, + min_tls_version: Optional[Union[str, "SupportedTlsVersions"]] = None, + scm_min_tls_version: Optional[Union[str, "SupportedTlsVersions"]] = None, + ftps_state: Optional[Union[str, "FtpsState"]] = None, + pre_warmed_instance_count: Optional[int] = None, + health_check_path: Optional[str] = None, + **kwargs + ): + super(SiteConfigResource, self).__init__(kind=kind, **kwargs) + self.number_of_workers = number_of_workers + self.default_documents = default_documents + self.net_framework_version = net_framework_version + self.php_version = php_version + self.python_version = python_version + self.node_version = node_version + self.power_shell_version = power_shell_version + self.linux_fx_version = linux_fx_version + self.windows_fx_version = windows_fx_version + self.request_tracing_enabled = request_tracing_enabled + self.request_tracing_expiration_time = request_tracing_expiration_time + self.remote_debugging_enabled = remote_debugging_enabled + self.remote_debugging_version = remote_debugging_version + self.http_logging_enabled = http_logging_enabled + self.logs_directory_size_limit = logs_directory_size_limit + self.detailed_error_logging_enabled = detailed_error_logging_enabled + self.publishing_username = publishing_username + self.app_settings = app_settings + self.connection_strings = connection_strings + self.machine_key = None + self.handler_mappings = handler_mappings + self.document_root = document_root + self.scm_type = scm_type + self.use32_bit_worker_process = use32_bit_worker_process + self.web_sockets_enabled = web_sockets_enabled + self.always_on = always_on + self.java_version = java_version + self.java_container = java_container + self.java_container_version = java_container_version + self.app_command_line = app_command_line + self.managed_pipeline_mode = managed_pipeline_mode + self.virtual_applications = virtual_applications + self.load_balancing = load_balancing + self.experiments = experiments + self.limits = limits + self.auto_heal_enabled = auto_heal_enabled + self.auto_heal_rules = auto_heal_rules + self.tracing_options = tracing_options + self.vnet_name = vnet_name + self.vnet_route_all_enabled = vnet_route_all_enabled + self.vnet_private_ports_count = vnet_private_ports_count + self.cors = cors + self.push = push + self.api_definition = api_definition + self.api_management_config = api_management_config + self.auto_swap_slot_name = auto_swap_slot_name + self.local_my_sql_enabled = local_my_sql_enabled + self.managed_service_identity_id = managed_service_identity_id + self.x_managed_service_identity_id = x_managed_service_identity_id + self.ip_security_restrictions = ip_security_restrictions + self.scm_ip_security_restrictions = scm_ip_security_restrictions + self.scm_ip_security_restrictions_use_main = scm_ip_security_restrictions_use_main + self.http20_enabled = http20_enabled + self.min_tls_version = min_tls_version + self.scm_min_tls_version = scm_min_tls_version + self.ftps_state = ftps_state + self.pre_warmed_instance_count = pre_warmed_instance_count + self.health_check_path = health_check_path + + +class SiteConfigResourceCollection(msrest.serialization.Model): + """Collection of site configurations. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.SiteConfigResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SiteConfigResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SiteConfigResource"], + **kwargs + ): + super(SiteConfigResourceCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SiteConfigurationSnapshotInfo(ProxyOnlyResource): + """A snapshot of a web app configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar time: The time the snapshot was taken. + :vartype time: ~datetime.datetime + :ivar snapshot_id: The id of the snapshot. + :vartype snapshot_id: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'time': {'readonly': True}, + 'snapshot_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'time': {'key': 'properties.time', 'type': 'iso-8601'}, + 'snapshot_id': {'key': 'properties.snapshotId', 'type': 'int'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(SiteConfigurationSnapshotInfo, self).__init__(kind=kind, **kwargs) + self.time = None + self.snapshot_id = None + + +class SiteConfigurationSnapshotInfoCollection(msrest.serialization.Model): + """Collection of metadata for the app configuration snapshots that can be restored. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.SiteConfigurationSnapshotInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SiteConfigurationSnapshotInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SiteConfigurationSnapshotInfo"], + **kwargs + ): + super(SiteConfigurationSnapshotInfoCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SiteExtensionInfo(ProxyOnlyResource): + """Site Extension Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param extension_id: Site extension ID. + :type extension_id: str + :param title: + :type title: str + :param extension_type: Site extension type. Possible values include: "Gallery", "WebRoot". + :type extension_type: str or ~azure.mgmt.web.v2020_09_01.models.SiteExtensionType + :param summary: Summary description. + :type summary: str + :param description: Detailed description. + :type description: str + :param version: Version information. + :type version: str + :param extension_url: Extension URL. + :type extension_url: str + :param project_url: Project URL. + :type project_url: str + :param icon_url: Icon URL. + :type icon_url: str + :param license_url: License URL. + :type license_url: str + :param feed_url: Feed URL. + :type feed_url: str + :param authors: List of authors. + :type authors: list[str] + :param installer_command_line_params: Installer command line parameters. + :type installer_command_line_params: str + :param published_date_time: Published timestamp. + :type published_date_time: ~datetime.datetime + :param download_count: Count of downloads. + :type download_count: int + :param local_is_latest_version: :code:`true` if the local version is the latest + version; :code:`false` otherwise. + :type local_is_latest_version: bool + :param local_path: Local path. + :type local_path: str + :param installed_date_time: Installed timestamp. + :type installed_date_time: ~datetime.datetime + :param provisioning_state: Provisioning state. + :type provisioning_state: str + :param comment: Site Extension comment. + :type comment: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extension_id': {'key': 'properties.extension_id', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'extension_type': {'key': 'properties.extension_type', 'type': 'str'}, + 'summary': {'key': 'properties.summary', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'extension_url': {'key': 'properties.extension_url', 'type': 'str'}, + 'project_url': {'key': 'properties.project_url', 'type': 'str'}, + 'icon_url': {'key': 'properties.icon_url', 'type': 'str'}, + 'license_url': {'key': 'properties.license_url', 'type': 'str'}, + 'feed_url': {'key': 'properties.feed_url', 'type': 'str'}, + 'authors': {'key': 'properties.authors', 'type': '[str]'}, + 'installer_command_line_params': {'key': 'properties.installer_command_line_params', 'type': 'str'}, + 'published_date_time': {'key': 'properties.published_date_time', 'type': 'iso-8601'}, + 'download_count': {'key': 'properties.download_count', 'type': 'int'}, + 'local_is_latest_version': {'key': 'properties.local_is_latest_version', 'type': 'bool'}, + 'local_path': {'key': 'properties.local_path', 'type': 'str'}, + 'installed_date_time': {'key': 'properties.installed_date_time', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'comment': {'key': 'properties.comment', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + extension_id: Optional[str] = None, + title: Optional[str] = None, + extension_type: Optional[Union[str, "SiteExtensionType"]] = None, + summary: Optional[str] = None, + description: Optional[str] = None, + version: Optional[str] = None, + extension_url: Optional[str] = None, + project_url: Optional[str] = None, + icon_url: Optional[str] = None, + license_url: Optional[str] = None, + feed_url: Optional[str] = None, + authors: Optional[List[str]] = None, + installer_command_line_params: Optional[str] = None, + published_date_time: Optional[datetime.datetime] = None, + download_count: Optional[int] = None, + local_is_latest_version: Optional[bool] = None, + local_path: Optional[str] = None, + installed_date_time: Optional[datetime.datetime] = None, + provisioning_state: Optional[str] = None, + comment: Optional[str] = None, + **kwargs + ): + super(SiteExtensionInfo, self).__init__(kind=kind, **kwargs) + self.extension_id = extension_id + self.title = title + self.extension_type = extension_type + self.summary = summary + self.description = description + self.version = version + self.extension_url = extension_url + self.project_url = project_url + self.icon_url = icon_url + self.license_url = license_url + self.feed_url = feed_url + self.authors = authors + self.installer_command_line_params = installer_command_line_params + self.published_date_time = published_date_time + self.download_count = download_count + self.local_is_latest_version = local_is_latest_version + self.local_path = local_path + self.installed_date_time = installed_date_time + self.provisioning_state = provisioning_state + self.comment = comment + + +class SiteExtensionInfoCollection(msrest.serialization.Model): + """Collection of Kudu site extension information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.SiteExtensionInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SiteExtensionInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SiteExtensionInfo"], + **kwargs + ): + super(SiteExtensionInfoCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SiteLimits(msrest.serialization.Model): + """Metric limits set on an app. + + :param max_percentage_cpu: Maximum allowed CPU usage percentage. + :type max_percentage_cpu: float + :param max_memory_in_mb: Maximum allowed memory usage in MB. + :type max_memory_in_mb: long + :param max_disk_size_in_mb: Maximum allowed disk size usage in MB. + :type max_disk_size_in_mb: long + """ + + _attribute_map = { + 'max_percentage_cpu': {'key': 'maxPercentageCpu', 'type': 'float'}, + 'max_memory_in_mb': {'key': 'maxMemoryInMb', 'type': 'long'}, + 'max_disk_size_in_mb': {'key': 'maxDiskSizeInMb', 'type': 'long'}, + } + + def __init__( + self, + *, + max_percentage_cpu: Optional[float] = None, + max_memory_in_mb: Optional[int] = None, + max_disk_size_in_mb: Optional[int] = None, + **kwargs + ): + super(SiteLimits, self).__init__(**kwargs) + self.max_percentage_cpu = max_percentage_cpu + self.max_memory_in_mb = max_memory_in_mb + self.max_disk_size_in_mb = max_disk_size_in_mb + + +class SiteLogsConfig(ProxyOnlyResource): + """Configuration of App Service site logs. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param application_logs: Application logs configuration. + :type application_logs: ~azure.mgmt.web.v2020_09_01.models.ApplicationLogsConfig + :param http_logs: HTTP logs configuration. + :type http_logs: ~azure.mgmt.web.v2020_09_01.models.HttpLogsConfig + :param failed_requests_tracing: Failed requests tracing configuration. + :type failed_requests_tracing: ~azure.mgmt.web.v2020_09_01.models.EnabledConfig + :param detailed_error_messages: Detailed error messages configuration. + :type detailed_error_messages: ~azure.mgmt.web.v2020_09_01.models.EnabledConfig + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'application_logs': {'key': 'properties.applicationLogs', 'type': 'ApplicationLogsConfig'}, + 'http_logs': {'key': 'properties.httpLogs', 'type': 'HttpLogsConfig'}, + 'failed_requests_tracing': {'key': 'properties.failedRequestsTracing', 'type': 'EnabledConfig'}, + 'detailed_error_messages': {'key': 'properties.detailedErrorMessages', 'type': 'EnabledConfig'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + application_logs: Optional["ApplicationLogsConfig"] = None, + http_logs: Optional["HttpLogsConfig"] = None, + failed_requests_tracing: Optional["EnabledConfig"] = None, + detailed_error_messages: Optional["EnabledConfig"] = None, + **kwargs + ): + super(SiteLogsConfig, self).__init__(kind=kind, **kwargs) + self.application_logs = application_logs + self.http_logs = http_logs + self.failed_requests_tracing = failed_requests_tracing + self.detailed_error_messages = detailed_error_messages + + +class SiteMachineKey(msrest.serialization.Model): + """MachineKey of an app. + + :param validation: MachineKey validation. + :type validation: str + :param validation_key: Validation key. + :type validation_key: str + :param decryption: Algorithm used for decryption. + :type decryption: str + :param decryption_key: Decryption key. + :type decryption_key: str + """ + + _attribute_map = { + 'validation': {'key': 'validation', 'type': 'str'}, + 'validation_key': {'key': 'validationKey', 'type': 'str'}, + 'decryption': {'key': 'decryption', 'type': 'str'}, + 'decryption_key': {'key': 'decryptionKey', 'type': 'str'}, + } + + def __init__( + self, + *, + validation: Optional[str] = None, + validation_key: Optional[str] = None, + decryption: Optional[str] = None, + decryption_key: Optional[str] = None, + **kwargs + ): + super(SiteMachineKey, self).__init__(**kwargs) + self.validation = validation + self.validation_key = validation_key + self.decryption = decryption + self.decryption_key = decryption_key + + +class SitePatchResource(ProxyOnlyResource): + """ARM resource for a site. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param identity: Managed service identity. + :type identity: ~azure.mgmt.web.v2020_09_01.models.ManagedServiceIdentity + :ivar state: Current state of the app. + :vartype state: str + :ivar host_names: Hostnames associated with the app. + :vartype host_names: list[str] + :ivar repository_site_name: Name of the repository site. + :vartype repository_site_name: str + :ivar usage_state: State indicating whether the app has exceeded its quota usage. Read-only. + Possible values include: "Normal", "Exceeded". + :vartype usage_state: str or ~azure.mgmt.web.v2020_09_01.models.UsageState + :param enabled: :code:`true` if the app is enabled; otherwise, + :code:`false`. Setting this value to false disables the app (takes the app + offline). + :type enabled: bool + :ivar enabled_host_names: Enabled hostnames for the app.Hostnames need to be assigned (see + HostNames) AND enabled. Otherwise, + the app is not served on those hostnames. + :vartype enabled_host_names: list[str] + :ivar availability_state: Management information availability state for the app. Possible + values include: "Normal", "Limited", "DisasterRecoveryMode". + :vartype availability_state: str or ~azure.mgmt.web.v2020_09_01.models.SiteAvailabilityState + :param host_name_ssl_states: Hostname SSL states are used to manage the SSL bindings for app's + hostnames. + :type host_name_ssl_states: list[~azure.mgmt.web.v2020_09_01.models.HostNameSslState] + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param reserved: :code:`true` if reserved; otherwise, :code:`false`. + :type reserved: bool + :param is_xenon: Obsolete: Hyper-V sandbox. + :type is_xenon: bool + :param hyper_v: Hyper-V sandbox. + :type hyper_v: bool + :ivar last_modified_time_utc: Last time the app was modified, in UTC. Read-only. + :vartype last_modified_time_utc: ~datetime.datetime + :param site_config: Configuration of the app. + :type site_config: ~azure.mgmt.web.v2020_09_01.models.SiteConfig + :ivar traffic_manager_host_names: Azure Traffic Manager hostnames associated with the app. + Read-only. + :vartype traffic_manager_host_names: list[str] + :param scm_site_also_stopped: :code:`true` to stop SCM (KUDU) site when the app is + stopped; otherwise, :code:`false`. The default is :code:`false`. + :type scm_site_also_stopped: bool + :ivar target_swap_slot: Specifies which deployment slot this app will swap into. Read-only. + :vartype target_swap_slot: str + :param hosting_environment_profile: App Service Environment to use for the app. + :type hosting_environment_profile: ~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentProfile + :param client_affinity_enabled: :code:`true` to enable client affinity; + :code:`false` to stop sending session affinity cookies, which route client + requests in the same session to the same instance. Default is :code:`true`. + :type client_affinity_enabled: bool + :param client_cert_enabled: :code:`true` to enable client certificate + authentication (TLS mutual authentication); otherwise, :code:`false`. Default is + :code:`false`. + :type client_cert_enabled: bool + :param client_cert_mode: This composes with ClientCertEnabled setting. + + + * ClientCertEnabled: false means ClientCert is ignored. + * ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + * ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or + accepted. Possible values include: "Required", "Optional". + :type client_cert_mode: str or ~azure.mgmt.web.v2020_09_01.models.ClientCertMode + :param client_cert_exclusion_paths: client certificate authentication comma-separated exclusion + paths. + :type client_cert_exclusion_paths: str + :param host_names_disabled: :code:`true` to disable the public hostnames of the + app; otherwise, :code:`false`. + If :code:`true`, the app is only accessible via API management process. + :type host_names_disabled: bool + :param custom_domain_verification_id: Unique identifier that verifies the custom domains + assigned to the app. Customer will add this id to a txt record for verification. + :type custom_domain_verification_id: str + :ivar outbound_ip_addresses: List of IP addresses that the app uses for outbound connections + (e.g. database access). Includes VIPs from tenants that site can be hosted with current + settings. Read-only. + :vartype outbound_ip_addresses: str + :ivar possible_outbound_ip_addresses: List of IP addresses that the app uses for outbound + connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read- + only. + :vartype possible_outbound_ip_addresses: str + :param container_size: Size of the function container. + :type container_size: int + :param daily_memory_time_quota: Maximum allowed daily memory-time quota (applicable on dynamic + apps only). + :type daily_memory_time_quota: int + :ivar suspended_till: App suspended till in case memory-time quota is exceeded. + :vartype suspended_till: ~datetime.datetime + :ivar max_number_of_workers: Maximum number of workers. + This only applies to Functions container. + :vartype max_number_of_workers: int + :param cloning_info: If specified during app creation, the app is cloned from a source app. + :type cloning_info: ~azure.mgmt.web.v2020_09_01.models.CloningInfo + :ivar resource_group: Name of the resource group the app belongs to. Read-only. + :vartype resource_group: str + :ivar is_default_container: :code:`true` if the app is a default container; + otherwise, :code:`false`. + :vartype is_default_container: bool + :ivar default_host_name: Default hostname of the app. Read-only. + :vartype default_host_name: str + :ivar slot_swap_status: Status of the last deployment slot swap operation. + :vartype slot_swap_status: ~azure.mgmt.web.v2020_09_01.models.SlotSwapStatus + :param https_only: HttpsOnly: configures a web site to accept only https requests. Issues + redirect for + http requests. + :type https_only: bool + :param redundancy_mode: Site redundancy mode. Possible values include: "None", "Manual", + "Failover", "ActiveActive", "GeoRedundant". + :type redundancy_mode: str or ~azure.mgmt.web.v2020_09_01.models.RedundancyMode + :ivar in_progress_operation_id: Specifies an operation id if this site has a pending operation. + :vartype in_progress_operation_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'state': {'readonly': True}, + 'host_names': {'readonly': True}, + 'repository_site_name': {'readonly': True}, + 'usage_state': {'readonly': True}, + 'enabled_host_names': {'readonly': True}, + 'availability_state': {'readonly': True}, + 'last_modified_time_utc': {'readonly': True}, + 'traffic_manager_host_names': {'readonly': True}, + 'target_swap_slot': {'readonly': True}, + 'outbound_ip_addresses': {'readonly': True}, + 'possible_outbound_ip_addresses': {'readonly': True}, + 'suspended_till': {'readonly': True}, + 'max_number_of_workers': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'is_default_container': {'readonly': True}, + 'default_host_name': {'readonly': True}, + 'slot_swap_status': {'readonly': True}, + 'in_progress_operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'repository_site_name': {'key': 'properties.repositorySiteName', 'type': 'str'}, + 'usage_state': {'key': 'properties.usageState', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'enabled_host_names': {'key': 'properties.enabledHostNames', 'type': '[str]'}, + 'availability_state': {'key': 'properties.availabilityState', 'type': 'str'}, + 'host_name_ssl_states': {'key': 'properties.hostNameSslStates', 'type': '[HostNameSslState]'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'last_modified_time_utc': {'key': 'properties.lastModifiedTimeUtc', 'type': 'iso-8601'}, + 'site_config': {'key': 'properties.siteConfig', 'type': 'SiteConfig'}, + 'traffic_manager_host_names': {'key': 'properties.trafficManagerHostNames', 'type': '[str]'}, + 'scm_site_also_stopped': {'key': 'properties.scmSiteAlsoStopped', 'type': 'bool'}, + 'target_swap_slot': {'key': 'properties.targetSwapSlot', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'client_affinity_enabled': {'key': 'properties.clientAffinityEnabled', 'type': 'bool'}, + 'client_cert_enabled': {'key': 'properties.clientCertEnabled', 'type': 'bool'}, + 'client_cert_mode': {'key': 'properties.clientCertMode', 'type': 'str'}, + 'client_cert_exclusion_paths': {'key': 'properties.clientCertExclusionPaths', 'type': 'str'}, + 'host_names_disabled': {'key': 'properties.hostNamesDisabled', 'type': 'bool'}, + 'custom_domain_verification_id': {'key': 'properties.customDomainVerificationId', 'type': 'str'}, + 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': 'str'}, + 'possible_outbound_ip_addresses': {'key': 'properties.possibleOutboundIpAddresses', 'type': 'str'}, + 'container_size': {'key': 'properties.containerSize', 'type': 'int'}, + 'daily_memory_time_quota': {'key': 'properties.dailyMemoryTimeQuota', 'type': 'int'}, + 'suspended_till': {'key': 'properties.suspendedTill', 'type': 'iso-8601'}, + 'max_number_of_workers': {'key': 'properties.maxNumberOfWorkers', 'type': 'int'}, + 'cloning_info': {'key': 'properties.cloningInfo', 'type': 'CloningInfo'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'is_default_container': {'key': 'properties.isDefaultContainer', 'type': 'bool'}, + 'default_host_name': {'key': 'properties.defaultHostName', 'type': 'str'}, + 'slot_swap_status': {'key': 'properties.slotSwapStatus', 'type': 'SlotSwapStatus'}, + 'https_only': {'key': 'properties.httpsOnly', 'type': 'bool'}, + 'redundancy_mode': {'key': 'properties.redundancyMode', 'type': 'str'}, + 'in_progress_operation_id': {'key': 'properties.inProgressOperationId', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + identity: Optional["ManagedServiceIdentity"] = None, + enabled: Optional[bool] = None, + host_name_ssl_states: Optional[List["HostNameSslState"]] = None, + server_farm_id: Optional[str] = None, + reserved: Optional[bool] = False, + is_xenon: Optional[bool] = False, + hyper_v: Optional[bool] = False, + site_config: Optional["SiteConfig"] = None, + scm_site_also_stopped: Optional[bool] = False, + hosting_environment_profile: Optional["HostingEnvironmentProfile"] = None, + client_affinity_enabled: Optional[bool] = None, + client_cert_enabled: Optional[bool] = None, + client_cert_mode: Optional[Union[str, "ClientCertMode"]] = None, + client_cert_exclusion_paths: Optional[str] = None, + host_names_disabled: Optional[bool] = None, + custom_domain_verification_id: Optional[str] = None, + container_size: Optional[int] = None, + daily_memory_time_quota: Optional[int] = None, + cloning_info: Optional["CloningInfo"] = None, + https_only: Optional[bool] = None, + redundancy_mode: Optional[Union[str, "RedundancyMode"]] = None, + **kwargs + ): + super(SitePatchResource, self).__init__(kind=kind, **kwargs) + self.identity = identity + self.state = None + self.host_names = None + self.repository_site_name = None + self.usage_state = None + self.enabled = enabled + self.enabled_host_names = None + self.availability_state = None + self.host_name_ssl_states = host_name_ssl_states + self.server_farm_id = server_farm_id + self.reserved = reserved + self.is_xenon = is_xenon + self.hyper_v = hyper_v + self.last_modified_time_utc = None + self.site_config = site_config + self.traffic_manager_host_names = None + self.scm_site_also_stopped = scm_site_also_stopped + self.target_swap_slot = None + self.hosting_environment_profile = hosting_environment_profile + self.client_affinity_enabled = client_affinity_enabled + self.client_cert_enabled = client_cert_enabled + self.client_cert_mode = client_cert_mode + self.client_cert_exclusion_paths = client_cert_exclusion_paths + self.host_names_disabled = host_names_disabled + self.custom_domain_verification_id = custom_domain_verification_id + self.outbound_ip_addresses = None + self.possible_outbound_ip_addresses = None + self.container_size = container_size + self.daily_memory_time_quota = daily_memory_time_quota + self.suspended_till = None + self.max_number_of_workers = None + self.cloning_info = cloning_info + self.resource_group = None + self.is_default_container = None + self.default_host_name = None + self.slot_swap_status = None + self.https_only = https_only + self.redundancy_mode = redundancy_mode + self.in_progress_operation_id = None + + +class SitePhpErrorLogFlag(ProxyOnlyResource): + """Used for getting PHP error logging flag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param local_log_errors: Local log_errors setting. + :type local_log_errors: str + :param master_log_errors: Master log_errors setting. + :type master_log_errors: str + :param local_log_errors_max_length: Local log_errors_max_len setting. + :type local_log_errors_max_length: str + :param master_log_errors_max_length: Master log_errors_max_len setting. + :type master_log_errors_max_length: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'local_log_errors': {'key': 'properties.localLogErrors', 'type': 'str'}, + 'master_log_errors': {'key': 'properties.masterLogErrors', 'type': 'str'}, + 'local_log_errors_max_length': {'key': 'properties.localLogErrorsMaxLength', 'type': 'str'}, + 'master_log_errors_max_length': {'key': 'properties.masterLogErrorsMaxLength', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + local_log_errors: Optional[str] = None, + master_log_errors: Optional[str] = None, + local_log_errors_max_length: Optional[str] = None, + master_log_errors_max_length: Optional[str] = None, + **kwargs + ): + super(SitePhpErrorLogFlag, self).__init__(kind=kind, **kwargs) + self.local_log_errors = local_log_errors + self.master_log_errors = master_log_errors + self.local_log_errors_max_length = local_log_errors_max_length + self.master_log_errors_max_length = master_log_errors_max_length + + +class SiteSeal(msrest.serialization.Model): + """Site seal. + + All required parameters must be populated in order to send to Azure. + + :param html: Required. HTML snippet. + :type html: str + """ + + _validation = { + 'html': {'required': True}, + } + + _attribute_map = { + 'html': {'key': 'html', 'type': 'str'}, + } + + def __init__( + self, + *, + html: str, + **kwargs + ): + super(SiteSeal, self).__init__(**kwargs) + self.html = html + + +class SiteSealRequest(msrest.serialization.Model): + """Site seal request. + + :param light_theme: If :code:`true` use the light color theme for site seal; + otherwise, use the default color theme. + :type light_theme: bool + :param locale: Locale of site seal. + :type locale: str + """ + + _attribute_map = { + 'light_theme': {'key': 'lightTheme', 'type': 'bool'}, + 'locale': {'key': 'locale', 'type': 'str'}, + } + + def __init__( + self, + *, + light_theme: Optional[bool] = None, + locale: Optional[str] = None, + **kwargs + ): + super(SiteSealRequest, self).__init__(**kwargs) + self.light_theme = light_theme + self.locale = locale + + +class SiteSourceControl(ProxyOnlyResource): + """Source control configuration for an app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param repo_url: Repository or source control URL. + :type repo_url: str + :param branch: Name of branch to use for deployment. + :type branch: str + :param is_manual_integration: :code:`true` to limit to manual integration; + :code:`false` to enable continuous integration (which configures webhooks into + online repos like GitHub). + :type is_manual_integration: bool + :param is_git_hub_action: :code:`true` if this is deployed via GitHub action. + :type is_git_hub_action: bool + :param deployment_rollback_enabled: :code:`true` to enable deployment rollback; + otherwise, :code:`false`. + :type deployment_rollback_enabled: bool + :param is_mercurial: :code:`true` for a Mercurial repository; + :code:`false` for a Git repository. + :type is_mercurial: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'repo_url': {'key': 'properties.repoUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'is_manual_integration': {'key': 'properties.isManualIntegration', 'type': 'bool'}, + 'is_git_hub_action': {'key': 'properties.isGitHubAction', 'type': 'bool'}, + 'deployment_rollback_enabled': {'key': 'properties.deploymentRollbackEnabled', 'type': 'bool'}, + 'is_mercurial': {'key': 'properties.isMercurial', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + repo_url: Optional[str] = None, + branch: Optional[str] = None, + is_manual_integration: Optional[bool] = None, + is_git_hub_action: Optional[bool] = None, + deployment_rollback_enabled: Optional[bool] = None, + is_mercurial: Optional[bool] = None, + **kwargs + ): + super(SiteSourceControl, self).__init__(kind=kind, **kwargs) + self.repo_url = repo_url + self.branch = branch + self.is_manual_integration = is_manual_integration + self.is_git_hub_action = is_git_hub_action + self.deployment_rollback_enabled = deployment_rollback_enabled + self.is_mercurial = is_mercurial + + +class SkuCapacity(msrest.serialization.Model): + """Description of the App Service plan scale options. + + :param minimum: Minimum number of workers for this App Service plan SKU. + :type minimum: int + :param maximum: Maximum number of workers for this App Service plan SKU. + :type maximum: int + :param default: Default number of workers for this App Service plan SKU. + :type default: int + :param scale_type: Available scale configurations for an App Service plan. + :type scale_type: str + """ + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__( + self, + *, + minimum: Optional[int] = None, + maximum: Optional[int] = None, + default: Optional[int] = None, + scale_type: Optional[str] = None, + **kwargs + ): + super(SkuCapacity, self).__init__(**kwargs) + self.minimum = minimum + self.maximum = maximum + self.default = default + self.scale_type = scale_type + + +class SkuDescription(msrest.serialization.Model): + """Description of a SKU for a scalable resource. + + :param name: Name of the resource SKU. + :type name: str + :param tier: Service tier of the resource SKU. + :type tier: str + :param size: Size specifier of the resource SKU. + :type size: str + :param family: Family code of the resource SKU. + :type family: str + :param capacity: Current number of instances assigned to the resource. + :type capacity: int + :param sku_capacity: Min, max, and default scale values of the SKU. + :type sku_capacity: ~azure.mgmt.web.v2020_09_01.models.SkuCapacity + :param locations: Locations of the SKU. + :type locations: list[str] + :param capabilities: Capabilities of the SKU, e.g., is traffic manager enabled?. + :type capabilities: list[~azure.mgmt.web.v2020_09_01.models.Capability] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'sku_capacity': {'key': 'skuCapacity', 'type': 'SkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[Capability]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + tier: Optional[str] = None, + size: Optional[str] = None, + family: Optional[str] = None, + capacity: Optional[int] = None, + sku_capacity: Optional["SkuCapacity"] = None, + locations: Optional[List[str]] = None, + capabilities: Optional[List["Capability"]] = None, + **kwargs + ): + super(SkuDescription, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.size = size + self.family = family + self.capacity = capacity + self.sku_capacity = sku_capacity + self.locations = locations + self.capabilities = capabilities + + +class SkuInfo(msrest.serialization.Model): + """SKU discovery information. + + :param resource_type: Resource type that this SKU applies to. + :type resource_type: str + :param sku: Name and tier of the SKU. + :type sku: ~azure.mgmt.web.v2020_09_01.models.SkuDescription + :param capacity: Min, max, and default scale values of the SKU. + :type capacity: ~azure.mgmt.web.v2020_09_01.models.SkuCapacity + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, + } + + def __init__( + self, + *, + resource_type: Optional[str] = None, + sku: Optional["SkuDescription"] = None, + capacity: Optional["SkuCapacity"] = None, + **kwargs + ): + super(SkuInfo, self).__init__(**kwargs) + self.resource_type = resource_type + self.sku = sku + self.capacity = capacity + + +class SkuInfoCollection(msrest.serialization.Model): + """Collection of SKU information. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.SkuInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SkuInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SkuInfo"], + **kwargs + ): + super(SkuInfoCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SkuInfos(msrest.serialization.Model): + """Collection of SKU information. + + :param resource_type: Resource type that this SKU applies to. + :type resource_type: str + :param skus: List of SKUs the subscription is able to use. + :type skus: list[~azure.mgmt.web.v2020_09_01.models.GlobalCsmSkuDescription] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'skus': {'key': 'skus', 'type': '[GlobalCsmSkuDescription]'}, + } + + def __init__( + self, + *, + resource_type: Optional[str] = None, + skus: Optional[List["GlobalCsmSkuDescription"]] = None, + **kwargs + ): + super(SkuInfos, self).__init__(**kwargs) + self.resource_type = resource_type + self.skus = skus + + +class SlotConfigNamesResource(ProxyOnlyResource): + """Slot Config names azure resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param connection_string_names: List of connection string names. + :type connection_string_names: list[str] + :param app_setting_names: List of application settings names. + :type app_setting_names: list[str] + :param azure_storage_config_names: List of external Azure storage account identifiers. + :type azure_storage_config_names: list[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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'connection_string_names': {'key': 'properties.connectionStringNames', 'type': '[str]'}, + 'app_setting_names': {'key': 'properties.appSettingNames', 'type': '[str]'}, + 'azure_storage_config_names': {'key': 'properties.azureStorageConfigNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + connection_string_names: Optional[List[str]] = None, + app_setting_names: Optional[List[str]] = None, + azure_storage_config_names: Optional[List[str]] = None, + **kwargs + ): + super(SlotConfigNamesResource, self).__init__(kind=kind, **kwargs) + self.connection_string_names = connection_string_names + self.app_setting_names = app_setting_names + self.azure_storage_config_names = azure_storage_config_names + + +class SlotDifference(ProxyOnlyResource): + """A setting difference between two deployment slots of an app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar level: Level of the difference: Information, Warning or Error. + :vartype level: str + :ivar setting_type: The type of the setting: General, AppSetting or ConnectionString. + :vartype setting_type: str + :ivar diff_rule: Rule that describes how to process the setting difference during a slot swap. + :vartype diff_rule: str + :ivar setting_name: Name of the setting. + :vartype setting_name: str + :ivar value_in_current_slot: Value of the setting in the current slot. + :vartype value_in_current_slot: str + :ivar value_in_target_slot: Value of the setting in the target slot. + :vartype value_in_target_slot: str + :ivar description: Description of the setting difference. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'level': {'readonly': True}, + 'setting_type': {'readonly': True}, + 'diff_rule': {'readonly': True}, + 'setting_name': {'readonly': True}, + 'value_in_current_slot': {'readonly': True}, + 'value_in_target_slot': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'level': {'key': 'properties.level', 'type': 'str'}, + 'setting_type': {'key': 'properties.settingType', 'type': 'str'}, + 'diff_rule': {'key': 'properties.diffRule', 'type': 'str'}, + 'setting_name': {'key': 'properties.settingName', 'type': 'str'}, + 'value_in_current_slot': {'key': 'properties.valueInCurrentSlot', 'type': 'str'}, + 'value_in_target_slot': {'key': 'properties.valueInTargetSlot', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(SlotDifference, self).__init__(kind=kind, **kwargs) + self.level = None + self.setting_type = None + self.diff_rule = None + self.setting_name = None + self.value_in_current_slot = None + self.value_in_target_slot = None + self.description = None + + +class SlotDifferenceCollection(msrest.serialization.Model): + """Collection of slot differences. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.SlotDifference] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SlotDifference]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SlotDifference"], + **kwargs + ): + super(SlotDifferenceCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SlotSwapStatus(msrest.serialization.Model): + """The status of the last successful slot swap operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar timestamp_utc: The time the last successful slot swap completed. + :vartype timestamp_utc: ~datetime.datetime + :ivar source_slot_name: The source slot of the last swap operation. + :vartype source_slot_name: str + :ivar destination_slot_name: The destination slot of the last swap operation. + :vartype destination_slot_name: str + """ + + _validation = { + 'timestamp_utc': {'readonly': True}, + 'source_slot_name': {'readonly': True}, + 'destination_slot_name': {'readonly': True}, + } + + _attribute_map = { + 'timestamp_utc': {'key': 'timestampUtc', 'type': 'iso-8601'}, + 'source_slot_name': {'key': 'sourceSlotName', 'type': 'str'}, + 'destination_slot_name': {'key': 'destinationSlotName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SlotSwapStatus, self).__init__(**kwargs) + self.timestamp_utc = None + self.source_slot_name = None + self.destination_slot_name = None + + +class SlowRequestsBasedTrigger(msrest.serialization.Model): + """Trigger based on request execution time. + + :param time_taken: Time taken. + :type time_taken: str + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + """ + + _attribute_map = { + 'time_taken': {'key': 'timeTaken', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + } + + def __init__( + self, + *, + time_taken: Optional[str] = None, + count: Optional[int] = None, + time_interval: Optional[str] = None, + **kwargs + ): + super(SlowRequestsBasedTrigger, self).__init__(**kwargs) + self.time_taken = time_taken + self.count = count + self.time_interval = time_interval + + +class Snapshot(ProxyOnlyResource): + """A snapshot of an app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar time: The time the snapshot was taken. + :vartype time: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'time': {'key': 'properties.time', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(Snapshot, self).__init__(kind=kind, **kwargs) + self.time = None + + +class SnapshotCollection(msrest.serialization.Model): + """Collection of snapshots which can be used to revert an app to a previous time. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.Snapshot] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Snapshot]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Snapshot"], + **kwargs + ): + super(SnapshotCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SnapshotRecoverySource(msrest.serialization.Model): + """Specifies the web app that snapshot contents will be retrieved from. + + :param location: Geographical location of the source web app, e.g. SouthEastAsia, + SouthCentralUS. + :type location: str + :param id: ARM resource ID of the source app. + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + for production slots and + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + for other slots. + :type id: str + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + id: Optional[str] = None, + **kwargs + ): + super(SnapshotRecoverySource, self).__init__(**kwargs) + self.location = location + self.id = id + + +class SnapshotRestoreRequest(ProxyOnlyResource): + """Details about app recovery operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param snapshot_time: Point in time in which the app restore should be done, formatted as a + DateTime string. + :type snapshot_time: str + :param recovery_source: Optional. Specifies the web app that snapshot contents will be + retrieved from. + If empty, the targeted web app will be used as the source. + :type recovery_source: ~azure.mgmt.web.v2020_09_01.models.SnapshotRecoverySource + :param overwrite: If :code:`true` the restore operation can overwrite source app; + otherwise, :code:`false`. + :type overwrite: bool + :param recover_configuration: If true, site configuration, in addition to content, will be + reverted. + :type recover_configuration: bool + :param ignore_conflicting_host_names: If true, custom hostname conflicts will be ignored when + recovering to a target web app. + This setting is only necessary when RecoverConfiguration is enabled. + :type ignore_conflicting_host_names: bool + :param use_dr_secondary: If true, the snapshot is retrieved from DRSecondary endpoint. + :type use_dr_secondary: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'str'}, + 'recovery_source': {'key': 'properties.recoverySource', 'type': 'SnapshotRecoverySource'}, + 'overwrite': {'key': 'properties.overwrite', 'type': 'bool'}, + 'recover_configuration': {'key': 'properties.recoverConfiguration', 'type': 'bool'}, + 'ignore_conflicting_host_names': {'key': 'properties.ignoreConflictingHostNames', 'type': 'bool'}, + 'use_dr_secondary': {'key': 'properties.useDRSecondary', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + snapshot_time: Optional[str] = None, + recovery_source: Optional["SnapshotRecoverySource"] = None, + overwrite: Optional[bool] = None, + recover_configuration: Optional[bool] = None, + ignore_conflicting_host_names: Optional[bool] = None, + use_dr_secondary: Optional[bool] = None, + **kwargs + ): + super(SnapshotRestoreRequest, self).__init__(kind=kind, **kwargs) + self.snapshot_time = snapshot_time + self.recovery_source = recovery_source + self.overwrite = overwrite + self.recover_configuration = recover_configuration + self.ignore_conflicting_host_names = ignore_conflicting_host_names + self.use_dr_secondary = use_dr_secondary + + +class Solution(msrest.serialization.Model): + """Class Representing Solution for problems detected. + + :param id: Solution Id. + :type id: float + :param display_name: Display Name of the solution. + :type display_name: str + :param order: Order of the solution. + :type order: float + :param description: Description of the solution. + :type description: str + :param type: Type of Solution. Possible values include: "QuickSolution", "DeepInvestigation", + "BestPractices". + :type type: str or ~azure.mgmt.web.v2020_09_01.models.SolutionType + :param data: Solution Data. + :type data: list[list[~azure.mgmt.web.v2020_09_01.models.NameValuePair]] + :param metadata: Solution Metadata. + :type metadata: list[list[~azure.mgmt.web.v2020_09_01.models.NameValuePair]] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'float'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'float'}, + 'description': {'key': 'description', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data': {'key': 'data', 'type': '[[NameValuePair]]'}, + 'metadata': {'key': 'metadata', 'type': '[[NameValuePair]]'}, + } + + def __init__( + self, + *, + id: Optional[float] = None, + display_name: Optional[str] = None, + order: Optional[float] = None, + description: Optional[str] = None, + type: Optional[Union[str, "SolutionType"]] = None, + data: Optional[List[List["NameValuePair"]]] = None, + metadata: Optional[List[List["NameValuePair"]]] = None, + **kwargs + ): + super(Solution, self).__init__(**kwargs) + self.id = id + self.display_name = display_name + self.order = order + self.description = description + self.type = type + self.data = data + self.metadata = metadata + + +class SourceControl(ProxyOnlyResource): + """The source control OAuth token. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param token: OAuth access token. + :type token: str + :param token_secret: OAuth access token secret. + :type token_secret: str + :param refresh_token: OAuth refresh token. + :type refresh_token: str + :param expiration_time: OAuth token expiration. + :type expiration_time: ~datetime.datetime + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'token': {'key': 'properties.token', 'type': 'str'}, + 'token_secret': {'key': 'properties.tokenSecret', 'type': 'str'}, + 'refresh_token': {'key': 'properties.refreshToken', 'type': 'str'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + token: Optional[str] = None, + token_secret: Optional[str] = None, + refresh_token: Optional[str] = None, + expiration_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(SourceControl, self).__init__(kind=kind, **kwargs) + self.token = token + self.token_secret = token_secret + self.refresh_token = refresh_token + self.expiration_time = expiration_time + + +class SourceControlCollection(msrest.serialization.Model): + """Collection of source controls. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.SourceControl] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SourceControl]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SourceControl"], + **kwargs + ): + super(SourceControlCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StackMajorVersion(msrest.serialization.Model): + """Application stack major version. + + :param display_version: Application stack major version (display only). + :type display_version: str + :param runtime_version: Application stack major version (runtime only). + :type runtime_version: str + :param is_default: :code:`true` if this is the default major version; otherwise, + :code:`false`. + :type is_default: bool + :param minor_versions: Minor versions associated with the major version. + :type minor_versions: list[~azure.mgmt.web.v2020_09_01.models.StackMinorVersion] + :param application_insights: :code:`true` if this supports Application Insights; + otherwise, :code:`false`. + :type application_insights: bool + :param is_preview: :code:`true` if this stack is in Preview, otherwise + :code:`false`. + :type is_preview: bool + :param is_deprecated: :code:`true` if this stack has been deprecated, otherwise + :code:`false`. + :type is_deprecated: bool + :param is_hidden: :code:`true` if this stack should be hidden for new customers on + portal, otherwise :code:`false`. + :type is_hidden: bool + """ + + _attribute_map = { + 'display_version': {'key': 'displayVersion', 'type': 'str'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'minor_versions': {'key': 'minorVersions', 'type': '[StackMinorVersion]'}, + 'application_insights': {'key': 'applicationInsights', 'type': 'bool'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + 'is_deprecated': {'key': 'isDeprecated', 'type': 'bool'}, + 'is_hidden': {'key': 'isHidden', 'type': 'bool'}, + } + + def __init__( + self, + *, + display_version: Optional[str] = None, + runtime_version: Optional[str] = None, + is_default: Optional[bool] = None, + minor_versions: Optional[List["StackMinorVersion"]] = None, + application_insights: Optional[bool] = None, + is_preview: Optional[bool] = None, + is_deprecated: Optional[bool] = None, + is_hidden: Optional[bool] = None, + **kwargs + ): + super(StackMajorVersion, self).__init__(**kwargs) + self.display_version = display_version + self.runtime_version = runtime_version + self.is_default = is_default + self.minor_versions = minor_versions + self.application_insights = application_insights + self.is_preview = is_preview + self.is_deprecated = is_deprecated + self.is_hidden = is_hidden + + +class StackMinorVersion(msrest.serialization.Model): + """Application stack minor version. + + :param display_version: Application stack minor version (display only). + :type display_version: str + :param runtime_version: Application stack minor version (runtime only). + :type runtime_version: str + :param is_default: :code:`true` if this is the default minor version; otherwise, + :code:`false`. + :type is_default: bool + :param is_remote_debugging_enabled: :code:`true` if this supports Remote + Debugging, otherwise :code:`false`. + :type is_remote_debugging_enabled: bool + """ + + _attribute_map = { + 'display_version': {'key': 'displayVersion', 'type': 'str'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'is_remote_debugging_enabled': {'key': 'isRemoteDebuggingEnabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + display_version: Optional[str] = None, + runtime_version: Optional[str] = None, + is_default: Optional[bool] = None, + is_remote_debugging_enabled: Optional[bool] = None, + **kwargs + ): + super(StackMinorVersion, self).__init__(**kwargs) + self.display_version = display_version + self.runtime_version = runtime_version + self.is_default = is_default + self.is_remote_debugging_enabled = is_remote_debugging_enabled + + +class StampCapacity(msrest.serialization.Model): + """Stamp capacity information. + + :param name: Name of the stamp. + :type name: str + :param available_capacity: Available capacity (# of machines, bytes of storage etc...). + :type available_capacity: long + :param total_capacity: Total capacity (# of machines, bytes of storage etc...). + :type total_capacity: long + :param unit: Name of the unit. + :type unit: str + :param compute_mode: Shared/dedicated workers. Possible values include: "Shared", "Dedicated", + "Dynamic". + :type compute_mode: str or ~azure.mgmt.web.v2020_09_01.models.ComputeModeOptions + :param worker_size: Size of the machines. Possible values include: "Small", "Medium", "Large", + "D1", "D2", "D3", "NestedSmall", "Default". + :type worker_size: str or ~azure.mgmt.web.v2020_09_01.models.WorkerSizeOptions + :param worker_size_id: Size ID of machines: + 0 - Small + 1 - Medium + 2 - Large. + :type worker_size_id: int + :param exclude_from_capacity_allocation: If :code:`true`, it includes basic apps. + Basic apps are not used for capacity allocation. + :type exclude_from_capacity_allocation: bool + :param is_applicable_for_all_compute_modes: :code:`true` if capacity is applicable + for all apps; otherwise, :code:`false`. + :type is_applicable_for_all_compute_modes: bool + :param site_mode: Shared or Dedicated. + :type site_mode: str + :param is_linux: Is this a linux stamp capacity. + :type is_linux: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'available_capacity': {'key': 'availableCapacity', 'type': 'long'}, + 'total_capacity': {'key': 'totalCapacity', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'compute_mode': {'key': 'computeMode', 'type': 'str'}, + 'worker_size': {'key': 'workerSize', 'type': 'str'}, + 'worker_size_id': {'key': 'workerSizeId', 'type': 'int'}, + 'exclude_from_capacity_allocation': {'key': 'excludeFromCapacityAllocation', 'type': 'bool'}, + 'is_applicable_for_all_compute_modes': {'key': 'isApplicableForAllComputeModes', 'type': 'bool'}, + 'site_mode': {'key': 'siteMode', 'type': 'str'}, + 'is_linux': {'key': 'isLinux', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + available_capacity: Optional[int] = None, + total_capacity: Optional[int] = None, + unit: Optional[str] = None, + compute_mode: Optional[Union[str, "ComputeModeOptions"]] = None, + worker_size: Optional[Union[str, "WorkerSizeOptions"]] = None, + worker_size_id: Optional[int] = None, + exclude_from_capacity_allocation: Optional[bool] = None, + is_applicable_for_all_compute_modes: Optional[bool] = None, + site_mode: Optional[str] = None, + is_linux: Optional[bool] = None, + **kwargs + ): + super(StampCapacity, self).__init__(**kwargs) + self.name = name + self.available_capacity = available_capacity + self.total_capacity = total_capacity + self.unit = unit + self.compute_mode = compute_mode + self.worker_size = worker_size + self.worker_size_id = worker_size_id + self.exclude_from_capacity_allocation = exclude_from_capacity_allocation + self.is_applicable_for_all_compute_modes = is_applicable_for_all_compute_modes + self.site_mode = site_mode + self.is_linux = is_linux + + +class StampCapacityCollection(msrest.serialization.Model): + """Collection of stamp capacities. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.StampCapacity] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StampCapacity]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["StampCapacity"], + **kwargs + ): + super(StampCapacityCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StaticSiteARMResource(Resource): + """Static Site ARM 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: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param sku: Description of a SKU for a scalable resource. + :type sku: ~azure.mgmt.web.v2020_09_01.models.SkuDescription + :ivar default_hostname: The default autogenerated hostname for the static site. + :vartype default_hostname: str + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :ivar custom_domains: The custom domains associated with this static site. + :vartype custom_domains: list[str] + :param repository_token: A user's github repository token. This is used to setup the Github + Actions workflow file and API secrets. + :type repository_token: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: ~azure.mgmt.web.v2020_09_01.models.StaticSiteBuildProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'default_hostname': {'readonly': True}, + 'custom_domains': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'default_hostname': {'key': 'properties.defaultHostname', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'custom_domains': {'key': 'properties.customDomains', 'type': '[str]'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["SkuDescription"] = None, + repository_url: Optional[str] = None, + branch: Optional[str] = None, + repository_token: Optional[str] = None, + build_properties: Optional["StaticSiteBuildProperties"] = None, + **kwargs + ): + super(StaticSiteARMResource, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.sku = sku + self.default_hostname = None + self.repository_url = repository_url + self.branch = branch + self.custom_domains = None + self.repository_token = repository_token + self.build_properties = build_properties + + +class StaticSiteBuildARMResource(ProxyOnlyResource): + """Static Site Build ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar build_id: An identifier for the static site build. + :vartype build_id: str + :ivar source_branch: The source branch. + :vartype source_branch: str + :ivar pull_request_title: The title of a pull request that a static site build is related to. + :vartype pull_request_title: str + :ivar hostname: The hostname for a static site build. + :vartype hostname: str + :ivar created_time_utc: When this build was created. + :vartype created_time_utc: ~datetime.datetime + :ivar last_updated_on: When this build was updated. + :vartype last_updated_on: ~datetime.datetime + :ivar status: The status of the static site build. Possible values include: + "WaitingForDeployment", "Uploading", "Deploying", "Ready", "Failed", "Deleting", "Detached". + :vartype status: str or ~azure.mgmt.web.v2020_09_01.models.BuildStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'build_id': {'readonly': True}, + 'source_branch': {'readonly': True}, + 'pull_request_title': {'readonly': True}, + 'hostname': {'readonly': True}, + 'created_time_utc': {'readonly': True}, + 'last_updated_on': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'build_id': {'key': 'properties.buildId', 'type': 'str'}, + 'source_branch': {'key': 'properties.sourceBranch', 'type': 'str'}, + 'pull_request_title': {'key': 'properties.pullRequestTitle', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'created_time_utc': {'key': 'properties.createdTimeUtc', 'type': 'iso-8601'}, + 'last_updated_on': {'key': 'properties.lastUpdatedOn', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(StaticSiteBuildARMResource, self).__init__(kind=kind, **kwargs) + self.build_id = None + self.source_branch = None + self.pull_request_title = None + self.hostname = None + self.created_time_utc = None + self.last_updated_on = None + self.status = None + + +class StaticSiteBuildCollection(msrest.serialization.Model): + """Collection of static site builds. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.StaticSiteBuildARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteBuildARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["StaticSiteBuildARMResource"], + **kwargs + ): + super(StaticSiteBuildCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StaticSiteBuildProperties(msrest.serialization.Model): + """Build properties for the static site. + + :param app_location: The path to the app code within the repository. + :type app_location: str + :param api_location: The path to the api code within the repository. + :type api_location: str + :param app_artifact_location: The path of the app artifacts after building. + :type app_artifact_location: str + """ + + _attribute_map = { + 'app_location': {'key': 'appLocation', 'type': 'str'}, + 'api_location': {'key': 'apiLocation', 'type': 'str'}, + 'app_artifact_location': {'key': 'appArtifactLocation', 'type': 'str'}, + } + + def __init__( + self, + *, + app_location: Optional[str] = None, + api_location: Optional[str] = None, + app_artifact_location: Optional[str] = None, + **kwargs + ): + super(StaticSiteBuildProperties, self).__init__(**kwargs) + self.app_location = app_location + self.api_location = api_location + self.app_artifact_location = app_artifact_location + + +class StaticSiteCollection(msrest.serialization.Model): + """Collection of static sites. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.StaticSiteARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["StaticSiteARMResource"], + **kwargs + ): + super(StaticSiteCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StaticSiteCustomDomainOverviewARMResource(ProxyOnlyResource): + """Static Site Custom Domain Overview ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar domain_name: The domain name for the static site custom domain. + :vartype domain_name: str + :ivar created_on: The date and time on which the custom domain was created for the static site. + :vartype created_on: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'domain_name': {'readonly': True}, + 'created_on': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'domain_name': {'key': 'properties.domainName', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(StaticSiteCustomDomainOverviewARMResource, self).__init__(kind=kind, **kwargs) + self.domain_name = None + self.created_on = None + + +class StaticSiteCustomDomainOverviewCollection(msrest.serialization.Model): + """Collection of static site custom domains. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.StaticSiteCustomDomainOverviewARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteCustomDomainOverviewARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["StaticSiteCustomDomainOverviewARMResource"], + **kwargs + ): + super(StaticSiteCustomDomainOverviewCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StaticSiteFunctionOverviewARMResource(ProxyOnlyResource): + """Static Site Function Overview ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar function_name: The name for the function. + :vartype function_name: str + :ivar trigger_type: The trigger type of the function. Possible values include: "HttpTrigger", + "Unknown". + :vartype trigger_type: str or ~azure.mgmt.web.v2020_09_01.models.TriggerTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'function_name': {'readonly': True}, + 'trigger_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'function_name': {'key': 'properties.functionName', 'type': 'str'}, + 'trigger_type': {'key': 'properties.triggerType', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(StaticSiteFunctionOverviewARMResource, self).__init__(kind=kind, **kwargs) + self.function_name = None + self.trigger_type = None + + +class StaticSiteFunctionOverviewCollection(msrest.serialization.Model): + """Collection of static site functions. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.StaticSiteFunctionOverviewARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteFunctionOverviewARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["StaticSiteFunctionOverviewARMResource"], + **kwargs + ): + super(StaticSiteFunctionOverviewCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StaticSitePatchResource(ProxyOnlyResource): + """ARM resource for a static site when patching. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar default_hostname: The default autogenerated hostname for the static site. + :vartype default_hostname: str + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :ivar custom_domains: The custom domains associated with this static site. + :vartype custom_domains: list[str] + :param repository_token: A user's github repository token. This is used to setup the Github + Actions workflow file and API secrets. + :type repository_token: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: ~azure.mgmt.web.v2020_09_01.models.StaticSiteBuildProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'default_hostname': {'readonly': True}, + 'custom_domains': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'default_hostname': {'key': 'properties.defaultHostname', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'custom_domains': {'key': 'properties.customDomains', 'type': '[str]'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + repository_url: Optional[str] = None, + branch: Optional[str] = None, + repository_token: Optional[str] = None, + build_properties: Optional["StaticSiteBuildProperties"] = None, + **kwargs + ): + super(StaticSitePatchResource, self).__init__(kind=kind, **kwargs) + self.default_hostname = None + self.repository_url = repository_url + self.branch = branch + self.custom_domains = None + self.repository_token = repository_token + self.build_properties = build_properties + + +class StaticSiteResetPropertiesARMResource(ProxyOnlyResource): + """Static Site Reset Properties ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param repository_token: The token which proves admin privileges to the repository. + :type repository_token: str + :param should_update_repository: Determines whether the repository should be updated with the + new properties. + :type should_update_repository: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'should_update_repository': {'key': 'properties.shouldUpdateRepository', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + repository_token: Optional[str] = None, + should_update_repository: Optional[bool] = None, + **kwargs + ): + super(StaticSiteResetPropertiesARMResource, self).__init__(kind=kind, **kwargs) + self.repository_token = repository_token + self.should_update_repository = should_update_repository + + +class StaticSitesWorkflowPreview(ProxyOnlyResource): + """Preview for the Static Site Workflow to be generated. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar path: The path for the workflow file to be generated. + :vartype path: str + :ivar contents: The contents for the workflow file to be generated. + :vartype contents: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'path': {'readonly': True}, + 'contents': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'contents': {'key': 'properties.contents', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(StaticSitesWorkflowPreview, self).__init__(kind=kind, **kwargs) + self.path = None + self.contents = None + + +class StaticSitesWorkflowPreviewRequest(ProxyOnlyResource): + """Request entity for previewing the Static Site workflow. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: ~azure.mgmt.web.v2020_09_01.models.StaticSiteBuildProperties + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + repository_url: Optional[str] = None, + branch: Optional[str] = None, + build_properties: Optional["StaticSiteBuildProperties"] = None, + **kwargs + ): + super(StaticSitesWorkflowPreviewRequest, self).__init__(kind=kind, **kwargs) + self.repository_url = repository_url + self.branch = branch + self.build_properties = build_properties + + +class StaticSiteUserARMResource(ProxyOnlyResource): + """Static Site User ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar provider: The identity provider for the static site user. + :vartype provider: str + :ivar user_id: The user id for the static site user. + :vartype user_id: str + :ivar display_name: The display name for the static site user. + :vartype display_name: str + :param roles: The roles for the static site user, in free-form string format. + :type roles: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provider': {'readonly': True}, + 'user_id': {'readonly': True}, + 'display_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + roles: Optional[str] = None, + **kwargs + ): + super(StaticSiteUserARMResource, self).__init__(kind=kind, **kwargs) + self.provider = None + self.user_id = None + self.display_name = None + self.roles = roles + + +class StaticSiteUserCollection(msrest.serialization.Model): + """Collection of static site custom users. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.StaticSiteUserARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteUserARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["StaticSiteUserARMResource"], + **kwargs + ): + super(StaticSiteUserCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StaticSiteUserInvitationRequestResource(ProxyOnlyResource): + """Static sites user roles invitation resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param domain: The domain name for the static site custom domain. + :type domain: str + :param provider: The identity provider for the static site user. + :type provider: str + :param user_details: The user id for the static site user. + :type user_details: str + :param roles: The roles for the static site user, in free-form string format. + :type roles: str + :param num_hours_to_expiration: The number of hours the sas token stays valid. + :type num_hours_to_expiration: int + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'domain': {'key': 'properties.domain', 'type': 'str'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + 'user_details': {'key': 'properties.userDetails', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': 'str'}, + 'num_hours_to_expiration': {'key': 'properties.numHoursToExpiration', 'type': 'int'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + domain: Optional[str] = None, + provider: Optional[str] = None, + user_details: Optional[str] = None, + roles: Optional[str] = None, + num_hours_to_expiration: Optional[int] = None, + **kwargs + ): + super(StaticSiteUserInvitationRequestResource, self).__init__(kind=kind, **kwargs) + self.domain = domain + self.provider = provider + self.user_details = user_details + self.roles = roles + self.num_hours_to_expiration = num_hours_to_expiration + + +class StaticSiteUserInvitationResponseResource(ProxyOnlyResource): + """Static sites user roles invitation link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar expires_on: The expiration time of the invitation. + :vartype expires_on: ~datetime.datetime + :ivar invitation_url: The url for the invitation link. + :vartype invitation_url: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'expires_on': {'readonly': True}, + 'invitation_url': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'expires_on': {'key': 'properties.expiresOn', 'type': 'iso-8601'}, + 'invitation_url': {'key': 'properties.invitationUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(StaticSiteUserInvitationResponseResource, self).__init__(kind=kind, **kwargs) + self.expires_on = None + self.invitation_url = None + + +class StatusCodesBasedTrigger(msrest.serialization.Model): + """Trigger based on status code. + + :param status: HTTP status code. + :type status: int + :param sub_status: Request Sub Status. + :type sub_status: int + :param win32_status: Win32 error code. + :type win32_status: int + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'int'}, + 'sub_status': {'key': 'subStatus', 'type': 'int'}, + 'win32_status': {'key': 'win32Status', 'type': 'int'}, + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[int] = None, + sub_status: Optional[int] = None, + win32_status: Optional[int] = None, + count: Optional[int] = None, + time_interval: Optional[str] = None, + **kwargs + ): + super(StatusCodesBasedTrigger, self).__init__(**kwargs) + self.status = status + self.sub_status = sub_status + self.win32_status = win32_status + self.count = count + self.time_interval = time_interval + + +class StorageMigrationOptions(ProxyOnlyResource): + """Options for app content migration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param azurefiles_connection_string: AzureFiles connection string. + :type azurefiles_connection_string: str + :param azurefiles_share: AzureFiles share. + :type azurefiles_share: str + :param switch_site_after_migration: :code:`true`if the app should be switched + over; otherwise, :code:`false`. + :type switch_site_after_migration: bool + :param block_write_access_to_site: :code:`true` if the app should be read only + during copy operation; otherwise, :code:`false`. + :type block_write_access_to_site: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'azurefiles_connection_string': {'key': 'properties.azurefilesConnectionString', 'type': 'str'}, + 'azurefiles_share': {'key': 'properties.azurefilesShare', 'type': 'str'}, + 'switch_site_after_migration': {'key': 'properties.switchSiteAfterMigration', 'type': 'bool'}, + 'block_write_access_to_site': {'key': 'properties.blockWriteAccessToSite', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + azurefiles_connection_string: Optional[str] = None, + azurefiles_share: Optional[str] = None, + switch_site_after_migration: Optional[bool] = False, + block_write_access_to_site: Optional[bool] = False, + **kwargs + ): + super(StorageMigrationOptions, self).__init__(kind=kind, **kwargs) + self.azurefiles_connection_string = azurefiles_connection_string + self.azurefiles_share = azurefiles_share + self.switch_site_after_migration = switch_site_after_migration + self.block_write_access_to_site = block_write_access_to_site + + +class StorageMigrationResponse(ProxyOnlyResource): + """Response for a migration of app content request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar operation_id: When server starts the migration process, it will return an operation ID + identifying that particular migration operation. + :vartype operation_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'operation_id': {'key': 'properties.operationId', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(StorageMigrationResponse, self).__init__(kind=kind, **kwargs) + self.operation_id = None + + +class StringDictionary(ProxyOnlyResource): + """String dictionary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param properties: Settings. + :type properties: dict[str, 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + properties: Optional[Dict[str, str]] = None, + **kwargs + ): + super(StringDictionary, self).__init__(kind=kind, **kwargs) + self.properties = properties + + +class SwiftVirtualNetwork(ProxyOnlyResource): + """Swift Virtual Network Contract. This is used to enable the new Swift way of doing virtual network integration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param subnet_resource_id: The Virtual Network subnet's resource ID. This is the subnet that + this Web App will join. This subnet must have a delegation to Microsoft.Web/serverFarms defined + first. + :type subnet_resource_id: str + :param swift_supported: A flag that specifies if the scale unit this Web App is on supports + Swift integration. + :type swift_supported: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'subnet_resource_id': {'key': 'properties.subnetResourceId', 'type': 'str'}, + 'swift_supported': {'key': 'properties.swiftSupported', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + subnet_resource_id: Optional[str] = None, + swift_supported: Optional[bool] = None, + **kwargs + ): + super(SwiftVirtualNetwork, self).__init__(kind=kind, **kwargs) + self.subnet_resource_id = subnet_resource_id + self.swift_supported = swift_supported + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.web.v2020_09_01.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.web.v2020_09_01.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type 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, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__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 TldLegalAgreement(msrest.serialization.Model): + """Legal agreement for a top level domain. + + All required parameters must be populated in order to send to Azure. + + :param agreement_key: Required. Unique identifier for the agreement. + :type agreement_key: str + :param title: Required. Agreement title. + :type title: str + :param content: Required. Agreement details. + :type content: str + :param url: URL where a copy of the agreement details is hosted. + :type url: str + """ + + _validation = { + 'agreement_key': {'required': True}, + 'title': {'required': True}, + 'content': {'required': True}, + } + + _attribute_map = { + 'agreement_key': {'key': 'agreementKey', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'}, + 'content': {'key': 'content', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__( + self, + *, + agreement_key: str, + title: str, + content: str, + url: Optional[str] = None, + **kwargs + ): + super(TldLegalAgreement, self).__init__(**kwargs) + self.agreement_key = agreement_key + self.title = title + self.content = content + self.url = url + + +class TldLegalAgreementCollection(msrest.serialization.Model): + """Collection of top-level domain legal agreements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.TldLegalAgreement] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TldLegalAgreement]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["TldLegalAgreement"], + **kwargs + ): + super(TldLegalAgreementCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class TokenStore(ProxyOnlyResource): + """TokenStore. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param enabled: + :type enabled: bool + :param token_refresh_extension_hours: + :type token_refresh_extension_hours: float + :param file_system: + :type file_system: ~azure.mgmt.web.v2020_09_01.models.FileSystemTokenStore + :param azure_blob_storage: + :type azure_blob_storage: ~azure.mgmt.web.v2020_09_01.models.BlobStorageTokenStore + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'token_refresh_extension_hours': {'key': 'properties.tokenRefreshExtensionHours', 'type': 'float'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'FileSystemTokenStore'}, + 'azure_blob_storage': {'key': 'properties.azureBlobStorage', 'type': 'BlobStorageTokenStore'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + token_refresh_extension_hours: Optional[float] = None, + file_system: Optional["FileSystemTokenStore"] = None, + azure_blob_storage: Optional["BlobStorageTokenStore"] = None, + **kwargs + ): + super(TokenStore, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.token_refresh_extension_hours = token_refresh_extension_hours + self.file_system = file_system + self.azure_blob_storage = azure_blob_storage + + +class TopLevelDomain(ProxyOnlyResource): + """A top level domain object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param privacy: If :code:`true`, then the top level domain supports domain + privacy; otherwise, :code:`false`. + :type privacy: bool + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + privacy: Optional[bool] = None, + **kwargs + ): + super(TopLevelDomain, self).__init__(kind=kind, **kwargs) + self.privacy = privacy + + +class TopLevelDomainAgreementOption(msrest.serialization.Model): + """Options for retrieving the list of top level domain legal agreements. + + :param include_privacy: If :code:`true`, then the list of agreements will include + agreements for domain privacy as well; otherwise, :code:`false`. + :type include_privacy: bool + :param for_transfer: If :code:`true`, then the list of agreements will include + agreements for domain transfer as well; otherwise, :code:`false`. + :type for_transfer: bool + """ + + _attribute_map = { + 'include_privacy': {'key': 'includePrivacy', 'type': 'bool'}, + 'for_transfer': {'key': 'forTransfer', 'type': 'bool'}, + } + + def __init__( + self, + *, + include_privacy: Optional[bool] = None, + for_transfer: Optional[bool] = None, + **kwargs + ): + super(TopLevelDomainAgreementOption, self).__init__(**kwargs) + self.include_privacy = include_privacy + self.for_transfer = for_transfer + + +class TopLevelDomainCollection(msrest.serialization.Model): + """Collection of Top-level domains. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.TopLevelDomain] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TopLevelDomain]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["TopLevelDomain"], + **kwargs + ): + super(TopLevelDomainCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class TriggeredJobHistory(ProxyOnlyResource): + """Triggered Web Job History. List of Triggered Web Job Run Information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param runs: List of triggered web job runs. + :type runs: list[~azure.mgmt.web.v2020_09_01.models.TriggeredJobRun] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'runs': {'key': 'properties.runs', 'type': '[TriggeredJobRun]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + runs: Optional[List["TriggeredJobRun"]] = None, + **kwargs + ): + super(TriggeredJobHistory, self).__init__(kind=kind, **kwargs) + self.runs = runs + + +class TriggeredJobHistoryCollection(msrest.serialization.Model): + """Collection of Kudu continuous web job information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.TriggeredJobHistory] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TriggeredJobHistory]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["TriggeredJobHistory"], + **kwargs + ): + super(TriggeredJobHistoryCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class TriggeredJobRun(ProxyOnlyResource): + """Triggered Web Job Run Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param web_job_id: Job ID. + :type web_job_id: str + :param web_job_name: Job name. + :type web_job_name: str + :param status: Job status. Possible values include: "Success", "Failed", "Error". + :type status: str or ~azure.mgmt.web.v2020_09_01.models.TriggeredWebJobStatus + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param end_time: End time. + :type end_time: ~datetime.datetime + :param duration: Job duration. + :type duration: str + :param output_url: Output URL. + :type output_url: str + :param error_url: Error URL. + :type error_url: str + :param url: Job URL. + :type url: str + :param job_name: Job name. + :type job_name: str + :param trigger: Job trigger. + :type trigger: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'web_job_id': {'key': 'properties.web_job_id', 'type': 'str'}, + 'web_job_name': {'key': 'properties.web_job_name', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.end_time', 'type': 'iso-8601'}, + 'duration': {'key': 'properties.duration', 'type': 'str'}, + 'output_url': {'key': 'properties.output_url', 'type': 'str'}, + 'error_url': {'key': 'properties.error_url', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'job_name': {'key': 'properties.job_name', 'type': 'str'}, + 'trigger': {'key': 'properties.trigger', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + web_job_id: Optional[str] = None, + web_job_name: Optional[str] = None, + status: Optional[Union[str, "TriggeredWebJobStatus"]] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + duration: Optional[str] = None, + output_url: Optional[str] = None, + error_url: Optional[str] = None, + url: Optional[str] = None, + job_name: Optional[str] = None, + trigger: Optional[str] = None, + **kwargs + ): + super(TriggeredJobRun, self).__init__(kind=kind, **kwargs) + self.web_job_id = web_job_id + self.web_job_name = web_job_name + self.status = status + self.start_time = start_time + self.end_time = end_time + self.duration = duration + self.output_url = output_url + self.error_url = error_url + self.url = url + self.job_name = job_name + self.trigger = trigger + + +class TriggeredWebJob(ProxyOnlyResource): + """Triggered Web Job Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param latest_run: Latest job run information. + :type latest_run: ~azure.mgmt.web.v2020_09_01.models.TriggeredJobRun + :param history_url: History URL. + :type history_url: str + :param scheduler_logs_url: Scheduler Logs URL. + :type scheduler_logs_url: str + :param run_command: Run command. + :type run_command: str + :param url: Job URL. + :type url: str + :param extra_info_url: Extra Info URL. + :type extra_info_url: str + :param web_job_type: Job type. Possible values include: "Continuous", "Triggered". + :type web_job_type: str or ~azure.mgmt.web.v2020_09_01.models.WebJobType + :param error: Error information. + :type error: str + :param using_sdk: Using SDK?. + :type using_sdk: bool + :param settings: Job settings. + :type settings: dict[str, object] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'latest_run': {'key': 'properties.latest_run', 'type': 'TriggeredJobRun'}, + 'history_url': {'key': 'properties.history_url', 'type': 'str'}, + 'scheduler_logs_url': {'key': 'properties.scheduler_logs_url', 'type': 'str'}, + 'run_command': {'key': 'properties.run_command', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'extra_info_url': {'key': 'properties.extra_info_url', 'type': 'str'}, + 'web_job_type': {'key': 'properties.web_job_type', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'str'}, + 'using_sdk': {'key': 'properties.using_sdk', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': '{object}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + latest_run: Optional["TriggeredJobRun"] = None, + history_url: Optional[str] = None, + scheduler_logs_url: Optional[str] = None, + run_command: Optional[str] = None, + url: Optional[str] = None, + extra_info_url: Optional[str] = None, + web_job_type: Optional[Union[str, "WebJobType"]] = None, + error: Optional[str] = None, + using_sdk: Optional[bool] = None, + settings: Optional[Dict[str, object]] = None, + **kwargs + ): + super(TriggeredWebJob, self).__init__(kind=kind, **kwargs) + self.latest_run = latest_run + self.history_url = history_url + self.scheduler_logs_url = scheduler_logs_url + self.run_command = run_command + self.url = url + self.extra_info_url = extra_info_url + self.web_job_type = web_job_type + self.error = error + self.using_sdk = using_sdk + self.settings = settings + + +class TriggeredWebJobCollection(msrest.serialization.Model): + """Collection of Kudu continuous web job information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.TriggeredWebJob] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TriggeredWebJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["TriggeredWebJob"], + **kwargs + ): + super(TriggeredWebJobCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class Twitter(ProxyOnlyResource): + """Twitter. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param enabled: + :type enabled: bool + :param registration: + :type registration: ~azure.mgmt.web.v2020_09_01.models.TwitterRegistration + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'registration': {'key': 'properties.registration', 'type': 'TwitterRegistration'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + registration: Optional["TwitterRegistration"] = None, + **kwargs + ): + super(Twitter, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.registration = registration + + +class TwitterRegistration(ProxyOnlyResource): + """TwitterRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param consumer_key: + :type consumer_key: str + :param consumer_secret_setting_name: + :type consumer_secret_setting_name: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'consumer_key': {'key': 'properties.consumerKey', 'type': 'str'}, + 'consumer_secret_setting_name': {'key': 'properties.consumerSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + consumer_key: Optional[str] = None, + consumer_secret_setting_name: Optional[str] = None, + **kwargs + ): + super(TwitterRegistration, self).__init__(kind=kind, **kwargs) + self.consumer_key = consumer_key + self.consumer_secret_setting_name = consumer_secret_setting_name + + +class Usage(ProxyOnlyResource): + """Usage of the quota resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :ivar display_name: Friendly name shown in the UI. + :vartype display_name: str + :ivar resource_name: Name of the quota resource. + :vartype resource_name: str + :ivar unit: Units of measurement for the quota resource. + :vartype unit: str + :ivar current_value: The current value of the resource counter. + :vartype current_value: long + :ivar limit: The resource limit. + :vartype limit: long + :ivar next_reset_time: Next reset time for the resource counter. + :vartype next_reset_time: ~datetime.datetime + :ivar compute_mode: Compute mode used for this usage. Possible values include: "Shared", + "Dedicated", "Dynamic". + :vartype compute_mode: str or ~azure.mgmt.web.v2020_09_01.models.ComputeModeOptions + :ivar site_mode: Site mode used for this usage. + :vartype site_mode: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'display_name': {'readonly': True}, + 'resource_name': {'readonly': True}, + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'next_reset_time': {'readonly': True}, + 'compute_mode': {'readonly': True}, + 'site_mode': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'resource_name': {'key': 'properties.resourceName', 'type': 'str'}, + 'unit': {'key': 'properties.unit', 'type': 'str'}, + 'current_value': {'key': 'properties.currentValue', 'type': 'long'}, + 'limit': {'key': 'properties.limit', 'type': 'long'}, + 'next_reset_time': {'key': 'properties.nextResetTime', 'type': 'iso-8601'}, + 'compute_mode': {'key': 'properties.computeMode', 'type': 'str'}, + 'site_mode': {'key': 'properties.siteMode', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(Usage, self).__init__(kind=kind, **kwargs) + self.display_name = None + self.resource_name = None + self.unit = None + self.current_value = None + self.limit = None + self.next_reset_time = None + self.compute_mode = None + self.site_mode = None + + +class UsageCollection(msrest.serialization.Model): + """Collection of usages. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.Usage] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Usage"], + **kwargs + ): + super(UsageCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class User(ProxyOnlyResource): + """User credentials used for publishing activity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param publishing_user_name: Username used for publishing. + :type publishing_user_name: str + :param publishing_password: Password used for publishing. + :type publishing_password: str + :param publishing_password_hash: Password hash used for publishing. + :type publishing_password_hash: str + :param publishing_password_hash_salt: Password hash salt used for publishing. + :type publishing_password_hash_salt: str + :param scm_uri: Url of SCM site. + :type scm_uri: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'publishing_user_name': {'key': 'properties.publishingUserName', 'type': 'str'}, + 'publishing_password': {'key': 'properties.publishingPassword', 'type': 'str'}, + 'publishing_password_hash': {'key': 'properties.publishingPasswordHash', 'type': 'str'}, + 'publishing_password_hash_salt': {'key': 'properties.publishingPasswordHashSalt', 'type': 'str'}, + 'scm_uri': {'key': 'properties.scmUri', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + publishing_user_name: Optional[str] = None, + publishing_password: Optional[str] = None, + publishing_password_hash: Optional[str] = None, + publishing_password_hash_salt: Optional[str] = None, + scm_uri: Optional[str] = None, + **kwargs + ): + super(User, self).__init__(kind=kind, **kwargs) + self.publishing_user_name = publishing_user_name + self.publishing_password = publishing_password + self.publishing_password_hash = publishing_password_hash + self.publishing_password_hash_salt = publishing_password_hash_salt + self.scm_uri = scm_uri + + +class ValidateRequest(msrest.serialization.Model): + """Resource validation request content. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name to verify. + :type name: str + :param type: Required. Resource type used for verification. Possible values include: + "ServerFarm", "Site". + :type type: str or ~azure.mgmt.web.v2020_09_01.models.ValidateResourceTypes + :param location: Required. Expected location of the resource. + :type location: str + :param server_farm_id: ARM resource ID of an App Service plan that would host the app. + :type server_farm_id: str + :param sku_name: Name of the target SKU for the App Service plan. + :type sku_name: str + :param need_linux_workers: :code:`true` if App Service plan is for Linux workers; + otherwise, :code:`false`. + :type need_linux_workers: bool + :param is_spot: :code:`true` if App Service plan is for Spot instances; otherwise, + :code:`false`. + :type is_spot: bool + :param capacity: Target capacity of the App Service plan (number of VMs). + :type capacity: int + :param hosting_environment: Name of App Service Environment where app or App Service plan + should be created. + :type hosting_environment: str + :param is_xenon: :code:`true` if App Service plan is running as a windows + container. + :type is_xenon: bool + :param container_registry_base_url: Base URL of the container registry. + :type container_registry_base_url: str + :param container_registry_username: Username for to access the container registry. + :type container_registry_username: str + :param container_registry_password: Password for to access the container registry. + :type container_registry_password: str + :param container_image_repository: Repository name (image name). + :type container_image_repository: str + :param container_image_tag: Image tag. + :type container_image_tag: str + :param container_image_platform: Platform (windows or linux). + :type container_image_platform: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + 'location': {'required': True}, + 'capacity': {'minimum': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'sku_name': {'key': 'properties.skuName', 'type': 'str'}, + 'need_linux_workers': {'key': 'properties.needLinuxWorkers', 'type': 'bool'}, + 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, + 'capacity': {'key': 'properties.capacity', 'type': 'int'}, + 'hosting_environment': {'key': 'properties.hostingEnvironment', 'type': 'str'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'container_registry_base_url': {'key': 'properties.containerRegistryBaseUrl', 'type': 'str'}, + 'container_registry_username': {'key': 'properties.containerRegistryUsername', 'type': 'str'}, + 'container_registry_password': {'key': 'properties.containerRegistryPassword', 'type': 'str'}, + 'container_image_repository': {'key': 'properties.containerImageRepository', 'type': 'str'}, + 'container_image_tag': {'key': 'properties.containerImageTag', 'type': 'str'}, + 'container_image_platform': {'key': 'properties.containerImagePlatform', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + type: Union[str, "ValidateResourceTypes"], + location: str, + server_farm_id: Optional[str] = None, + sku_name: Optional[str] = None, + need_linux_workers: Optional[bool] = None, + is_spot: Optional[bool] = None, + capacity: Optional[int] = None, + hosting_environment: Optional[str] = None, + is_xenon: Optional[bool] = None, + container_registry_base_url: Optional[str] = None, + container_registry_username: Optional[str] = None, + container_registry_password: Optional[str] = None, + container_image_repository: Optional[str] = None, + container_image_tag: Optional[str] = None, + container_image_platform: Optional[str] = None, + **kwargs + ): + super(ValidateRequest, self).__init__(**kwargs) + self.name = name + self.type = type + self.location = location + self.server_farm_id = server_farm_id + self.sku_name = sku_name + self.need_linux_workers = need_linux_workers + self.is_spot = is_spot + self.capacity = capacity + self.hosting_environment = hosting_environment + self.is_xenon = is_xenon + self.container_registry_base_url = container_registry_base_url + self.container_registry_username = container_registry_username + self.container_registry_password = container_registry_password + self.container_image_repository = container_image_repository + self.container_image_tag = container_image_tag + self.container_image_platform = container_image_platform + + +class ValidateResponse(msrest.serialization.Model): + """Describes the result of resource validation. + + :param status: Result of validation. + :type status: str + :param error: Error details for the case when validation fails. + :type error: ~azure.mgmt.web.v2020_09_01.models.ValidateResponseError + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ValidateResponseError'}, + } + + def __init__( + self, + *, + status: Optional[str] = None, + error: Optional["ValidateResponseError"] = None, + **kwargs + ): + super(ValidateResponse, self).__init__(**kwargs) + self.status = status + self.error = error + + +class ValidateResponseError(msrest.serialization.Model): + """Error details for when validation fails. + + :param code: Validation error code. + :type code: str + :param message: Validation error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ValidateResponseError, self).__init__(**kwargs) + self.code = code + self.message = message + + +class VirtualApplication(msrest.serialization.Model): + """Virtual application in an app. + + :param virtual_path: Virtual path. + :type virtual_path: str + :param physical_path: Physical path. + :type physical_path: str + :param preload_enabled: :code:`true` if preloading is enabled; otherwise, + :code:`false`. + :type preload_enabled: bool + :param virtual_directories: Virtual directories for virtual application. + :type virtual_directories: list[~azure.mgmt.web.v2020_09_01.models.VirtualDirectory] + """ + + _attribute_map = { + 'virtual_path': {'key': 'virtualPath', 'type': 'str'}, + 'physical_path': {'key': 'physicalPath', 'type': 'str'}, + 'preload_enabled': {'key': 'preloadEnabled', 'type': 'bool'}, + 'virtual_directories': {'key': 'virtualDirectories', 'type': '[VirtualDirectory]'}, + } + + def __init__( + self, + *, + virtual_path: Optional[str] = None, + physical_path: Optional[str] = None, + preload_enabled: Optional[bool] = None, + virtual_directories: Optional[List["VirtualDirectory"]] = None, + **kwargs + ): + super(VirtualApplication, self).__init__(**kwargs) + self.virtual_path = virtual_path + self.physical_path = physical_path + self.preload_enabled = preload_enabled + self.virtual_directories = virtual_directories + + +class VirtualDirectory(msrest.serialization.Model): + """Directory for virtual application. + + :param virtual_path: Path to virtual application. + :type virtual_path: str + :param physical_path: Physical path. + :type physical_path: str + """ + + _attribute_map = { + 'virtual_path': {'key': 'virtualPath', 'type': 'str'}, + 'physical_path': {'key': 'physicalPath', 'type': 'str'}, + } + + def __init__( + self, + *, + virtual_path: Optional[str] = None, + physical_path: Optional[str] = None, + **kwargs + ): + super(VirtualDirectory, self).__init__(**kwargs) + self.virtual_path = virtual_path + self.physical_path = physical_path + + +class VirtualIPMapping(msrest.serialization.Model): + """Virtual IP mapping. + + :param virtual_ip: Virtual IP address. + :type virtual_ip: str + :param internal_http_port: Internal HTTP port. + :type internal_http_port: int + :param internal_https_port: Internal HTTPS port. + :type internal_https_port: int + :param in_use: Is virtual IP mapping in use. + :type in_use: bool + :param service_name: name of the service that virtual IP is assigned to. + :type service_name: str + """ + + _attribute_map = { + 'virtual_ip': {'key': 'virtualIP', 'type': 'str'}, + 'internal_http_port': {'key': 'internalHttpPort', 'type': 'int'}, + 'internal_https_port': {'key': 'internalHttpsPort', 'type': 'int'}, + 'in_use': {'key': 'inUse', 'type': 'bool'}, + 'service_name': {'key': 'serviceName', 'type': 'str'}, + } + + def __init__( + self, + *, + virtual_ip: Optional[str] = None, + internal_http_port: Optional[int] = None, + internal_https_port: Optional[int] = None, + in_use: Optional[bool] = None, + service_name: Optional[str] = None, + **kwargs + ): + super(VirtualIPMapping, self).__init__(**kwargs) + self.virtual_ip = virtual_ip + self.internal_http_port = internal_http_port + self.internal_https_port = internal_https_port + self.in_use = in_use + self.service_name = service_name + + +class VirtualNetworkProfile(msrest.serialization.Model): + """Specification for using a Virtual Network. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource id of the Virtual Network. + :type id: str + :ivar name: Name of the Virtual Network (read-only). + :vartype name: str + :ivar type: Resource type of the Virtual Network (read-only). + :vartype type: str + :param subnet: Subnet within the Virtual Network. + :type subnet: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + subnet: Optional[str] = None, + **kwargs + ): + super(VirtualNetworkProfile, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + self.subnet = subnet + + +class VnetGateway(ProxyOnlyResource): + """The Virtual Network gateway contract. This is used to give the Virtual Network gateway access to the VPN package. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param vnet_name: The Virtual Network name. + :type vnet_name: str + :param vpn_package_uri: The URI where the VPN package can be downloaded. + :type vpn_package_uri: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vpn_package_uri': {'key': 'properties.vpnPackageUri', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + vnet_name: Optional[str] = None, + vpn_package_uri: Optional[str] = None, + **kwargs + ): + super(VnetGateway, self).__init__(kind=kind, **kwargs) + self.vnet_name = vnet_name + self.vpn_package_uri = vpn_package_uri + + +class VnetInfo(ProxyOnlyResource): + """Virtual Network information contract. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param vnet_resource_id: The Virtual Network's resource ID. + :type vnet_resource_id: str + :ivar cert_thumbprint: The client certificate thumbprint. + :vartype cert_thumbprint: str + :param cert_blob: A certificate file (.cer) blob containing the public key of the private key + used to authenticate a + Point-To-Site VPN connection. + :type cert_blob: str + :ivar routes: The routes that this Virtual Network connection uses. + :vartype routes: list[~azure.mgmt.web.v2020_09_01.models.VnetRoute] + :ivar resync_required: :code:`true` if a resync is required; otherwise, + :code:`false`. + :vartype resync_required: bool + :param dns_servers: DNS servers to be used by this Virtual Network. This should be a comma- + separated list of IP addresses. + :type dns_servers: str + :param is_swift: Flag that is used to denote if this is VNET injection. + :type is_swift: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'cert_thumbprint': {'readonly': True}, + 'routes': {'readonly': True}, + 'resync_required': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'vnet_resource_id': {'key': 'properties.vnetResourceId', 'type': 'str'}, + 'cert_thumbprint': {'key': 'properties.certThumbprint', 'type': 'str'}, + 'cert_blob': {'key': 'properties.certBlob', 'type': 'str'}, + 'routes': {'key': 'properties.routes', 'type': '[VnetRoute]'}, + 'resync_required': {'key': 'properties.resyncRequired', 'type': 'bool'}, + 'dns_servers': {'key': 'properties.dnsServers', 'type': 'str'}, + 'is_swift': {'key': 'properties.isSwift', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + vnet_resource_id: Optional[str] = None, + cert_blob: Optional[str] = None, + dns_servers: Optional[str] = None, + is_swift: Optional[bool] = None, + **kwargs + ): + super(VnetInfo, self).__init__(kind=kind, **kwargs) + self.vnet_resource_id = vnet_resource_id + self.cert_thumbprint = None + self.cert_blob = cert_blob + self.routes = None + self.resync_required = None + self.dns_servers = dns_servers + self.is_swift = is_swift + + +class VnetParameters(ProxyOnlyResource): + """The required set of inputs to validate a VNET. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param vnet_resource_group: The Resource Group of the VNET to be validated. + :type vnet_resource_group: str + :param vnet_name: The name of the VNET to be validated. + :type vnet_name: str + :param vnet_subnet_name: The subnet name to be validated. + :type vnet_subnet_name: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'vnet_resource_group': {'key': 'properties.vnetResourceGroup', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'properties.vnetSubnetName', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + vnet_resource_group: Optional[str] = None, + vnet_name: Optional[str] = None, + vnet_subnet_name: Optional[str] = None, + **kwargs + ): + super(VnetParameters, self).__init__(kind=kind, **kwargs) + self.vnet_resource_group = vnet_resource_group + self.vnet_name = vnet_name + self.vnet_subnet_name = vnet_subnet_name + + +class VnetRoute(ProxyOnlyResource): + """Virtual Network route contract used to pass routing information for a Virtual Network. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param start_address: The starting address for this route. This may also include a CIDR + notation, in which case the end address must not be specified. + :type start_address: str + :param end_address: The ending address for this route. If the start address is specified in + CIDR notation, this must be omitted. + :type end_address: str + :param route_type: The type of route this is: + DEFAULT - By default, every app has routes to the local address ranges specified by RFC1918 + INHERITED - Routes inherited from the real Virtual Network routes + STATIC - Static route set on the app only + + These values will be used for syncing an app's routes with those from a Virtual Network. + Possible values include: "DEFAULT", "INHERITED", "STATIC". + :type route_type: str or ~azure.mgmt.web.v2020_09_01.models.RouteType + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'start_address': {'key': 'properties.startAddress', 'type': 'str'}, + 'end_address': {'key': 'properties.endAddress', 'type': 'str'}, + 'route_type': {'key': 'properties.routeType', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + start_address: Optional[str] = None, + end_address: Optional[str] = None, + route_type: Optional[Union[str, "RouteType"]] = None, + **kwargs + ): + super(VnetRoute, self).__init__(kind=kind, **kwargs) + self.start_address = start_address + self.end_address = end_address + self.route_type = route_type + + +class VnetValidationFailureDetails(ProxyOnlyResource): + """A class that describes the reason for a validation failure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param failed: A flag describing whether or not validation failed. + :type failed: bool + :param failed_tests: A list of tests that failed in the validation. + :type failed_tests: list[~azure.mgmt.web.v2020_09_01.models.VnetValidationTestFailure] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'failed': {'key': 'properties.failed', 'type': 'bool'}, + 'failed_tests': {'key': 'properties.failedTests', 'type': '[VnetValidationTestFailure]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + failed: Optional[bool] = None, + failed_tests: Optional[List["VnetValidationTestFailure"]] = None, + **kwargs + ): + super(VnetValidationFailureDetails, self).__init__(kind=kind, **kwargs) + self.failed = failed + self.failed_tests = failed_tests + + +class VnetValidationTestFailure(ProxyOnlyResource): + """A class that describes a test that failed during NSG and UDR validation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param test_name: The name of the test that failed. + :type test_name: str + :param details: The details of what caused the failure, e.g. the blocking rule name, etc. + :type details: 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'test_name': {'key': 'properties.testName', 'type': 'str'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + test_name: Optional[str] = None, + details: Optional[str] = None, + **kwargs + ): + super(VnetValidationTestFailure, self).__init__(kind=kind, **kwargs) + self.test_name = test_name + self.details = details + + +class WebAppCollection(msrest.serialization.Model): + """Collection of App Service apps. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.Site] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Site]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Site"], + **kwargs + ): + super(WebAppCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class WebAppInstanceStatusCollection(msrest.serialization.Model): + """Collection of app instances. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.WebSiteInstanceStatus] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WebSiteInstanceStatus]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["WebSiteInstanceStatus"], + **kwargs + ): + super(WebAppInstanceStatusCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class WebJob(ProxyOnlyResource): + """Web Job Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param run_command: Run command. + :type run_command: str + :param url: Job URL. + :type url: str + :param extra_info_url: Extra Info URL. + :type extra_info_url: str + :param web_job_type: Job type. Possible values include: "Continuous", "Triggered". + :type web_job_type: str or ~azure.mgmt.web.v2020_09_01.models.WebJobType + :param error: Error information. + :type error: str + :param using_sdk: Using SDK?. + :type using_sdk: bool + :param settings: Job settings. + :type settings: dict[str, object] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'run_command': {'key': 'properties.run_command', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'extra_info_url': {'key': 'properties.extra_info_url', 'type': 'str'}, + 'web_job_type': {'key': 'properties.web_job_type', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'str'}, + 'using_sdk': {'key': 'properties.using_sdk', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': '{object}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + run_command: Optional[str] = None, + url: Optional[str] = None, + extra_info_url: Optional[str] = None, + web_job_type: Optional[Union[str, "WebJobType"]] = None, + error: Optional[str] = None, + using_sdk: Optional[bool] = None, + settings: Optional[Dict[str, object]] = None, + **kwargs + ): + super(WebJob, self).__init__(kind=kind, **kwargs) + self.run_command = run_command + self.url = url + self.extra_info_url = extra_info_url + self.web_job_type = web_job_type + self.error = error + self.using_sdk = using_sdk + self.settings = settings + + +class WebJobCollection(msrest.serialization.Model): + """Collection of Kudu web job information elements. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.WebJob] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WebJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["WebJob"], + **kwargs + ): + super(WebJobCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class WebSiteInstanceStatus(ProxyOnlyResource): + """WebSiteInstanceStatus. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param state: Possible values include: "READY", "STOPPED", "UNKNOWN". + :type state: str or ~azure.mgmt.web.v2020_09_01.models.SiteRuntimeState + :param status_url: Link to the GetStatusApi in Kudu. + :type status_url: str + :param detector_url: Link to the Diagnose and Solve Portal. + :type detector_url: str + :param console_url: Link to the console to web app instance. + :type console_url: str + :param health_check_url: Link to the console to web app instance. + :type health_check_url: str + :param containers: Dictionary of :code:``. + :type containers: dict[str, ~azure.mgmt.web.v2020_09_01.models.ContainerInfo] + """ + + _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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'status_url': {'key': 'properties.statusUrl', 'type': 'str'}, + 'detector_url': {'key': 'properties.detectorUrl', 'type': 'str'}, + 'console_url': {'key': 'properties.consoleUrl', 'type': 'str'}, + 'health_check_url': {'key': 'properties.healthCheckUrl', 'type': 'str'}, + 'containers': {'key': 'properties.containers', 'type': '{ContainerInfo}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + state: Optional[Union[str, "SiteRuntimeState"]] = None, + status_url: Optional[str] = None, + detector_url: Optional[str] = None, + console_url: Optional[str] = None, + health_check_url: Optional[str] = None, + containers: Optional[Dict[str, "ContainerInfo"]] = None, + **kwargs + ): + super(WebSiteInstanceStatus, self).__init__(kind=kind, **kwargs) + self.state = state + self.status_url = status_url + self.detector_url = detector_url + self.console_url = console_url + self.health_check_url = health_check_url + self.containers = containers + + +class WorkerPool(msrest.serialization.Model): + """Worker pool of an App Service Environment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param worker_size_id: Worker size ID for referencing this worker pool. + :type worker_size_id: int + :param compute_mode: Shared or dedicated app hosting. Possible values include: "Shared", + "Dedicated", "Dynamic". + :type compute_mode: str or ~azure.mgmt.web.v2020_09_01.models.ComputeModeOptions + :param worker_size: VM size of the worker pool instances. + :type worker_size: str + :param worker_count: Number of instances in the worker pool. + :type worker_count: int + :ivar instance_names: Names of all instances in the worker pool (read only). + :vartype instance_names: list[str] + """ + + _validation = { + 'instance_names': {'readonly': True}, + } + + _attribute_map = { + 'worker_size_id': {'key': 'workerSizeId', 'type': 'int'}, + 'compute_mode': {'key': 'computeMode', 'type': 'str'}, + 'worker_size': {'key': 'workerSize', 'type': 'str'}, + 'worker_count': {'key': 'workerCount', 'type': 'int'}, + 'instance_names': {'key': 'instanceNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + worker_size_id: Optional[int] = None, + compute_mode: Optional[Union[str, "ComputeModeOptions"]] = None, + worker_size: Optional[str] = None, + worker_count: Optional[int] = None, + **kwargs + ): + super(WorkerPool, self).__init__(**kwargs) + self.worker_size_id = worker_size_id + self.compute_mode = compute_mode + self.worker_size = worker_size + self.worker_count = worker_count + self.instance_names = None + + +class WorkerPoolCollection(msrest.serialization.Model): + """Collection of worker pools. + + 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. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkerPoolResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["WorkerPoolResource"], + **kwargs + ): + super(WorkerPoolCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class WorkerPoolResource(ProxyOnlyResource): + """Worker pool of an App Service Environment ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.web.v2020_09_01.models.SystemData + :param sku: Description of a SKU for a scalable resource. + :type sku: ~azure.mgmt.web.v2020_09_01.models.SkuDescription + :param worker_size_id: Worker size ID for referencing this worker pool. + :type worker_size_id: int + :param compute_mode: Shared or dedicated app hosting. Possible values include: "Shared", + "Dedicated", "Dynamic". + :type compute_mode: str or ~azure.mgmt.web.v2020_09_01.models.ComputeModeOptions + :param worker_size: VM size of the worker pool instances. + :type worker_size: str + :param worker_count: Number of instances in the worker pool. + :type worker_count: int + :ivar instance_names: Names of all instances in the worker pool (read only). + :vartype instance_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'instance_names': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'worker_size_id': {'key': 'properties.workerSizeId', 'type': 'int'}, + 'compute_mode': {'key': 'properties.computeMode', 'type': 'str'}, + 'worker_size': {'key': 'properties.workerSize', 'type': 'str'}, + 'worker_count': {'key': 'properties.workerCount', 'type': 'int'}, + 'instance_names': {'key': 'properties.instanceNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + sku: Optional["SkuDescription"] = None, + worker_size_id: Optional[int] = None, + compute_mode: Optional[Union[str, "ComputeModeOptions"]] = None, + worker_size: Optional[str] = None, + worker_count: Optional[int] = None, + **kwargs + ): + super(WorkerPoolResource, self).__init__(kind=kind, **kwargs) + self.sku = sku + self.worker_size_id = worker_size_id + self.compute_mode = compute_mode + self.worker_size = worker_size + self.worker_count = worker_count + self.instance_names = None diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/models/_web_site_management_client_enums.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/models/_web_site_management_client_enums.py new file mode 100644 index 000000000000..0e0a8d94b03a --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/models/_web_site_management_client_enums.py @@ -0,0 +1,760 @@ +# 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, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AccessControlEntryAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Action object. + """ + + PERMIT = "Permit" + DENY = "Deny" + +class AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REGISTRATION_STATUS_NOT_SUPPORTED_FOR_RENEWAL = "RegistrationStatusNotSupportedForRenewal" + EXPIRATION_NOT_IN_RENEWAL_TIME_RANGE = "ExpirationNotInRenewalTimeRange" + SUBSCRIPTION_NOT_ACTIVE = "SubscriptionNotActive" + +class AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REGISTRATION_STATUS_NOT_SUPPORTED_FOR_RENEWAL = "RegistrationStatusNotSupportedForRenewal" + EXPIRATION_NOT_IN_RENEWAL_TIME_RANGE = "ExpirationNotInRenewalTimeRange" + SUBSCRIPTION_NOT_ACTIVE = "SubscriptionNotActive" + +class AppServicePlanRestrictions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """App Service plans this offer is restricted to. + """ + + NONE = "None" + FREE = "Free" + SHARED = "Shared" + BASIC = "Basic" + STANDARD = "Standard" + PREMIUM = "Premium" + +class AutoHealActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Predefined action to be taken. + """ + + RECYCLE = "Recycle" + LOG_EVENT = "LogEvent" + CUSTOM_ACTION = "CustomAction" + +class AzureResourceType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the Azure resource the hostname is assigned to. + """ + + WEBSITE = "Website" + TRAFFIC_MANAGER = "TrafficManager" + +class AzureStorageState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """State of the storage account. + """ + + OK = "Ok" + INVALID_CREDENTIALS = "InvalidCredentials" + INVALID_SHARE = "InvalidShare" + +class AzureStorageType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of storage. + """ + + AZURE_FILES = "AzureFiles" + AZURE_BLOB = "AzureBlob" + +class BackupItemStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Backup status. + """ + + IN_PROGRESS = "InProgress" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + TIMED_OUT = "TimedOut" + CREATED = "Created" + SKIPPED = "Skipped" + PARTIALLY_SUCCEEDED = "PartiallySucceeded" + DELETE_IN_PROGRESS = "DeleteInProgress" + DELETE_FAILED = "DeleteFailed" + DELETED = "Deleted" + +class BackupRestoreOperationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Operation type. + """ + + DEFAULT = "Default" + CLONE = "Clone" + RELOCATION = "Relocation" + SNAPSHOT = "Snapshot" + CLOUD_FS = "CloudFS" + +class BuildStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of the static site build. + """ + + WAITING_FOR_DEPLOYMENT = "WaitingForDeployment" + UPLOADING = "Uploading" + DEPLOYING = "Deploying" + READY = "Ready" + FAILED = "Failed" + DELETING = "Deleting" + DETACHED = "Detached" + +class BuiltInAuthenticationProvider(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The default authentication provider to use when multiple providers are configured. + This setting is only needed if multiple providers are configured and the unauthenticated client + action is set to "RedirectToLoginPage". + """ + + AZURE_ACTIVE_DIRECTORY = "AzureActiveDirectory" + FACEBOOK = "Facebook" + GOOGLE = "Google" + MICROSOFT_ACCOUNT = "MicrosoftAccount" + TWITTER = "Twitter" + GITHUB = "Github" + +class CertificateOrderActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Action type. + """ + + CERTIFICATE_ISSUED = "CertificateIssued" + CERTIFICATE_ORDER_CANCELED = "CertificateOrderCanceled" + CERTIFICATE_ORDER_CREATED = "CertificateOrderCreated" + CERTIFICATE_REVOKED = "CertificateRevoked" + DOMAIN_VALIDATION_COMPLETE = "DomainValidationComplete" + FRAUD_DETECTED = "FraudDetected" + ORG_NAME_CHANGE = "OrgNameChange" + ORG_VALIDATION_COMPLETE = "OrgValidationComplete" + SAN_DROP = "SanDrop" + FRAUD_CLEARED = "FraudCleared" + CERTIFICATE_EXPIRED = "CertificateExpired" + CERTIFICATE_EXPIRATION_WARNING = "CertificateExpirationWarning" + FRAUD_DOCUMENTATION_REQUIRED = "FraudDocumentationRequired" + UNKNOWN = "Unknown" + +class CertificateOrderStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current order status. + """ + + PENDINGISSUANCE = "Pendingissuance" + ISSUED = "Issued" + REVOKED = "Revoked" + CANCELED = "Canceled" + DENIED = "Denied" + PENDINGREVOCATION = "Pendingrevocation" + PENDING_REKEY = "PendingRekey" + UNUSED = "Unused" + EXPIRED = "Expired" + NOT_SUBMITTED = "NotSubmitted" + +class CertificateProductType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Certificate product type. + """ + + STANDARD_DOMAIN_VALIDATED_SSL = "StandardDomainValidatedSsl" + STANDARD_DOMAIN_VALIDATED_WILD_CARD_SSL = "StandardDomainValidatedWildCardSsl" + +class Channels(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """List of channels that this recommendation can apply. + """ + + NOTIFICATION = "Notification" + API = "Api" + EMAIL = "Email" + WEBHOOK = "Webhook" + ALL = "All" + +class CheckNameResourceTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Resource type used for verification. + """ + + SITE = "Site" + SLOT = "Slot" + HOSTING_ENVIRONMENT = "HostingEnvironment" + PUBLISHING_USER = "PublishingUser" + MICROSOFT_WEB_SITES = "Microsoft.Web/sites" + MICROSOFT_WEB_SITES_SLOTS = "Microsoft.Web/sites/slots" + MICROSOFT_WEB_HOSTING_ENVIRONMENTS = "Microsoft.Web/hostingEnvironments" + MICROSOFT_WEB_PUBLISHING_USERS = "Microsoft.Web/publishingUsers" + +class ClientCertMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This composes with ClientCertEnabled setting. + + + * ClientCertEnabled: false means ClientCert is ignored. + * ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + * ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or + accepted. + """ + + REQUIRED = "Required" + OPTIONAL = "Optional" + +class CloneAbilityResult(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of app. + """ + + CLONEABLE = "Cloneable" + PARTIALLY_CLONEABLE = "PartiallyCloneable" + NOT_CLONEABLE = "NotCloneable" + +class ComputeModeOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Shared/dedicated workers. + """ + + SHARED = "Shared" + DEDICATED = "Dedicated" + DYNAMIC = "Dynamic" + +class ConnectionStringType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of database. + """ + + MY_SQL = "MySql" + SQL_SERVER = "SQLServer" + SQL_AZURE = "SQLAzure" + CUSTOM = "Custom" + NOTIFICATION_HUB = "NotificationHub" + SERVICE_BUS = "ServiceBus" + EVENT_HUB = "EventHub" + API_HUB = "ApiHub" + DOC_DB = "DocDb" + REDIS_CACHE = "RedisCache" + POSTGRE_SQL = "PostgreSQL" + +class ContinuousWebJobStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Job status. + """ + + INITIALIZING = "Initializing" + STARTING = "Starting" + RUNNING = "Running" + PENDING_RESTART = "PendingRestart" + STOPPED = "Stopped" + +class CookieExpirationConvention(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + FIXED_TIME = "FixedTime" + IDENTITY_PROVIDER_DERIVED = "IdentityProviderDerived" + +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class CustomHostNameDnsRecordType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the DNS record. + """ + + C_NAME = "CName" + A = "A" + +class DatabaseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Database type (e.g. SqlAzure / MySql). + """ + + SQL_AZURE = "SqlAzure" + MY_SQL = "MySql" + LOCAL_MY_SQL = "LocalMySql" + POSTGRE_SQL = "PostgreSql" + +class DnsType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current DNS type + """ + + AZURE_DNS = "AzureDns" + DEFAULT_DOMAIN_REGISTRAR_DNS = "DefaultDomainRegistrarDns" + +class DnsVerificationTestResult(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """DNS verification test result. + """ + + PASSED = "Passed" + FAILED = "Failed" + SKIPPED = "Skipped" + +class DomainPatchResourcePropertiesDomainNotRenewableReasonsItem(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REGISTRATION_STATUS_NOT_SUPPORTED_FOR_RENEWAL = "RegistrationStatusNotSupportedForRenewal" + EXPIRATION_NOT_IN_RENEWAL_TIME_RANGE = "ExpirationNotInRenewalTimeRange" + SUBSCRIPTION_NOT_ACTIVE = "SubscriptionNotActive" + +class DomainPropertiesDomainNotRenewableReasonsItem(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REGISTRATION_STATUS_NOT_SUPPORTED_FOR_RENEWAL = "RegistrationStatusNotSupportedForRenewal" + EXPIRATION_NOT_IN_RENEWAL_TIME_RANGE = "ExpirationNotInRenewalTimeRange" + SUBSCRIPTION_NOT_ACTIVE = "SubscriptionNotActive" + +class DomainStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Domain registration status. + """ + + ACTIVE = "Active" + AWAITING = "Awaiting" + CANCELLED = "Cancelled" + CONFISCATED = "Confiscated" + DISABLED = "Disabled" + EXCLUDED = "Excluded" + EXPIRED = "Expired" + FAILED = "Failed" + HELD = "Held" + LOCKED = "Locked" + PARKED = "Parked" + PENDING = "Pending" + RESERVED = "Reserved" + REVERTED = "Reverted" + SUSPENDED = "Suspended" + TRANSFERRED = "Transferred" + UNKNOWN = "Unknown" + UNLOCKED = "Unlocked" + UNPARKED = "Unparked" + UPDATED = "Updated" + JSON_CONVERTER_FAILED = "JsonConverterFailed" + +class DomainType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Valid values are Regular domain: Azure will charge the full price of domain registration, + SoftDeleted: Purchasing this domain will simply restore it and this operation will not cost + anything. + """ + + REGULAR = "Regular" + SOFT_DELETED = "SoftDeleted" + +class Enum5(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + WINDOWS = "Windows" + LINUX = "Linux" + WINDOWS_FUNCTIONS = "WindowsFunctions" + LINUX_FUNCTIONS = "LinuxFunctions" + +class Enum6(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + WINDOWS = "Windows" + LINUX = "Linux" + WINDOWS_FUNCTIONS = "WindowsFunctions" + LINUX_FUNCTIONS = "LinuxFunctions" + +class ForwardProxyConvention(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + NO_PROXY = "NoProxy" + STANDARD = "Standard" + CUSTOM = "Custom" + +class FrequencyUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The unit of time for how often the backup should be executed (e.g. for weekly backup, this + should be set to Day and FrequencyInterval should be set to 7) + """ + + DAY = "Day" + HOUR = "Hour" + +class FtpsState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """State of FTP / FTPS service + """ + + ALL_ALLOWED = "AllAllowed" + FTPS_ONLY = "FtpsOnly" + DISABLED = "Disabled" + +class HostingEnvironmentStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current status of the App Service Environment. + """ + + PREPARING = "Preparing" + READY = "Ready" + SCALING = "Scaling" + DELETING = "Deleting" + +class HostNameType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the hostname. + """ + + VERIFIED = "Verified" + MANAGED = "Managed" + +class HostType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Indicates whether the hostname is a standard or repository hostname. + """ + + STANDARD = "Standard" + REPOSITORY = "Repository" + +class InAvailabilityReasonType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """:code:`Invalid` indicates the name provided does not match Azure App Service + naming requirements. :code:`AlreadyExists` indicates that the name is already in + use and is therefore unavailable. + """ + + INVALID = "Invalid" + ALREADY_EXISTS = "AlreadyExists" + +class IpFilterTag(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Defines what this IP filter will be used for. This is to support IP filtering on proxies. + """ + + DEFAULT = "Default" + XFF_PROXY = "XffProxy" + SERVICE_TAG = "ServiceTag" + +class IssueType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Represents the type of the Detector + """ + + SERVICE_INCIDENT = "ServiceIncident" + APP_DEPLOYMENT = "AppDeployment" + APP_CRASH = "AppCrash" + RUNTIME_ISSUE_DETECTED = "RuntimeIssueDetected" + ASE_DEPLOYMENT = "AseDeployment" + USER_ISSUE = "UserIssue" + PLATFORM_ISSUE = "PlatformIssue" + OTHER = "Other" + +class KeyVaultSecretStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the Key Vault secret. + """ + + INITIALIZED = "Initialized" + WAITING_ON_CERTIFICATE_ORDER = "WaitingOnCertificateOrder" + SUCCEEDED = "Succeeded" + CERTIFICATE_ORDER_FAILED = "CertificateOrderFailed" + OPERATION_NOT_PERMITTED_ON_KEY_VAULT = "OperationNotPermittedOnKeyVault" + AZURE_SERVICE_UNAUTHORIZED_TO_ACCESS_KEY_VAULT = "AzureServiceUnauthorizedToAccessKeyVault" + KEY_VAULT_DOES_NOT_EXIST = "KeyVaultDoesNotExist" + KEY_VAULT_SECRET_DOES_NOT_EXIST = "KeyVaultSecretDoesNotExist" + UNKNOWN_ERROR = "UnknownError" + EXTERNAL_PRIVATE_KEY = "ExternalPrivateKey" + UNKNOWN = "Unknown" + +class LoadBalancingMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies which endpoints to serve internally in the Virtual Network for the App Service + Environment. + """ + + NONE = "None" + WEB = "Web" + PUBLISHING = "Publishing" + WEB_PUBLISHING = "Web,Publishing" + +class LogLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Log level. + """ + + OFF = "Off" + VERBOSE = "Verbose" + INFORMATION = "Information" + WARNING = "Warning" + ERROR = "Error" + +class ManagedPipelineMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Managed pipeline mode. + """ + + INTEGRATED = "Integrated" + CLASSIC = "Classic" + +class ManagedServiceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of managed service identity. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" + NONE = "None" + +class MSDeployLogEntryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Log entry type + """ + + MESSAGE = "Message" + WARNING = "Warning" + ERROR = "Error" + +class MSDeployProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Provisioning state + """ + + ACCEPTED = "accepted" + RUNNING = "running" + SUCCEEDED = "succeeded" + FAILED = "failed" + CANCELED = "canceled" + +class MySqlMigrationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of migration operation to be done + """ + + LOCAL_TO_REMOTE = "LocalToRemote" + REMOTE_TO_LOCAL = "RemoteToLocal" + +class NotificationLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Level indicating how critical this recommendation can impact. + """ + + CRITICAL = "Critical" + WARNING = "Warning" + INFORMATION = "Information" + NON_URGENT_SUGGESTION = "NonUrgentSuggestion" + +class OperationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current status of the operation. + """ + + IN_PROGRESS = "InProgress" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + TIMED_OUT = "TimedOut" + CREATED = "Created" + +class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of certificate order. + """ + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + IN_PROGRESS = "InProgress" + DELETING = "Deleting" + +class PublicCertificateLocation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Public Certificate Location + """ + + CURRENT_USER_MY = "CurrentUserMy" + LOCAL_MACHINE_MY = "LocalMachineMy" + UNKNOWN = "Unknown" + +class PublishingProfileFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of the format. Valid values are: + FileZilla3 + WebDeploy -- default + Ftp + """ + + FILE_ZILLA3 = "FileZilla3" + WEB_DEPLOY = "WebDeploy" + FTP = "Ftp" + +class RedundancyMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Site redundancy mode + """ + + NONE = "None" + MANUAL = "Manual" + FAILOVER = "Failover" + ACTIVE_ACTIVE = "ActiveActive" + GEO_REDUNDANT = "GeoRedundant" + +class RenderingType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Rendering Type + """ + + NO_GRAPH = "NoGraph" + TABLE = "Table" + TIME_SERIES = "TimeSeries" + TIME_SERIES_PER_INSTANCE = "TimeSeriesPerInstance" + +class ResourceScopeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of a resource type this recommendation applies, e.g. Subscription, ServerFarm, Site. + """ + + SERVER_FARM = "ServerFarm" + SUBSCRIPTION = "Subscription" + WEB_SITE = "WebSite" + +class RouteType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of route this is: + DEFAULT - By default, every app has routes to the local address ranges specified by RFC1918 + INHERITED - Routes inherited from the real Virtual Network routes + STATIC - Static route set on the app only + + These values will be used for syncing an app's routes with those from a Virtual Network. + """ + + DEFAULT = "DEFAULT" + INHERITED = "INHERITED" + STATIC = "STATIC" + +class ScmType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """SCM type. + """ + + NONE = "None" + DROPBOX = "Dropbox" + TFS = "Tfs" + LOCAL_GIT = "LocalGit" + GIT_HUB = "GitHub" + CODE_PLEX_GIT = "CodePlexGit" + CODE_PLEX_HG = "CodePlexHg" + BITBUCKET_GIT = "BitbucketGit" + BITBUCKET_HG = "BitbucketHg" + EXTERNAL_GIT = "ExternalGit" + EXTERNAL_HG = "ExternalHg" + ONE_DRIVE = "OneDrive" + VSO = "VSO" + VSTSRM = "VSTSRM" + +class SiteAvailabilityState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Management information availability state for the app. + """ + + NORMAL = "Normal" + LIMITED = "Limited" + DISASTER_RECOVERY_MODE = "DisasterRecoveryMode" + +class SiteExtensionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Site extension type. + """ + + GALLERY = "Gallery" + WEB_ROOT = "WebRoot" + +class SiteLoadBalancing(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Site load balancing. + """ + + WEIGHTED_ROUND_ROBIN = "WeightedRoundRobin" + LEAST_REQUESTS = "LeastRequests" + LEAST_RESPONSE_TIME = "LeastResponseTime" + WEIGHTED_TOTAL_TRAFFIC = "WeightedTotalTraffic" + REQUEST_HASH = "RequestHash" + +class SiteRuntimeState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + READY = "READY" + STOPPED = "STOPPED" + UNKNOWN = "UNKNOWN" + +class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + FREE = "Free" + SHARED = "Shared" + BASIC = "Basic" + STANDARD = "Standard" + PREMIUM = "Premium" + DYNAMIC = "Dynamic" + ISOLATED = "Isolated" + PREMIUM_V2 = "PremiumV2" + ELASTIC_PREMIUM = "ElasticPremium" + ELASTIC_ISOLATED = "ElasticIsolated" + +class SolutionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of Solution + """ + + QUICK_SOLUTION = "QuickSolution" + DEEP_INVESTIGATION = "DeepInvestigation" + BEST_PRACTICES = "BestPractices" + +class SslState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """SSL type. + """ + + DISABLED = "Disabled" + SNI_ENABLED = "SniEnabled" + IP_BASED_ENABLED = "IpBasedEnabled" + +class StatusOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """App Service plan status. + """ + + READY = "Ready" + PENDING = "Pending" + CREATING = "Creating" + +class SupportedTlsVersions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """MinTlsVersion: configures the minimum version of TLS required for SSL requests + """ + + ONE0 = "1.0" + ONE1 = "1.1" + ONE2 = "1.2" + +class TriggeredWebJobStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Job status. + """ + + SUCCESS = "Success" + FAILED = "Failed" + ERROR = "Error" + +class TriggerTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The trigger type of the function + """ + + HTTP_TRIGGER = "HttpTrigger" + UNKNOWN = "Unknown" + +class UnauthenticatedClientAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The action to take when an unauthenticated client attempts to access the app. + """ + + REDIRECT_TO_LOGIN_PAGE = "RedirectToLoginPage" + ALLOW_ANONYMOUS = "AllowAnonymous" + +class UnauthenticatedClientActionV2(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REDIRECT_TO_LOGIN_PAGE = "RedirectToLoginPage" + ALLOW_ANONYMOUS = "AllowAnonymous" + RETURN401 = "Return401" + RETURN403 = "Return403" + +class UsageState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """State indicating whether the app has exceeded its quota usage. Read-only. + """ + + NORMAL = "Normal" + EXCEEDED = "Exceeded" + +class ValidateResourceTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Resource type used for verification. + """ + + SERVER_FARM = "ServerFarm" + SITE = "Site" + +class WebJobType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Job type. + """ + + CONTINUOUS = "Continuous" + TRIGGERED = "Triggered" + +class WorkerSizeOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of the machines. + """ + + SMALL = "Small" + MEDIUM = "Medium" + LARGE = "Large" + D1 = "D1" + D2 = "D2" + D3 = "D3" + NESTED_SMALL = "NestedSmall" + DEFAULT = "Default" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/__init__.py new file mode 100644 index 000000000000..8f414125deed --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/__init__.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._app_service_certificate_orders_operations import AppServiceCertificateOrdersOperations +from ._certificate_registration_provider_operations import CertificateRegistrationProviderOperations +from ._domains_operations import DomainsOperations +from ._top_level_domains_operations import TopLevelDomainsOperations +from ._domain_registration_provider_operations import DomainRegistrationProviderOperations +from ._certificates_operations import CertificatesOperations +from ._deleted_web_apps_operations import DeletedWebAppsOperations +from ._diagnostics_operations import DiagnosticsOperations +from ._provider_operations import ProviderOperations +from ._recommendations_operations import RecommendationsOperations +from ._web_site_management_client_operations import WebSiteManagementClientOperationsMixin +from ._web_apps_operations import WebAppsOperations +from ._static_sites_operations import StaticSitesOperations +from ._app_service_environments_operations import AppServiceEnvironmentsOperations +from ._app_service_plans_operations import AppServicePlansOperations +from ._resource_health_metadata_operations import ResourceHealthMetadataOperations + +__all__ = [ + 'AppServiceCertificateOrdersOperations', + 'CertificateRegistrationProviderOperations', + 'DomainsOperations', + 'TopLevelDomainsOperations', + 'DomainRegistrationProviderOperations', + 'CertificatesOperations', + 'DeletedWebAppsOperations', + 'DiagnosticsOperations', + 'ProviderOperations', + 'RecommendationsOperations', + 'WebSiteManagementClientOperationsMixin', + 'WebAppsOperations', + 'StaticSitesOperations', + 'AppServiceEnvironmentsOperations', + 'AppServicePlansOperations', + 'ResourceHealthMetadataOperations', +] diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_app_service_certificate_orders_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_app_service_certificate_orders_operations.py new file mode 100644 index 000000000000..08b36985a546 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_app_service_certificate_orders_operations.py @@ -0,0 +1,1517 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AppServiceCertificateOrdersOperations(object): + """AppServiceCertificateOrdersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServiceCertificateOrderCollection"] + """List all certificate orders in a subscription. + + Description for List all certificate orders in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceCertificateOrderCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrderCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrderCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateOrderCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/certificateOrders'} # type: ignore + + def validate_purchase_information( + self, + app_service_certificate_order, # type: "_models.AppServiceCertificateOrder" + **kwargs # type: Any + ): + # type: (...) -> None + """Validate information for a certificate order. + + Description for Validate information for a certificate order. + + :param app_service_certificate_order: Information for a certificate order. + :type app_service_certificate_order: ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrder + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_purchase_information.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_service_certificate_order, 'AppServiceCertificateOrder') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + validate_purchase_information.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/validateCertificateRegistrationInformation'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServiceCertificateOrderCollection"] + """Get certificate orders in a resource group. + + Description for Get certificate orders in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 AppServiceCertificateOrderCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrderCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrderCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateOrderCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.CertificateRegistration/certificateOrders'} # type: ignore + + def get( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceCertificateOrder" + """Get a certificate order. + + Description for Get a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order.. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateOrder, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrder + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + certificate_distinguished_name, # type: "_models.AppServiceCertificateOrder" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceCertificateOrder" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_distinguished_name, 'AppServiceCertificateOrder') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + certificate_distinguished_name, # type: "_models.AppServiceCertificateOrder" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AppServiceCertificateOrder"] + """Create or update a certificate purchase order. + + Description for Create or update a certificate purchase order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param certificate_distinguished_name: Distinguished name to use for the certificate order. + :type certificate_distinguished_name: ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrder + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 AppServiceCertificateOrder or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrder] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + certificate_order_name=certificate_order_name, + certificate_distinguished_name=certificate_distinguished_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete an existing certificate order. + + Description for Delete an existing certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + certificate_distinguished_name, # type: "_models.AppServiceCertificateOrderPatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceCertificateOrder" + """Create or update a certificate purchase order. + + Description for Create or update a certificate purchase order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param certificate_distinguished_name: Distinguished name to use for the certificate order. + :type certificate_distinguished_name: ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrderPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateOrder, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateOrder + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_distinguished_name, 'AppServiceCertificateOrderPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + def list_certificates( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServiceCertificateCollection"] + """List all certificates associated with a certificate order. + + Description for List all certificates associated with a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceCertificateCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_certificates.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates'} # type: ignore + + def get_certificate( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceCertificateResource" + """Get the certificate associated with a certificate order. + + Description for Get the certificate associated with a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + def _create_or_update_certificate_initial( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + name, # type: str + key_vault_certificate, # type: "_models.AppServiceCertificateResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceCertificateResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_certificate_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key_vault_certificate, 'AppServiceCertificateResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_certificate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + def begin_create_or_update_certificate( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + name, # type: str + key_vault_certificate, # type: "_models.AppServiceCertificateResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AppServiceCertificateResource"] + """Creates or updates a certificate and associates with key vault secret. + + Description for Creates or updates a certificate and associates with key vault secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :param key_vault_certificate: Key vault certificate resource Id. + :type key_vault_certificate: ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 AppServiceCertificateResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_certificate_initial( + resource_group_name=resource_group_name, + certificate_order_name=certificate_order_name, + name=name, + key_vault_certificate=key_vault_certificate, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + def delete_certificate( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete the certificate associated with a certificate order. + + Description for Delete the certificate associated with a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + def update_certificate( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + name, # type: str + key_vault_certificate, # type: "_models.AppServiceCertificatePatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceCertificateResource" + """Creates or updates a certificate and associates with key vault secret. + + Description for Creates or updates a certificate and associates with key vault secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :param key_vault_certificate: Key vault certificate resource Id. + :type key_vault_certificate: ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificatePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AppServiceCertificateResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key_vault_certificate, 'AppServiceCertificatePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + def reissue( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + reissue_certificate_order_request, # type: "_models.ReissueCertificateOrderRequest" + **kwargs # type: Any + ): + # type: (...) -> None + """Reissue an existing certificate order. + + Description for Reissue an existing certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param reissue_certificate_order_request: Parameters for the reissue. + :type reissue_certificate_order_request: ~azure.mgmt.web.v2020_09_01.models.ReissueCertificateOrderRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.reissue.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(reissue_certificate_order_request, 'ReissueCertificateOrderRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reissue.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/reissue'} # type: ignore + + def renew( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + renew_certificate_order_request, # type: "_models.RenewCertificateOrderRequest" + **kwargs # type: Any + ): + # type: (...) -> None + """Renew an existing certificate order. + + Description for Renew an existing certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param renew_certificate_order_request: Renew parameters. + :type renew_certificate_order_request: ~azure.mgmt.web.v2020_09_01.models.RenewCertificateOrderRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.renew.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(renew_certificate_order_request, 'RenewCertificateOrderRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + renew.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/renew'} # type: ignore + + def resend_email( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Resend certificate email. + + Description for Resend certificate email. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.resend_email.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + resend_email.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendEmail'} # type: ignore + + def resend_request_emails( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + name_identifier, # type: "_models.NameIdentifier" + **kwargs # type: Any + ): + # type: (...) -> None + """Verify domain ownership for this certificate order. + + Description for Verify domain ownership for this certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name_identifier: Email address. + :type name_identifier: ~azure.mgmt.web.v2020_09_01.models.NameIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.resend_request_emails.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(name_identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + resend_request_emails.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendRequestEmails'} # type: ignore + + def retrieve_site_seal( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + site_seal_request, # type: "_models.SiteSealRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteSeal" + """Verify domain ownership for this certificate order. + + Description for Verify domain ownership for this certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param site_seal_request: Site seal request. + :type site_seal_request: ~azure.mgmt.web.v2020_09_01.models.SiteSealRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSeal, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteSeal + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSeal"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.retrieve_site_seal.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_seal_request, 'SiteSealRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteSeal', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_site_seal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/retrieveSiteSeal'} # type: ignore + + def verify_domain_ownership( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Verify domain ownership for this certificate order. + + Description for Verify domain ownership for this certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.verify_domain_ownership.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + verify_domain_ownership.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/verifyDomainOwnership'} # type: ignore + + def retrieve_certificate_actions( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.CertificateOrderAction"] + """Retrieve the list of certificate actions. + + Description for Retrieve the list of certificate actions. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate order. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of CertificateOrderAction, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.CertificateOrderAction] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.CertificateOrderAction"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.retrieve_certificate_actions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[CertificateOrderAction]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_certificate_actions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveCertificateActions'} # type: ignore + + def retrieve_certificate_email_history( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.CertificateEmail"] + """Retrieve email history. + + Description for Retrieve email history. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate order. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of CertificateEmail, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.CertificateEmail] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.CertificateEmail"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.retrieve_certificate_email_history.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[CertificateEmail]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_certificate_email_history.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveEmailHistory'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_app_service_environments_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_app_service_environments_operations.py new file mode 100644 index 000000000000..b1b0cc978095 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_app_service_environments_operations.py @@ -0,0 +1,3293 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AppServiceEnvironmentsOperations(object): + """AppServiceEnvironmentsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServiceEnvironmentCollection"] + """Get all App Service Environments for a subscription. + + Description for Get all App Service Environments for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceEnvironmentCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.AppServiceEnvironmentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceEnvironmentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/hostingEnvironments'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServiceEnvironmentCollection"] + """Get all App Service Environments in a resource group. + + Description for Get all App Service Environments in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 AppServiceEnvironmentCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.AppServiceEnvironmentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceEnvironmentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.Web/hostingEnvironments'} # type: ignore + + def get( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceEnvironmentResource" + """Get the properties of an App Service Environment. + + Description for Get the properties of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceEnvironmentResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AppServiceEnvironmentResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + name, # type: str + hosting_environment_envelope, # type: "_models.AppServiceEnvironmentResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceEnvironmentResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(hosting_environment_envelope, 'AppServiceEnvironmentResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + name, # type: str + hosting_environment_envelope, # type: "_models.AppServiceEnvironmentResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AppServiceEnvironmentResource"] + """Create or update an App Service Environment. + + Description for Create or update an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param hosting_environment_envelope: Configuration details of the App Service Environment. + :type hosting_environment_envelope: ~azure.mgmt.web.v2020_09_01.models.AppServiceEnvironmentResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 AppServiceEnvironmentResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.AppServiceEnvironmentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + hosting_environment_envelope=hosting_environment_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + name, # type: str + force_delete=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if force_delete is not None: + query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **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(_models.DefaultErrorResponse, 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.Web/hostingEnvironments/{name}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + name, # type: str + force_delete=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Delete an App Service Environment. + + Description for Delete an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param force_delete: Specify :code:`true` to force the deletion even if the App + Service Environment contains resources. The default is :code:`false`. + :type force_delete: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + name=name, + force_delete=force_delete, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + name, # type: str + hosting_environment_envelope, # type: "_models.AppServiceEnvironmentPatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceEnvironmentResource" + """Create or update an App Service Environment. + + Description for Create or update an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param hosting_environment_envelope: Configuration details of the App Service Environment. + :type hosting_environment_envelope: ~azure.mgmt.web.v2020_09_01.models.AppServiceEnvironmentPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceEnvironmentResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AppServiceEnvironmentResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(hosting_environment_envelope, 'AppServiceEnvironmentPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + def list_capacities( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StampCapacityCollection"] + """Get the used, available, and total worker capacity an App Service Environment. + + Description for Get the used, available, and total worker capacity an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StampCapacityCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.StampCapacityCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StampCapacityCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_capacities.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StampCapacityCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_capacities.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/compute'} # type: ignore + + def get_vip_info( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AddressResponse" + """Get IP addresses assigned to an App Service Environment. + + Description for Get IP addresses assigned to an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AddressResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AddressResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_vip_info.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AddressResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vip_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/virtualip'} # type: ignore + + def _change_vnet_initial( + self, + resource_group_name, # type: str + name, # type: str + vnet_info, # type: "_models.VirtualNetworkProfile" + **kwargs # type: Any + ): + # type: (...) -> "_models.WebAppCollection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._change_vnet_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vnet_info, 'VirtualNetworkProfile') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _change_vnet_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork'} # type: ignore + + def begin_change_vnet( + self, + resource_group_name, # type: str + name, # type: str + vnet_info, # type: "_models.VirtualNetworkProfile" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[ItemPaged["_models.WebAppCollection"]] + """Move an App Service Environment to a different VNET. + + Description for Move an App Service Environment to a different VNET. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param vnet_info: Details for the new virtual network. + :type vnet_info: ~azure.mgmt.web.v2020_09_01.models.VirtualNetworkProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 an iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.WebAppCollection]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.change_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vnet_info, 'VirtualNetworkProfile') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vnet_info, 'VirtualNetworkProfile') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._change_vnet_initial( + resource_group_name=resource_group_name, + name=name, + vnet_info=vnet_info, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return get_next(next_link) + + return ItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_change_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork'} # type: ignore + + def list_diagnostics( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.HostingEnvironmentDiagnostics"] + """Get diagnostic information for an App Service Environment. + + Description for Get diagnostic information for an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of HostingEnvironmentDiagnostics, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentDiagnostics] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.HostingEnvironmentDiagnostics"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_diagnostics.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[HostingEnvironmentDiagnostics]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_diagnostics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics'} # type: ignore + + def get_diagnostics_item( + self, + resource_group_name, # type: str + name, # type: str + diagnostics_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HostingEnvironmentDiagnostics" + """Get a diagnostics item for an App Service Environment. + + Description for Get a diagnostics item for an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param diagnostics_name: Name of the diagnostics item. + :type diagnostics_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostingEnvironmentDiagnostics, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HostingEnvironmentDiagnostics + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostingEnvironmentDiagnostics"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostics_item.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'diagnosticsName': self._serialize.url("diagnostics_name", diagnostics_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostingEnvironmentDiagnostics', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostics_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics/{diagnosticsName}'} # type: ignore + + def get_inbound_network_dependencies_endpoints( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.InboundEnvironmentEndpointCollection"] + """Get the network endpoints of all inbound dependencies of an App Service Environment. + + Description for Get the network endpoints of all inbound dependencies of an App Service + Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either InboundEnvironmentEndpointCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.InboundEnvironmentEndpointCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundEnvironmentEndpointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_inbound_network_dependencies_endpoints.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('InboundEnvironmentEndpointCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_inbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/inboundNetworkDependenciesEndpoints'} # type: ignore + + def list_multi_role_pools( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WorkerPoolCollection"] + """Get all multi-role pools. + + Description for Get all multi-role pools. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkerPoolCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.WorkerPoolCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_pools.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkerPoolCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_multi_role_pools.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools'} # type: ignore + + def get_multi_role_pool( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WorkerPoolResource" + """Get properties of a multi-role pool. + + Description for Get properties of a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_multi_role_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_multi_role_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + def _create_or_update_multi_role_pool_initial( + self, + resource_group_name, # type: str + name, # type: str + multi_role_pool_envelope, # type: "_models.WorkerPoolResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.WorkerPoolResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_multi_role_pool_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(multi_role_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_multi_role_pool_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + def begin_create_or_update_multi_role_pool( + self, + resource_group_name, # type: str + name, # type: str + multi_role_pool_envelope, # type: "_models.WorkerPoolResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.WorkerPoolResource"] + """Create or update a multi-role pool. + + Description for Create or update a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param multi_role_pool_envelope: Properties of the multi-role pool. + :type multi_role_pool_envelope: ~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 WorkerPoolResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_multi_role_pool_initial( + resource_group_name=resource_group_name, + name=name, + multi_role_pool_envelope=multi_role_pool_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_multi_role_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + def update_multi_role_pool( + self, + resource_group_name, # type: str + name, # type: str + multi_role_pool_envelope, # type: "_models.WorkerPoolResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.WorkerPoolResource" + """Create or update a multi-role pool. + + Description for Create or update a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param multi_role_pool_envelope: Properties of the multi-role pool. + :type multi_role_pool_envelope: ~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_multi_role_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(multi_role_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_multi_role_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + def list_multi_role_pool_instance_metric_definitions( + self, + resource_group_name, # type: str + name, # type: str + instance, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceMetricDefinitionCollection"] + """Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. + + Description for Get metric definitions for a specific instance of a multi-role pool of an App + Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param instance: Name of the instance in the multi-role pool. + :type instance: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_pool_instance_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instance': self._serialize.url("instance", instance, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_multi_role_pool_instance_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions'} # type: ignore + + def list_multi_role_metric_definitions( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceMetricDefinitionCollection"] + """Get metric definitions for a multi-role pool of an App Service Environment. + + Description for Get metric definitions for a multi-role pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_multi_role_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions'} # type: ignore + + def list_multi_role_pool_skus( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SkuInfoCollection"] + """Get available SKUs for scaling a multi-role pool. + + Description for Get available SKUs for scaling a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.SkuInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_pool_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SkuInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_multi_role_pool_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/skus'} # type: ignore + + def list_multi_role_usages( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.UsageCollection"] + """Get usage metrics for a multi-role pool of an App Service Environment. + + Description for Get usage metrics for a multi-role pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsageCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.UsageCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('UsageCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_multi_role_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/usages'} # type: ignore + + def list_operations( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.Operation"] + """List all currently running operations on the App Service Environment. + + Description for List all currently running operations on the App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Operation, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.Operation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Operation"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[Operation]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_operations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations'} # type: ignore + + def get_outbound_network_dependencies_endpoints( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.OutboundEnvironmentEndpointCollection"] + """Get the network endpoints of all outbound dependencies of an App Service Environment. + + Description for Get the network endpoints of all outbound dependencies of an App Service + Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.OutboundEnvironmentEndpointCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_outbound_network_dependencies_endpoints.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OutboundEnvironmentEndpointCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/outboundNetworkDependenciesEndpoints'} # type: ignore + + def reboot( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Reboot all machines in an App Service Environment. + + Description for Reboot all machines in an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.reboot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reboot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/reboot'} # type: ignore + + def _resume_initial( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WebAppCollection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._resume_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _resume_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume'} # type: ignore + + def begin_resume( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[ItemPaged["_models.WebAppCollection"]] + """Resume an App Service Environment. + + Description for Resume an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type 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: True for ARMPolling, False for no polling, or a + polling object for 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 an iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.WebAppCollection]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.resume.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._resume_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return get_next(next_link) + + return ItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume'} # type: ignore + + def list_app_service_plans( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServicePlanCollection"] + """Get all App Service plans in an App Service Environment. + + Description for Get all App Service plans in an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServicePlanCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.AppServicePlanCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlanCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_app_service_plans.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServicePlanCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_app_service_plans.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/serverfarms'} # type: ignore + + def list_web_apps( + self, + resource_group_name, # type: str + name, # type: str + properties_to_include=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppCollection"] + """Get all apps in an App Service Environment. + + Description for Get all apps in an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param properties_to_include: Comma separated list of app properties to include. + :type properties_to_include: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_apps.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if properties_to_include is not None: + query_parameters['propertiesToInclude'] = self._serialize.query("properties_to_include", properties_to_include, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_web_apps.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/sites'} # type: ignore + + def _suspend_initial( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WebAppCollection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._suspend_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _suspend_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend'} # type: ignore + + def begin_suspend( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[ItemPaged["_models.WebAppCollection"]] + """Suspend an App Service Environment. + + Description for Suspend an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type 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: True for ARMPolling, False for no polling, or a + polling object for 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 an iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.WebAppCollection]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.suspend.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._suspend_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return get_next(next_link) + + return ItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_suspend.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend'} # type: ignore + + def list_usages( + self, + resource_group_name, # type: str + name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CsmUsageQuotaCollection"] + """Get global usage metrics of an App Service Environment. + + Description for Get global usage metrics of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq + 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages'} # type: ignore + + def list_worker_pools( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WorkerPoolCollection"] + """Get all worker pools of an App Service Environment. + + Description for Get all worker pools of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkerPoolCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.WorkerPoolCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_worker_pools.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkerPoolCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_worker_pools.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools'} # type: ignore + + def get_worker_pool( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WorkerPoolResource" + """Get properties of a worker pool. + + Description for Get properties of a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_worker_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_worker_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + def _create_or_update_worker_pool_initial( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + worker_pool_envelope, # type: "_models.WorkerPoolResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.WorkerPoolResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_worker_pool_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(worker_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_worker_pool_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + def begin_create_or_update_worker_pool( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + worker_pool_envelope, # type: "_models.WorkerPoolResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.WorkerPoolResource"] + """Create or update a worker pool. + + Description for Create or update a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :param worker_pool_envelope: Properties of the worker pool. + :type worker_pool_envelope: ~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 WorkerPoolResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_worker_pool_initial( + resource_group_name=resource_group_name, + name=name, + worker_pool_name=worker_pool_name, + worker_pool_envelope=worker_pool_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_worker_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + def update_worker_pool( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + worker_pool_envelope, # type: "_models.WorkerPoolResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.WorkerPoolResource" + """Create or update a worker pool. + + Description for Create or update a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :param worker_pool_envelope: Properties of the worker pool. + :type worker_pool_envelope: ~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_worker_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(worker_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_worker_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + def list_worker_pool_instance_metric_definitions( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + instance, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceMetricDefinitionCollection"] + """Get metric definitions for a specific instance of a worker pool of an App Service Environment. + + Description for Get metric definitions for a specific instance of a worker pool of an App + Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :param instance: Name of the instance in the worker pool. + :type instance: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_worker_pool_instance_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'instance': self._serialize.url("instance", instance, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_worker_pool_instance_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metricdefinitions'} # type: ignore + + def list_web_worker_metric_definitions( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceMetricDefinitionCollection"] + """Get metric definitions for a worker pool of an App Service Environment. + + Description for Get metric definitions for a worker pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_worker_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_web_worker_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metricdefinitions'} # type: ignore + + def list_worker_pool_skus( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SkuInfoCollection"] + """Get available SKUs for scaling a worker pool. + + Description for Get available SKUs for scaling a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.SkuInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_worker_pool_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SkuInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_worker_pool_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/skus'} # type: ignore + + def list_web_worker_usages( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.UsageCollection"] + """Get usage metrics for a worker pool of an App Service Environment. + + Description for Get usage metrics for a worker pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsageCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.UsageCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_worker_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('UsageCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_web_worker_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/usages'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_app_service_plans_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_app_service_plans_operations.py new file mode 100644 index 000000000000..b459c63c355e --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_app_service_plans_operations.py @@ -0,0 +1,2039 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AppServicePlansOperations(object): + """AppServicePlansOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + detailed=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServicePlanCollection"] + """Get all App Service plans for a subscription. + + Description for Get all App Service plans for a subscription. + + :param detailed: Specify :code:`true` to return all App Service plan properties. + The default is :code:`false`, which returns a subset of the properties. + Retrieval of all properties may increase the API latency. + :type detailed: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServicePlanCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.AppServicePlanCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlanCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if detailed is not None: + query_parameters['detailed'] = self._serialize.query("detailed", detailed, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServicePlanCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/serverfarms'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServicePlanCollection"] + """Get all App Service plans in a resource group. + + Description for Get all App Service plans in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 AppServicePlanCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.AppServicePlanCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlanCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServicePlanCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.Web/serverfarms'} # type: ignore + + def get( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.AppServicePlan"] + """Get an App Service plan. + + Description for Get an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServicePlan, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AppServicePlan or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AppServicePlan"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + name, # type: str + app_service_plan, # type: "_models.AppServicePlan" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServicePlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlan"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_service_plan, 'AppServicePlan') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + name, # type: str + app_service_plan, # type: "_models.AppServicePlan" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AppServicePlan"] + """Creates or updates an App Service Plan. + + Description for Creates or updates an App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param app_service_plan: Details of the App Service plan. + :type app_service_plan: ~azure.mgmt.web.v2020_09_01.models.AppServicePlan + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 AppServicePlan or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.AppServicePlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlan"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + app_service_plan=app_service_plan, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete an App Service plan. + + Description for Delete an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + name, # type: str + app_service_plan, # type: "_models.AppServicePlanPatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServicePlan" + """Creates or updates an App Service Plan. + + Description for Creates or updates an App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param app_service_plan: Details of the App Service plan. + :type app_service_plan: ~azure.mgmt.web.v2020_09_01.models.AppServicePlanPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServicePlan, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AppServicePlan + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlan"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_service_plan, 'AppServicePlanPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + def list_capabilities( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.Capability"] + """List all capabilities of an App Service plan. + + Description for List all capabilities of an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Capability, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.Capability] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Capability"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_capabilities.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[Capability]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_capabilities.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/capabilities'} # type: ignore + + def get_hybrid_connection( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Retrieve a Hybrid Connection in use in an App Service plan. + + Description for Retrieve a Hybrid Connection in use in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: Name of the Service Bus namespace. + :type namespace_name: str + :param relay_name: Name of the Service Bus relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def delete_hybrid_connection( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a Hybrid Connection in use in an App Service plan. + + Description for Delete a Hybrid Connection in use in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: Name of the Service Bus namespace. + :type namespace_name: str + :param relay_name: Name of the Service Bus relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def list_hybrid_connection_keys( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnectionKey" + """Get the send key name and value of a Hybrid Connection. + + Description for Get the send key name and value of a Hybrid Connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: The name of the Service Bus namespace. + :type namespace_name: str + :param relay_name: The name of the Service Bus relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnectionKey, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnectionKey + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnectionKey"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_hybrid_connection_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnectionKey', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_hybrid_connection_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'} # type: ignore + + def list_web_apps_by_hybrid_connection( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceCollection"] + """Get all apps that use a Hybrid Connection in an App Service Plan. + + Description for Get all apps that use a Hybrid Connection in an App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: Name of the Hybrid Connection namespace. + :type namespace_name: str + :param relay_name: Name of the Hybrid Connection relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_apps_by_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_web_apps_by_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/sites'} # type: ignore + + def get_hybrid_connection_plan_limit( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnectionLimits" + """Get the maximum number of Hybrid Connections allowed in an App Service plan. + + Description for Get the maximum number of Hybrid Connections allowed in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnectionLimits, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnectionLimits + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnectionLimits"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection_plan_limit.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnectionLimits', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection_plan_limit.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionPlanLimits/limit'} # type: ignore + + def list_hybrid_connections( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.HybridConnectionCollection"] + """Retrieve all Hybrid Connections in use in an App Service plan. + + Description for Retrieve all Hybrid Connections in use in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HybridConnectionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.HybridConnectionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnectionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_hybrid_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('HybridConnectionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_hybrid_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionRelays'} # type: ignore + + def restart_web_apps( + self, + resource_group_name, # type: str + name, # type: str + soft_restart=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + """Restart all apps in an App Service plan. + + Description for Restart all apps in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param soft_restart: Specify :code:`true` to perform a soft restart, applies the + configuration settings and restarts the apps if necessary. The default is + :code:`false`, which always restarts and reprovisions the apps. + :type soft_restart: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.restart_web_apps.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if soft_restart is not None: + query_parameters['softRestart'] = self._serialize.query("soft_restart", soft_restart, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restart_web_apps.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/restartSites'} # type: ignore + + def list_web_apps( + self, + resource_group_name, # type: str + name, # type: str + skip_token=None, # type: Optional[str] + filter=None, # type: Optional[str] + top=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppCollection"] + """Get all apps associated with an App Service plan. + + Description for Get all apps associated with an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param skip_token: Skip to a web app in the list of webapps associated with app service plan. + If specified, the resulting list will contain web apps starting from (including) the skipToken. + Otherwise, the resulting list contains web apps from the start of the list. + :type skip_token: str + :param filter: Supported filter: $filter=state eq running. Returns only web apps that are + currently running. + :type filter: str + :param top: List page size. If specified, results are paged. + :type top: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_apps.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_web_apps.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites'} # type: ignore + + def get_server_farm_skus( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> object + """Gets all selectable SKUs for a given App Service Plan. + + Description for Gets all selectable SKUs for a given App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of App Service Plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: object, or the result of cls(response) + :rtype: object + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[object] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_server_farm_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_server_farm_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/skus'} # type: ignore + + def list_usages( + self, + resource_group_name, # type: str + name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CsmUsageQuotaCollection"] + """Gets server farm usage information. + + Description for Gets server farm usage information. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of App Service Plan. + :type name: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/usages'} # type: ignore + + def list_vnets( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.VnetInfo"] + """Get all Virtual Networks associated with an App Service plan. + + Description for Get all Virtual Networks associated with an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetInfo, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.VnetInfo] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_vnets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetInfo]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_vnets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections'} # type: ignore + + def get_vnet_from_server_farm( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VnetInfo"] + """Get a Virtual Network associated with an App Service plan. + + Description for Get a Virtual Network associated with an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VnetInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_from_server_farm.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_from_server_farm.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def get_vnet_gateway( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetGateway" + """Get a Virtual Network gateway. + + Description for Get a Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Only the 'primary' gateway is supported. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def update_vnet_gateway( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + connection_envelope, # type: "_models.VnetGateway" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetGateway" + """Update a Virtual Network gateway. + + Description for Update a Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Only the 'primary' gateway is supported. + :type gateway_name: str + :param connection_envelope: Definition of the gateway. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def list_routes_for_vnet( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.VnetRoute"] + """Get all routes that are associated with a Virtual Network in an App Service plan. + + Description for Get all routes that are associated with a Virtual Network in an App Service + plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetRoute, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.VnetRoute] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetRoute"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_routes_for_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetRoute]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_routes_for_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes'} # type: ignore + + def get_route_for_vnet( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + route_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[List["_models.VnetRoute"]] + """Get a Virtual Network route in an App Service plan. + + Description for Get a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetRoute, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.VnetRoute] or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[List["_models.VnetRoute"]]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_route_for_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[VnetRoute]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_route_for_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + def create_or_update_vnet_route( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + route_name, # type: str + route, # type: "_models.VnetRoute" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VnetRoute"] + """Create or update a Virtual Network route in an App Service plan. + + Description for Create or update a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :param route: Definition of the Virtual Network route. + :type route: ~azure.mgmt.web.v2020_09_01.models.VnetRoute + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetRoute, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetRoute or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VnetRoute"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_route.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route, 'VnetRoute') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 400, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VnetRoute', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + def delete_vnet_route( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + route_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a Virtual Network route in an App Service plan. + + Description for Delete a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_vnet_route.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_vnet_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + def update_vnet_route( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + route_name, # type: str + route, # type: "_models.VnetRoute" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VnetRoute"] + """Create or update a Virtual Network route in an App Service plan. + + Description for Create or update a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :param route: Definition of the Virtual Network route. + :type route: ~azure.mgmt.web.v2020_09_01.models.VnetRoute + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetRoute, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetRoute or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VnetRoute"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_route.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route, 'VnetRoute') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 400, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VnetRoute', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + def reboot_worker( + self, + resource_group_name, # type: str + name, # type: str + worker_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Reboot a worker machine in an App Service plan. + + Description for Reboot a worker machine in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param worker_name: Name of worker machine, which typically starts with RD. + :type worker_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.reboot_worker.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerName': self._serialize.url("worker_name", worker_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reboot_worker.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/workers/{workerName}/reboot'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_certificate_registration_provider_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_certificate_registration_provider_operations.py new file mode 100644 index 000000000000..8816273cd752 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_certificate_registration_provider_operations.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class CertificateRegistrationProviderOperations(object): + """CertificateRegistrationProviderOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_operations( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CsmOperationCollection"] + """Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. + + Description for Implements Csm operations Api to exposes the list of available Csm Apis under + the resource provider. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmOperationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.CsmOperationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmOperationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CsmOperationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_operations.metadata = {'url': '/providers/Microsoft.CertificateRegistration/operations'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_certificates_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_certificates_operations.py new file mode 100644 index 000000000000..bb1f4719c1d6 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_certificates_operations.py @@ -0,0 +1,451 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class CertificatesOperations(object): + """CertificatesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CertificateCollection"] + """Get all certificates for a subscription. + + Description for Get all certificates for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CertificateCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.CertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/certificates'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CertificateCollection"] + """Get all certificates in a resource group. + + Description for Get all certificates in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 CertificateCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.CertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.Web/certificates'} # type: ignore + + def get( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Certificate" + """Get a certificate. + + Description for Get a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + name, # type: str + certificate_envelope, # type: "_models.Certificate" + **kwargs # type: Any + ): + # type: (...) -> "_models.Certificate" + """Create or update a certificate. + + Description for Create or update a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :param certificate_envelope: Details of certificate, if it exists already. + :type certificate_envelope: ~azure.mgmt.web.v2020_09_01.models.Certificate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_envelope, 'Certificate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a certificate. + + Description for Delete a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + name, # type: str + certificate_envelope, # type: "_models.CertificatePatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.Certificate" + """Create or update a certificate. + + Description for Create or update a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :param certificate_envelope: Details of certificate, if it exists already. + :type certificate_envelope: ~azure.mgmt.web.v2020_09_01.models.CertificatePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_envelope, 'CertificatePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_deleted_web_apps_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_deleted_web_apps_operations.py new file mode 100644 index 000000000000..bda5e272d417 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_deleted_web_apps_operations.py @@ -0,0 +1,252 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DeletedWebAppsOperations(object): + """DeletedWebAppsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DeletedWebAppCollection"] + """Get all deleted apps for a subscription. + + Description for Get all deleted apps for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeletedWebAppCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.DeletedWebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedWebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DeletedWebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites'} # type: ignore + + def list_by_location( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DeletedWebAppCollection"] + """Get all deleted apps for a subscription at location. + + Description for Get all deleted apps for a subscription at location. + + :param location: + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeletedWebAppCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.DeletedWebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedWebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_location.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DeletedWebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/deletedSites'} # type: ignore + + def get_deleted_web_app_by_location( + self, + location, # type: str + deleted_site_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DeletedSite" + """Get deleted app for a subscription at location. + + Description for Get deleted app for a subscription at location. + + :param location: + :type location: str + :param deleted_site_id: The numeric ID of the deleted app, e.g. 12345. + :type deleted_site_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeletedSite, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DeletedSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedSite"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_deleted_web_app_by_location.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'deletedSiteId': self._serialize.url("deleted_site_id", deleted_site_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeletedSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deleted_web_app_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/deletedSites/{deletedSiteId}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_diagnostics_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_diagnostics_operations.py new file mode 100644 index 000000000000..94a410117764 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_diagnostics_operations.py @@ -0,0 +1,1800 @@ +# 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. +# -------------------------------------------------------------------------- +import datetime +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DiagnosticsOperations(object): + """DiagnosticsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_hosting_environment_detector_responses( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DetectorResponseCollection"] + """List Hosting Environment Detector Responses. + + Description for List Hosting Environment Detector Responses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site Name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DetectorResponseCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.DetectorResponseCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponseCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_hosting_environment_detector_responses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DetectorResponseCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_hosting_environment_detector_responses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors'} # type: ignore + + def get_hosting_environment_detector_response( + self, + resource_group_name, # type: str + name, # type: str + detector_name, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DetectorResponse" + """Get Hosting Environment Detector Response. + + Description for Get Hosting Environment Detector Response. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: App Service Environment Name. + :type name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_hosting_environment_detector_response.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hosting_environment_detector_response.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors/{detectorName}'} # type: ignore + + def list_site_detector_responses( + self, + resource_group_name, # type: str + site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DetectorResponseCollection"] + """List Site Detector Responses. + + Description for List Site Detector Responses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DetectorResponseCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.DetectorResponseCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponseCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detector_responses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DetectorResponseCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_detector_responses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors'} # type: ignore + + def get_site_detector_response( + self, + resource_group_name, # type: str + site_name, # type: str + detector_name, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DetectorResponse" + """Get site detector response. + + Description for Get site detector response. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector_response.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector_response.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors/{detectorName}'} # type: ignore + + def list_site_diagnostic_categories( + self, + resource_group_name, # type: str + site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiagnosticCategoryCollection"] + """Get Diagnostics Categories. + + Description for Get Diagnostics Categories. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticCategoryCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.DiagnosticCategoryCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_diagnostic_categories.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticCategoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_diagnostic_categories.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics'} # type: ignore + + def get_site_diagnostic_category( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DiagnosticCategory" + """Get Diagnostics Category. + + Description for Get Diagnostics Category. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticCategory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DiagnosticCategory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategory"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_diagnostic_category.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticCategory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_diagnostic_category.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}'} # type: ignore + + def list_site_analyses( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiagnosticAnalysisCollection"] + """Get Site Analyses. + + Description for Get Site Analyses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticAnalysisCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.DiagnosticAnalysisCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysisCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_analyses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticAnalysisCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_analyses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses'} # type: ignore + + def get_site_analysis( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + analysis_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AnalysisDefinition" + """Get Site Analysis. + + Description for Get Site Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param analysis_name: Analysis Name. + :type analysis_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalysisDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AnalysisDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalysisDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_analysis.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AnalysisDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_analysis.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}'} # type: ignore + + def execute_site_analysis( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + analysis_name, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DiagnosticAnalysis" + """Execute Analysis. + + Description for Execute Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param analysis_name: Analysis Resource Name. + :type analysis_name: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticAnalysis, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DiagnosticAnalysis + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysis"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_analysis.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticAnalysis', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_analysis.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute'} # type: ignore + + def list_site_detectors( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiagnosticDetectorCollection"] + """Get Detectors. + + Description for Get Detectors. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticDetectorCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.DiagnosticDetectorCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detectors.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticDetectorCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_detectors.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors'} # type: ignore + + def get_site_detector( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + detector_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DetectorDefinition" + """Get Detector. + + Description for Get Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param detector_name: Detector Name. + :type detector_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DetectorDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}'} # type: ignore + + def execute_site_detector( + self, + resource_group_name, # type: str + site_name, # type: str + detector_name, # type: str + diagnostic_category, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DiagnosticDetectorResponse" + """Execute Detector. + + Description for Execute Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticDetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DiagnosticDetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_detector.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticDetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_detector.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute'} # type: ignore + + def list_site_detector_responses_slot( + self, + resource_group_name, # type: str + site_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DetectorResponseCollection"] + """List Site Detector Responses. + + Description for List Site Detector Responses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DetectorResponseCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.DetectorResponseCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponseCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detector_responses_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DetectorResponseCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_detector_responses_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors'} # type: ignore + + def get_site_detector_response_slot( + self, + resource_group_name, # type: str + site_name, # type: str + detector_name, # type: str + slot, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DetectorResponse" + """Get site detector response. + + Description for Get site detector response. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param slot: Slot Name. + :type slot: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector_response_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector_response_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors/{detectorName}'} # type: ignore + + def list_site_diagnostic_categories_slot( + self, + resource_group_name, # type: str + site_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiagnosticCategoryCollection"] + """Get Diagnostics Categories. + + Description for Get Diagnostics Categories. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticCategoryCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.DiagnosticCategoryCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_diagnostic_categories_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticCategoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_diagnostic_categories_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics'} # type: ignore + + def get_site_diagnostic_category_slot( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DiagnosticCategory" + """Get Diagnostics Category. + + Description for Get Diagnostics Category. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticCategory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DiagnosticCategory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategory"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_diagnostic_category_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticCategory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_diagnostic_category_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}'} # type: ignore + + def list_site_analyses_slot( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiagnosticAnalysisCollection"] + """Get Site Analyses. + + Description for Get Site Analyses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticAnalysisCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.DiagnosticAnalysisCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysisCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_analyses_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticAnalysisCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_analyses_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses'} # type: ignore + + def get_site_analysis_slot( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + analysis_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AnalysisDefinition" + """Get Site Analysis. + + Description for Get Site Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param analysis_name: Analysis Name. + :type analysis_name: str + :param slot: Slot - optional. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalysisDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AnalysisDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalysisDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_analysis_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AnalysisDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_analysis_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses/{analysisName}'} # type: ignore + + def execute_site_analysis_slot( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + analysis_name, # type: str + slot, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DiagnosticAnalysis" + """Execute Analysis. + + Description for Execute Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param analysis_name: Analysis Resource Name. + :type analysis_name: str + :param slot: Slot Name. + :type slot: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticAnalysis, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DiagnosticAnalysis + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysis"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_analysis_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticAnalysis', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_analysis_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute'} # type: ignore + + def list_site_detectors_slot( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiagnosticDetectorCollection"] + """Get Detectors. + + Description for Get Detectors. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticDetectorCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.DiagnosticDetectorCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detectors_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticDetectorCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_detectors_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors'} # type: ignore + + def get_site_detector_slot( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + detector_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DetectorDefinition" + """Get Detector. + + Description for Get Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param detector_name: Detector Name. + :type detector_name: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DetectorDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors/{detectorName}'} # type: ignore + + def execute_site_detector_slot( + self, + resource_group_name, # type: str + site_name, # type: str + detector_name, # type: str + diagnostic_category, # type: str + slot, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DiagnosticDetectorResponse" + """Execute Detector. + + Description for Execute Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticDetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DiagnosticDetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_detector_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticDetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_detector_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_domain_registration_provider_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_domain_registration_provider_operations.py new file mode 100644 index 000000000000..2683ac8ac526 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_domain_registration_provider_operations.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DomainRegistrationProviderOperations(object): + """DomainRegistrationProviderOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_operations( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CsmOperationCollection"] + """Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. + + Description for Implements Csm operations Api to exposes the list of available Csm Apis under + the resource provider. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmOperationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.CsmOperationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmOperationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CsmOperationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_operations.metadata = {'url': '/providers/Microsoft.DomainRegistration/operations'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_domains_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_domains_operations.py new file mode 100644 index 000000000000..f91b5c15b4c5 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_domains_operations.py @@ -0,0 +1,1139 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DomainsOperations(object): + """DomainsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def check_availability( + self, + identifier, # type: "_models.NameIdentifier" + **kwargs # type: Any + ): + # type: (...) -> "_models.DomainAvailabilityCheckResult" + """Check if a domain is available for registration. + + Description for Check if a domain is available for registration. + + :param identifier: Name of the domain. + :type identifier: ~azure.mgmt.web.v2020_09_01.models.NameIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainAvailabilityCheckResult, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DomainAvailabilityCheckResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainAvailabilityCheckResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainAvailabilityCheckResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/checkDomainAvailability'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DomainCollection"] + """Get all domains in a subscription. + + Description for Get all domains in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DomainCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.DomainCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DomainCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/domains'} # type: ignore + + def get_control_center_sso_request( + self, + **kwargs # type: Any + ): + # type: (...) -> "_models.DomainControlCenterSsoRequest" + """Generate a single sign-on request for the domain management portal. + + Description for Generate a single sign-on request for the domain management portal. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainControlCenterSsoRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DomainControlCenterSsoRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainControlCenterSsoRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_control_center_sso_request.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainControlCenterSsoRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_control_center_sso_request.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/generateSsoRequest'} # type: ignore + + def list_recommendations( + self, + parameters, # type: "_models.DomainRecommendationSearchParameters" + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NameIdentifierCollection"] + """Get domain name recommendations based on keywords. + + Description for Get domain name recommendations based on keywords. + + :param parameters: Search parameters for domain name recommendations. + :type parameters: ~azure.mgmt.web.v2020_09_01.models.DomainRecommendationSearchParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NameIdentifierCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.NameIdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NameIdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_recommendations.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DomainRecommendationSearchParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DomainRecommendationSearchParameters') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NameIdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_recommendations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/listDomainRecommendations'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DomainCollection"] + """Get all domains in a resource group. + + Description for Get all domains in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 DomainCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.DomainCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DomainCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.DomainRegistration/domains'} # type: ignore + + def get( + self, + resource_group_name, # type: str + domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Domain" + """Get a domain. + + Description for Get a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Domain, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Domain + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + domain_name, # type: str + domain, # type: "_models.Domain" + **kwargs # type: Any + ): + # type: (...) -> "_models.Domain" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str', pattern=r'[a-zA-Z0-9][a-zA-Z0-9\.-]+'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain, 'Domain') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Domain', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + domain_name, # type: str + domain, # type: "_models.Domain" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Domain"] + """Creates or updates a domain. + + Description for Creates or updates a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param domain: Domain registration information. + :type domain: ~azure.mgmt.web.v2020_09_01.models.Domain + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 Domain or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.Domain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + domain_name=domain_name, + domain=domain, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str', pattern=r'[a-zA-Z0-9][a-zA-Z0-9\.-]+'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + domain_name, # type: str + force_hard_delete_domain=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a domain. + + Description for Delete a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param force_hard_delete_domain: Specify :code:`true` to delete the domain + immediately. The default is :code:`false` which deletes the domain after 24 hours. + :type force_hard_delete_domain: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if force_hard_delete_domain is not None: + query_parameters['forceHardDeleteDomain'] = self._serialize.query("force_hard_delete_domain", force_hard_delete_domain, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + domain_name, # type: str + domain, # type: "_models.DomainPatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.Domain" + """Creates or updates a domain. + + Description for Creates or updates a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param domain: Domain registration information. + :type domain: ~azure.mgmt.web.v2020_09_01.models.DomainPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Domain, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Domain + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str', pattern=r'[a-zA-Z0-9][a-zA-Z0-9\.-]+'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain, 'DomainPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Domain', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + def list_ownership_identifiers( + self, + resource_group_name, # type: str + domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DomainOwnershipIdentifierCollection"] + """Lists domain ownership identifiers. + + Description for Lists domain ownership identifiers. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type 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 DomainOwnershipIdentifierCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.DomainOwnershipIdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_ownership_identifiers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DomainOwnershipIdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_ownership_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers'} # type: ignore + + def get_ownership_identifier( + self, + resource_group_name, # type: str + domain_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DomainOwnershipIdentifier" + """Get ownership identifier for domain. + + Description for Get ownership identifier for domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainOwnershipIdentifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DomainOwnershipIdentifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainOwnershipIdentifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + def create_or_update_ownership_identifier( + self, + resource_group_name, # type: str + domain_name, # type: str + name, # type: str + domain_ownership_identifier, # type: "_models.DomainOwnershipIdentifier" + **kwargs # type: Any + ): + # type: (...) -> "_models.DomainOwnershipIdentifier" + """Creates an ownership identifier for a domain or updates identifier details for an existing identifer. + + Description for Creates an ownership identifier for a domain or updates identifier details for + an existing identifer. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_09_01.models.DomainOwnershipIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainOwnershipIdentifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DomainOwnershipIdentifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'DomainOwnershipIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainOwnershipIdentifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + def delete_ownership_identifier( + self, + resource_group_name, # type: str + domain_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete ownership identifier for domain. + + Description for Delete ownership identifier for domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + def update_ownership_identifier( + self, + resource_group_name, # type: str + domain_name, # type: str + name, # type: str + domain_ownership_identifier, # type: "_models.DomainOwnershipIdentifier" + **kwargs # type: Any + ): + # type: (...) -> "_models.DomainOwnershipIdentifier" + """Creates an ownership identifier for a domain or updates identifier details for an existing identifer. + + Description for Creates an ownership identifier for a domain or updates identifier details for + an existing identifer. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_09_01.models.DomainOwnershipIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainOwnershipIdentifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DomainOwnershipIdentifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'DomainOwnershipIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainOwnershipIdentifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + def renew( + self, + resource_group_name, # type: str + domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Renew a domain. + + Description for Renew a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.renew.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + renew.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/renew'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_provider_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_provider_operations.py new file mode 100644 index 000000000000..715be1343359 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_provider_operations.py @@ -0,0 +1,259 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ProviderOperations(object): + """ProviderOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get_available_stacks( + self, + os_type_selected=None, # type: Optional[Union[str, "_models.Enum5"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ApplicationStackCollection"] + """Get available application frameworks and their versions. + + Description for Get available application frameworks and their versions. + + :param os_type_selected: + :type os_type_selected: str or ~azure.mgmt.web.v2020_09_01.models.Enum5 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationStackCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ApplicationStackCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationStackCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_available_stacks.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if os_type_selected is not None: + query_parameters['osTypeSelected'] = self._serialize.query("os_type_selected", os_type_selected, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationStackCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_available_stacks.metadata = {'url': '/providers/Microsoft.Web/availableStacks'} # type: ignore + + def list_operations( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CsmOperationCollection"] + """Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. + + Description for Gets all available operations for the Microsoft.Web resource provider. Also + exposes resource metric definitions. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmOperationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.CsmOperationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmOperationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CsmOperationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_operations.metadata = {'url': '/providers/Microsoft.Web/operations'} # type: ignore + + def get_available_stacks_on_prem( + self, + os_type_selected=None, # type: Optional[Union[str, "_models.Enum6"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ApplicationStackCollection"] + """Get available application frameworks and their versions. + + Description for Get available application frameworks and their versions. + + :param os_type_selected: + :type os_type_selected: str or ~azure.mgmt.web.v2020_09_01.models.Enum6 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationStackCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ApplicationStackCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationStackCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_available_stacks_on_prem.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if os_type_selected is not None: + query_parameters['osTypeSelected'] = self._serialize.query("os_type_selected", os_type_selected, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationStackCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_available_stacks_on_prem.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_recommendations_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_recommendations_operations.py new file mode 100644 index 000000000000..67588f9771f5 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_recommendations_operations.py @@ -0,0 +1,1128 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RecommendationsOperations(object): + """RecommendationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + featured=None, # type: Optional[bool] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RecommendationCollection"] + """List all recommendations for a subscription. + + Description for List all recommendations for a subscription. + + :param featured: Specify :code:`true` to return only the most critical + recommendations. The default is :code:`false`, which returns all recommendations. + :type featured: bool + :param filter: Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or + channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq + 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if featured is not None: + query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations'} # type: ignore + + def reset_all_filters( + self, + **kwargs # type: Any + ): + # type: (...) -> None + """Reset all recommendation opt-out settings for a subscription. + + Description for Reset all recommendation opt-out settings for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.reset_all_filters.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_all_filters.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/reset'} # type: ignore + + def disable_recommendation_for_subscription( + self, + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Disables the specified rule so it will not apply to a subscription in the future. + + Description for Disables the specified rule so it will not apply to a subscription in the + future. + + :param name: Rule name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.disable_recommendation_for_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_recommendation_for_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/{name}/disable'} # type: ignore + + def list_history_for_hosting_environment( + self, + resource_group_name, # type: str + hosting_environment_name, # type: str + expired_only=None, # type: Optional[bool] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RecommendationCollection"] + """Get past recommendations for an app, optionally specified by the time range. + + Description for Get past recommendations for an app, optionally specified by the time range. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param hosting_environment_name: Name of the hosting environment. + :type hosting_environment_name: str + :param expired_only: Specify :code:`false` to return all recommendations. The + default is :code:`true`, which returns only expired recommendations. + :type expired_only: bool + :param filter: Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or + channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq + 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_history_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expired_only is not None: + query_parameters['expiredOnly'] = self._serialize.query("expired_only", expired_only, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_history_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendationHistory'} # type: ignore + + def list_recommended_rules_for_hosting_environment( + self, + resource_group_name, # type: str + hosting_environment_name, # type: str + featured=None, # type: Optional[bool] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RecommendationCollection"] + """Get all recommendations for a hosting environment. + + Description for Get all recommendations for a hosting environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param hosting_environment_name: Name of the app. + :type hosting_environment_name: str + :param featured: Specify :code:`true` to return only the most critical + recommendations. The default is :code:`false`, which returns all recommendations. + :type featured: bool + :param filter: Return only channels specified in the filter. Filter is specified by using OData + syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_recommended_rules_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if featured is not None: + query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_recommended_rules_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations'} # type: ignore + + def disable_all_for_hosting_environment( + self, + resource_group_name, # type: str + environment_name, # type: str + hosting_environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Disable all recommendations for an app. + + Description for Disable all recommendations for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param environment_name: Name of the app. + :type environment_name: str + :param hosting_environment_name: + :type hosting_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.disable_all_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['environmentName'] = self._serialize.query("environment_name", environment_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_all_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/disable'} # type: ignore + + def reset_all_filters_for_hosting_environment( + self, + resource_group_name, # type: str + environment_name, # type: str + hosting_environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Reset all recommendation opt-out settings for an app. + + Description for Reset all recommendation opt-out settings for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param environment_name: Name of the app. + :type environment_name: str + :param hosting_environment_name: + :type hosting_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.reset_all_filters_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['environmentName'] = self._serialize.query("environment_name", environment_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_all_filters_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/reset'} # type: ignore + + def get_rule_details_by_hosting_environment( + self, + resource_group_name, # type: str + hosting_environment_name, # type: str + name, # type: str + update_seen=None, # type: Optional[bool] + recommendation_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.RecommendationRule" + """Get a recommendation rule for an app. + + Description for Get a recommendation rule for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param hosting_environment_name: Name of the hosting environment. + :type hosting_environment_name: str + :param name: Name of the recommendation. + :type name: str + :param update_seen: Specify :code:`true` to update the last-seen timestamp of the + recommendation object. + :type update_seen: bool + :param recommendation_id: The GUID of the recommendation object if you query an expired one. + You don't need to specify it to query an active entry. + :type recommendation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RecommendationRule, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RecommendationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_rule_details_by_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if update_seen is not None: + query_parameters['updateSeen'] = self._serialize.query("update_seen", update_seen, 'bool') + if recommendation_id is not None: + query_parameters['recommendationId'] = self._serialize.query("recommendation_id", recommendation_id, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RecommendationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_rule_details_by_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}'} # type: ignore + + def disable_recommendation_for_hosting_environment( + self, + resource_group_name, # type: str + environment_name, # type: str + name, # type: str + hosting_environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Disables the specific rule for a web site permanently. + + Description for Disables the specific rule for a web site permanently. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param environment_name: Site name. + :type environment_name: str + :param name: Rule name. + :type name: str + :param hosting_environment_name: + :type hosting_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.disable_recommendation_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['environmentName'] = self._serialize.query("environment_name", environment_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_recommendation_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}/disable'} # type: ignore + + def list_history_for_web_app( + self, + resource_group_name, # type: str + site_name, # type: str + expired_only=None, # type: Optional[bool] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RecommendationCollection"] + """Get past recommendations for an app, optionally specified by the time range. + + Description for Get past recommendations for an app, optionally specified by the time range. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :param expired_only: Specify :code:`false` to return all recommendations. The + default is :code:`true`, which returns only expired recommendations. + :type expired_only: bool + :param filter: Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or + channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq + 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_history_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expired_only is not None: + query_parameters['expiredOnly'] = self._serialize.query("expired_only", expired_only, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_history_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendationHistory'} # type: ignore + + def list_recommended_rules_for_web_app( + self, + resource_group_name, # type: str + site_name, # type: str + featured=None, # type: Optional[bool] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RecommendationCollection"] + """Get all recommendations for an app. + + Description for Get all recommendations for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :param featured: Specify :code:`true` to return only the most critical + recommendations. The default is :code:`false`, which returns all recommendations. + :type featured: bool + :param filter: Return only channels specified in the filter. Filter is specified by using OData + syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_recommended_rules_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if featured is not None: + query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_recommended_rules_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations'} # type: ignore + + def disable_all_for_web_app( + self, + resource_group_name, # type: str + site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Disable all recommendations for an app. + + Description for Disable all recommendations for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.disable_all_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_all_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/disable'} # type: ignore + + def reset_all_filters_for_web_app( + self, + resource_group_name, # type: str + site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Reset all recommendation opt-out settings for an app. + + Description for Reset all recommendation opt-out settings for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.reset_all_filters_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_all_filters_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/reset'} # type: ignore + + def get_rule_details_by_web_app( + self, + resource_group_name, # type: str + site_name, # type: str + name, # type: str + update_seen=None, # type: Optional[bool] + recommendation_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.RecommendationRule" + """Get a recommendation rule for an app. + + Description for Get a recommendation rule for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :param name: Name of the recommendation. + :type name: str + :param update_seen: Specify :code:`true` to update the last-seen timestamp of the + recommendation object. + :type update_seen: bool + :param recommendation_id: The GUID of the recommendation object if you query an expired one. + You don't need to specify it to query an active entry. + :type recommendation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RecommendationRule, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RecommendationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_rule_details_by_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if update_seen is not None: + query_parameters['updateSeen'] = self._serialize.query("update_seen", update_seen, 'bool') + if recommendation_id is not None: + query_parameters['recommendationId'] = self._serialize.query("recommendation_id", recommendation_id, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RecommendationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_rule_details_by_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}'} # type: ignore + + def disable_recommendation_for_site( + self, + resource_group_name, # type: str + site_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Disables the specific rule for a web site permanently. + + Description for Disables the specific rule for a web site permanently. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site name. + :type site_name: str + :param name: Rule name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.disable_recommendation_for_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_recommendation_for_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}/disable'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_resource_health_metadata_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_resource_health_metadata_operations.py new file mode 100644 index 000000000000..2e812e3a18aa --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_resource_health_metadata_operations.py @@ -0,0 +1,481 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ResourceHealthMetadataOperations(object): + """ResourceHealthMetadataOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceHealthMetadataCollection"] + """List all ResourceHealthMetadata for all sites in the subscription. + + Description for List all ResourceHealthMetadata for all sites in the subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/resourceHealthMetadata'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceHealthMetadataCollection"] + """List all ResourceHealthMetadata for all sites in the resource group in the subscription. + + Description for List all ResourceHealthMetadata for all sites in the resource group in the + subscription. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.Web/resourceHealthMetadata'} # type: ignore + + def list_by_site( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceHealthMetadataCollection"] + """Gets the category of ResourceHealthMetadata to use for the given site as a collection. + + Description for Gets the category of ResourceHealthMetadata to use for the given site as a + collection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata'} # type: ignore + + def get_by_site( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ResourceHealthMetadata" + """Gets the category of ResourceHealthMetadata to use for the given site. + + Description for Gets the category of ResourceHealthMetadata to use for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceHealthMetadata, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ResourceHealthMetadata + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadata"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_by_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceHealthMetadata', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata/default'} # type: ignore + + def list_by_site_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceHealthMetadataCollection"] + """Gets the category of ResourceHealthMetadata to use for the given site as a collection. + + Description for Gets the category of ResourceHealthMetadata to use for the given site as a + collection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_site_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_site_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata'} # type: ignore + + def get_by_site_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ResourceHealthMetadata" + """Gets the category of ResourceHealthMetadata to use for the given site. + + Description for Gets the category of ResourceHealthMetadata to use for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceHealthMetadata, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ResourceHealthMetadata + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadata"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_by_site_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceHealthMetadata', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_site_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata/default'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_static_sites_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_static_sites_operations.py new file mode 100644 index 000000000000..a36a2ab7313d --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_static_sites_operations.py @@ -0,0 +1,1944 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class StaticSitesOperations(object): + """StaticSitesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def preview_workflow( + self, + location, # type: str + static_sites_workflow_preview_request, # type: "_models.StaticSitesWorkflowPreviewRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSitesWorkflowPreview" + """Generates a preview workflow file for the static site. + + Description for Generates a preview workflow file for the static site. + + :param location: Location where you plan to create the static site. + :type location: str + :param static_sites_workflow_preview_request: A JSON representation of the + StaticSitesWorkflowPreviewRequest properties. See example. + :type static_sites_workflow_preview_request: ~azure.mgmt.web.v2020_09_01.models.StaticSitesWorkflowPreviewRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSitesWorkflowPreview, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StaticSitesWorkflowPreview + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSitesWorkflowPreview"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.preview_workflow.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_sites_workflow_preview_request, 'StaticSitesWorkflowPreviewRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSitesWorkflowPreview', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + preview_workflow.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/previewStaticSiteWorkflowFile'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteCollection"] + """Get all Static Sites for a subscription. + + Description for Get all Static Sites for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.StaticSiteCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/staticSites'} # type: ignore + + def get_static_sites_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteCollection"] + """Gets all static sites in the specified resource group. + + Description for Gets all static sites in the specified resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :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 StaticSiteCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.StaticSiteCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_static_sites_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_static_sites_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites'} # type: ignore + + def get_static_site( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteARMResource" + """Gets the details of a static site. + + Description for Gets the details of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StaticSiteARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + def create_or_update_static_site( + self, + resource_group_name, # type: str + name, # type: str + static_site_envelope, # type: "_models.StaticSiteARMResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteARMResource" + """Creates a new static site in an existing resource group, or updates an existing static site. + + Description for Creates a new static site in an existing resource group, or updates an existing + static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to create or update. + :type name: str + :param static_site_envelope: A JSON representation of the staticsite properties. See example. + :type static_site_envelope: ~azure.mgmt.web.v2020_09_01.models.StaticSiteARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StaticSiteARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_envelope, 'StaticSiteARMResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + def delete_static_site( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a static site. + + Description for Deletes a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to delete. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + def update_static_site( + self, + resource_group_name, # type: str + name, # type: str + static_site_envelope, # type: "_models.StaticSitePatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteARMResource" + """Creates a new static site in an existing resource group, or updates an existing static site. + + Description for Creates a new static site in an existing resource group, or updates an existing + static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to create or update. + :type name: str + :param static_site_envelope: A JSON representation of the staticsite properties. See example. + :type static_site_envelope: ~azure.mgmt.web.v2020_09_01.models.StaticSitePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StaticSiteARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_envelope, 'StaticSitePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + def list_static_site_users( + self, + resource_group_name, # type: str + name, # type: str + authprovider, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteUserCollection"] + """Gets the list of users of a static site. + + Description for Gets the list of users of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param authprovider: The auth provider for the users. + :type authprovider: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteUserCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.StaticSiteUserCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_users.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'authprovider': self._serialize.url("authprovider", authprovider, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteUserCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_static_site_users.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/listUsers'} # type: ignore + + def delete_static_site_user( + self, + resource_group_name, # type: str + name, # type: str + authprovider, # type: str + userid, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the user entry from the static site. + + Description for Deletes the user entry from the static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the staticsite. + :type name: str + :param authprovider: The auth provider for this user. + :type authprovider: str + :param userid: The user id of the user. + :type userid: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_static_site_user.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'authprovider': self._serialize.url("authprovider", authprovider, 'str'), + 'userid': self._serialize.url("userid", userid, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_static_site_user.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}'} # type: ignore + + def update_static_site_user( + self, + resource_group_name, # type: str + name, # type: str + authprovider, # type: str + userid, # type: str + static_site_user_envelope, # type: "_models.StaticSiteUserARMResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteUserARMResource" + """Updates a user entry with the listed roles. + + Description for Updates a user entry with the listed roles. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param authprovider: The auth provider for this user. + :type authprovider: str + :param userid: The user id of the user. + :type userid: str + :param static_site_user_envelope: A JSON representation of the StaticSiteUser properties. See + example. + :type static_site_user_envelope: ~azure.mgmt.web.v2020_09_01.models.StaticSiteUserARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteUserARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StaticSiteUserARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_static_site_user.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'authprovider': self._serialize.url("authprovider", authprovider, 'str'), + 'userid': self._serialize.url("userid", userid, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_user_envelope, 'StaticSiteUserARMResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteUserARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_static_site_user.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}'} # type: ignore + + def get_static_site_builds( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteBuildCollection"] + """Gets all static site builds for a particular static site. + + Description for Gets all static site builds for a particular static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteBuildCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.StaticSiteBuildCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteBuildCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_static_site_builds.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteBuildCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_static_site_builds.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds'} # type: ignore + + def get_static_site_build( + self, + resource_group_name, # type: str + name, # type: str + pr_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteBuildARMResource" + """Gets the details of a static site build. + + Description for Gets the details of a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteBuildARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StaticSiteBuildARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteBuildARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_static_site_build.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteBuildARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}'} # type: ignore + + def delete_static_site_build( + self, + resource_group_name, # type: str + name, # type: str + pr_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a static site build. + + Description for Deletes a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_static_site_build.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}'} # type: ignore + + def create_or_update_static_site_build_function_app_settings( + self, + resource_group_name, # type: str + name, # type: str + pr_id, # type: str + app_settings, # type: "_models.StringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Creates or updates the function app settings of a static site build. + + Description for Creates or updates the function app settings of a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_id: str + :param app_settings: + :type app_settings: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site_build_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site_build_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/config/functionappsettings'} # type: ignore + + def list_static_site_build_functions( + self, + resource_group_name, # type: str + name, # type: str + pr_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteFunctionOverviewCollection"] + """Gets the functions of a particular static site build. + + Description for Gets the functions of a particular static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteFunctionOverviewCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.StaticSiteFunctionOverviewCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteFunctionOverviewCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_build_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteFunctionOverviewCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_static_site_build_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/functions'} # type: ignore + + def list_static_site_build_function_app_settings( + self, + resource_group_name, # type: str + name, # type: str + pr_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Gets the application settings of a static site. + + Description for Gets the application settings of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param pr_id: The stage site identifier. + :type pr_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_build_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'prId': self._serialize.url("pr_id", pr_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_build_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/listFunctionAppSettings'} # type: ignore + + def create_or_update_static_site_function_app_settings( + self, + resource_group_name, # type: str + name, # type: str + app_settings, # type: "_models.StringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Creates or updates the function app settings of a static site. + + Description for Creates or updates the function app settings of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param app_settings: + :type app_settings: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/functionappsettings'} # type: ignore + + def create_user_roles_invitation_link( + self, + resource_group_name, # type: str + name, # type: str + static_site_user_roles_invitation_envelope, # type: "_models.StaticSiteUserInvitationRequestResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteUserInvitationResponseResource" + """Creates an invitation link for a user with the role. + + Description for Creates an invitation link for a user with the role. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param static_site_user_roles_invitation_envelope: + :type static_site_user_roles_invitation_envelope: ~azure.mgmt.web.v2020_09_01.models.StaticSiteUserInvitationRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteUserInvitationResponseResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StaticSiteUserInvitationResponseResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserInvitationResponseResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_user_roles_invitation_link.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_user_roles_invitation_envelope, 'StaticSiteUserInvitationRequestResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteUserInvitationResponseResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_user_roles_invitation_link.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/createUserInvitation'} # type: ignore + + def list_static_site_custom_domains( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteCustomDomainOverviewCollection"] + """Gets all static site custom domains for a particular static site. + + Description for Gets all static site custom domains for a particular static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site resource to search in. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteCustomDomainOverviewCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.StaticSiteCustomDomainOverviewCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCustomDomainOverviewCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_custom_domains.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteCustomDomainOverviewCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_static_site_custom_domains.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains'} # type: ignore + + def create_or_update_static_site_custom_domain( + self, + resource_group_name, # type: str + name, # type: str + domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteCustomDomainOverviewARMResource" + """Creates a new static site custom domain in an existing resource group and static site. + + Description for Creates a new static site custom domain in an existing resource group and + static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param domain_name: The custom domain to create. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteCustomDomainOverviewARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StaticSiteCustomDomainOverviewARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCustomDomainOverviewARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site_custom_domain.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteCustomDomainOverviewARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteCustomDomainOverviewARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site_custom_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}'} # type: ignore + + def delete_static_site_custom_domain( + self, + resource_group_name, # type: str + name, # type: str + domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a custom domain. + + Description for Deletes a custom domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param domain_name: The custom domain to delete. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_static_site_custom_domain.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_static_site_custom_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}'} # type: ignore + + def validate_custom_domain_can_be_added_to_static_site( + self, + resource_group_name, # type: str + name, # type: str + domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Validates a particular custom domain can be added to a static site. + + Description for Validates a particular custom domain can be added to a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param domain_name: The custom domain to validate. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.validate_custom_domain_can_be_added_to_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + validate_custom_domain_can_be_added_to_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}/validate'} # type: ignore + + def detach_static_site( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Detaches a static site. + + Description for Detaches a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to detach. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.detach_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + detach_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/detach'} # type: ignore + + def list_static_site_functions( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteFunctionOverviewCollection"] + """Gets the functions of a static site. + + Description for Gets the functions of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteFunctionOverviewCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.StaticSiteFunctionOverviewCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteFunctionOverviewCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteFunctionOverviewCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_static_site_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/functions'} # type: ignore + + def list_static_site_function_app_settings( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Gets the application settings of a static site. + + Description for Gets the application settings of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listFunctionAppSettings'} # type: ignore + + def list_static_site_secrets( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Lists the secrets for an existing static site. + + Description for Lists the secrets for an existing static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listSecrets'} # type: ignore + + def reset_static_site_api_key( + self, + resource_group_name, # type: str + name, # type: str + reset_properties_envelope, # type: "_models.StaticSiteResetPropertiesARMResource" + **kwargs # type: Any + ): + # type: (...) -> None + """Resets the api key for an existing static site. + + Description for Resets the api key for an existing static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param reset_properties_envelope: + :type reset_properties_envelope: ~azure.mgmt.web.v2020_09_01.models.StaticSiteResetPropertiesARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.reset_static_site_api_key.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(reset_properties_envelope, 'StaticSiteResetPropertiesARMResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_static_site_api_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/resetapikey'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_top_level_domains_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_top_level_domains_operations.py new file mode 100644 index 000000000000..192cb6cb501d --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_top_level_domains_operations.py @@ -0,0 +1,259 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class TopLevelDomainsOperations(object): + """TopLevelDomainsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.TopLevelDomainCollection"] + """Get all top-level domains supported for registration. + + Description for Get all top-level domains supported for registration. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TopLevelDomainCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.TopLevelDomainCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TopLevelDomainCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TopLevelDomainCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains'} # type: ignore + + def get( + self, + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.TopLevelDomain" + """Get details of a top-level domain. + + Description for Get details of a top-level domain. + + :param name: Name of the top-level domain. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TopLevelDomain, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.TopLevelDomain + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TopLevelDomain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TopLevelDomain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}'} # type: ignore + + def list_agreements( + self, + name, # type: str + agreement_option, # type: "_models.TopLevelDomainAgreementOption" + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.TldLegalAgreementCollection"] + """Gets all legal agreements that user needs to accept before purchasing a domain. + + Description for Gets all legal agreements that user needs to accept before purchasing a domain. + + :param name: Name of the top-level domain. + :type name: str + :param agreement_option: Domain agreement options. + :type agreement_option: ~azure.mgmt.web.v2020_09_01.models.TopLevelDomainAgreementOption + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TldLegalAgreementCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.TldLegalAgreementCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TldLegalAgreementCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_agreements.metadata['url'] # type: ignore + path_format_arguments = { + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(agreement_option, 'TopLevelDomainAgreementOption') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(agreement_option, 'TopLevelDomainAgreementOption') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TldLegalAgreementCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_agreements.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}/listAgreements'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_web_apps_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_web_apps_operations.py new file mode 100644 index 000000000000..410a72c91d64 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_web_apps_operations.py @@ -0,0 +1,28958 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, IO, Iterable, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WebAppsOperations(object): + """WebAppsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppCollection"] + """Get all apps for a subscription. + + Description for Get all apps for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/sites'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + include_slots=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppCollection"] + """Gets all web, mobile, and API apps in the specified resource group. + + Description for Gets all web, mobile, and API apps in the specified resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param include_slots: Specify :code:`true` to include deployment slots in + results. The default is false, which only gives you the production slot of all apps. + :type include_slots: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if include_slots is not None: + query_parameters['includeSlots'] = self._serialize.query("include_slots", include_slots, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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.Web/sites'} # type: ignore + + def get( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Site"] + """Gets the details of a web, mobile, or API app. + + Description for Gets the details of a web, mobile, or API app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Site or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Site"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + name, # type: str + site_envelope, # type: "_models.Site" + **kwargs # type: Any + ): + # type: (...) -> "_models.Site" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'Site') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + name, # type: str + site_envelope, # type: "_models.Site" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Site"] + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2020_09_01.models.Site + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 Site or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + site_envelope=site_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + name, # type: str + delete_metrics=None, # type: Optional[bool] + delete_empty_server_farm=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a web, mobile, or API app, or one of the deployment slots. + + Description for Deletes a web, mobile, or API app, or one of the deployment slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app to delete. + :type name: str + :param delete_metrics: If true, web app metrics are also deleted. + :type delete_metrics: bool + :param delete_empty_server_farm: Specify false if you want to keep empty App Service plan. By + default, empty App Service plan is deleted. + :type delete_empty_server_farm: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if delete_metrics is not None: + query_parameters['deleteMetrics'] = self._serialize.query("delete_metrics", delete_metrics, 'bool') + if delete_empty_server_farm is not None: + query_parameters['deleteEmptyServerFarm'] = self._serialize.query("delete_empty_server_farm", delete_empty_server_farm, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + name, # type: str + site_envelope, # type: "_models.SitePatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.Site" + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2020_09_01.models.SitePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Site + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'SitePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + def analyze_custom_hostname( + self, + resource_group_name, # type: str + name, # type: str + host_name=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.CustomHostnameAnalysisResult" + """Analyze a custom hostname. + + Description for Analyze a custom hostname. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param host_name: Custom hostname. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CustomHostnameAnalysisResult, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.CustomHostnameAnalysisResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomHostnameAnalysisResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.analyze_custom_hostname.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if host_name is not None: + query_parameters['hostName'] = self._serialize.query("host_name", host_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CustomHostnameAnalysisResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + analyze_custom_hostname.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/analyzeCustomHostname'} # type: ignore + + def apply_slot_config_to_production( + self, + resource_group_name, # type: str + name, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> None + """Applies the configuration settings from the target slot onto the current slot. + + Description for Applies the configuration settings from the target slot onto the current slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_09_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.apply_slot_config_to_production.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + apply_slot_config_to_production.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/applySlotConfig'} # type: ignore + + def backup( + self, + resource_group_name, # type: str + name, # type: str + request, # type: "_models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupItem" + """Creates a backup of an app. + + Description for Creates a backup of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: Backup configuration. You can use the JSON response from the POST action as + input here. + :type request: ~azure.mgmt.web.v2020_09_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.backup.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backup'} # type: ignore + + def list_backups( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BackupItemCollection"] + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_backups.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_backups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups'} # type: ignore + + def get_backup_status( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupItem" + """Gets a backup of an app by its ID. + + Description for Gets a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}'} # type: ignore + + def delete_backup( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a backup of an app by its ID. + + Description for Deletes a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}'} # type: ignore + + def list_backup_status_secrets( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + request, # type: "_models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupItem" + """Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + + Description for Gets status of a web app backup that may be in progress, including secrets + associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the + SAS URL for the backup if a new URL is passed in the request body. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param backup_id: ID of backup. + :type backup_id: str + :param request: Information on backup request. + :type request: ~azure.mgmt.web.v2020_09_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_backup_status_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_backup_status_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/list'} # type: ignore + + def _restore_initial( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore'} # type: ignore + + def begin_restore( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores a specific backup to another app (or deployment slot, if specified). + + Description for Restores a specific backup to another app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2020_09_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_initial( + resource_group_name=resource_group_name, + name=name, + backup_id=backup_id, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore'} # type: ignore + + def get_basic_publishing_credentials_policies( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.CsmPublishingCredentialsPoliciesCollection" + """Returns whether Scm basic auth is allowed and whether Ftp is allowed for a given site. + + Description for Returns whether Scm basic auth is allowed and whether Ftp is allowed for a + given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesCollection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingCredentialsPoliciesCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_basic_publishing_credentials_policies.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_basic_publishing_credentials_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies'} # type: ignore + + def get_ftp_allowed( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.CsmPublishingCredentialsPoliciesEntity" + """Returns whether FTP is allowed on the site or not. + + Description for Returns whether FTP is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_ftp_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ftp_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/ftp'} # type: ignore + + def update_ftp_allowed( + self, + resource_group_name, # type: str + name, # type: str + csm_publishing_access_policies_entity, # type: "_models.CsmPublishingCredentialsPoliciesEntity" + **kwargs # type: Any + ): + # type: (...) -> "_models.CsmPublishingCredentialsPoliciesEntity" + """Updates whether FTP is allowed on the site or not. + + Description for Updates whether FTP is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param csm_publishing_access_policies_entity: + :type csm_publishing_access_policies_entity: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingCredentialsPoliciesEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_ftp_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(csm_publishing_access_policies_entity, 'CsmPublishingCredentialsPoliciesEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_ftp_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/ftp'} # type: ignore + + def get_scm_allowed( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.CsmPublishingCredentialsPoliciesEntity" + """Returns whether Scm basic auth is allowed on the site or not. + + Description for Returns whether Scm basic auth is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_scm_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_scm_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/scm'} # type: ignore + + def update_scm_allowed( + self, + resource_group_name, # type: str + name, # type: str + csm_publishing_access_policies_entity, # type: "_models.CsmPublishingCredentialsPoliciesEntity" + **kwargs # type: Any + ): + # type: (...) -> "_models.CsmPublishingCredentialsPoliciesEntity" + """Updates whether user publishing credentials are allowed on the site or not. + + Description for Updates whether user publishing credentials are allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param csm_publishing_access_policies_entity: + :type csm_publishing_access_policies_entity: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingCredentialsPoliciesEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_scm_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(csm_publishing_access_policies_entity, 'CsmPublishingCredentialsPoliciesEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_scm_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/scm'} # type: ignore + + def list_configurations( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteConfigResourceCollection"] + """List the configurations of an app. + + Description for List the configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigResourceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.SiteConfigResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configurations.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_configurations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config'} # type: ignore + + def update_application_settings( + self, + resource_group_name, # type: str + name, # type: str + app_settings, # type: "_models.StringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Replaces the application settings of an app. + + Description for Replaces the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param app_settings: Application settings of the app. + :type app_settings: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_application_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_application_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings'} # type: ignore + + def list_application_settings( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Gets the application settings of an app. + + Description for Gets the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_application_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_application_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings/list'} # type: ignore + + def update_auth_settings( + self, + resource_group_name, # type: str + name, # type: str + site_auth_settings, # type: "_models.SiteAuthSettings" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettings" + """Updates the Authentication / Authorization settings associated with web app. + + Description for Updates the Authentication / Authorization settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param site_auth_settings: Auth settings associated with web app. + :type site_auth_settings: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings, 'SiteAuthSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings'} # type: ignore + + def get_auth_settings( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettings" + """Gets the Authentication/Authorization settings of an app. + + Description for Gets the Authentication/Authorization settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings/list'} # type: ignore + + def update_auth_settings_v2( + self, + resource_group_name, # type: str + name, # type: str + site_auth_settings_v2, # type: "_models.SiteAuthSettingsV2" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettingsV2" + """Updates site's Authentication / Authorization settings for apps via the V2 format. + + Description for Updates site's Authentication / Authorization settings for apps via the V2 + format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param site_auth_settings_v2: Auth settings associated with web app. + :type site_auth_settings_v2: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettingsV2 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings_v2, 'SiteAuthSettingsV2') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2'} # type: ignore + + def get_auth_settings_v2( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettingsV2" + """Gets site's Authentication / Authorization settings for apps via the V2 format. + + Description for Gets site's Authentication / Authorization settings for apps via the V2 format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2/list'} # type: ignore + + def update_azure_storage_accounts( + self, + resource_group_name, # type: str + name, # type: str + azure_storage_accounts, # type: "_models.AzureStoragePropertyDictionaryResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AzureStoragePropertyDictionaryResource" + """Updates the Azure storage account configurations of an app. + + Description for Updates the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param azure_storage_accounts: Azure storage accounts of the app. + :type azure_storage_accounts: ~azure.mgmt.web.v2020_09_01.models.AzureStoragePropertyDictionaryResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_azure_storage_accounts.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(azure_storage_accounts, 'AzureStoragePropertyDictionaryResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_azure_storage_accounts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts'} # type: ignore + + def list_azure_storage_accounts( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AzureStoragePropertyDictionaryResource" + """Gets the Azure storage account configurations of an app. + + Description for Gets the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_azure_storage_accounts.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_azure_storage_accounts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts/list'} # type: ignore + + def update_backup_configuration( + self, + resource_group_name, # type: str + name, # type: str + request, # type: "_models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupRequest" + """Updates the backup configuration of an app. + + Description for Updates the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: Edited backup configuration. + :type request: ~azure.mgmt.web.v2020_09_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_backup_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_backup_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup'} # type: ignore + + def delete_backup_configuration( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the backup configuration of an app. + + Description for Deletes the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup'} # type: ignore + + def get_backup_configuration( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupRequest" + """Gets the backup configuration of an app. + + Description for Gets the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup/list'} # type: ignore + + def update_connection_strings( + self, + resource_group_name, # type: str + name, # type: str + connection_strings, # type: "_models.ConnectionStringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.ConnectionStringDictionary" + """Replaces the connection strings of an app. + + Description for Replaces the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_strings: Connection strings of the app or deployment slot. See example. + :type connection_strings: ~azure.mgmt.web.v2020_09_01.models.ConnectionStringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_connection_strings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_strings, 'ConnectionStringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_connection_strings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings'} # type: ignore + + def list_connection_strings( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ConnectionStringDictionary" + """Gets the connection strings of an app. + + Description for Gets the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_connection_strings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_connection_strings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings/list'} # type: ignore + + def get_diagnostic_logs_configuration( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteLogsConfig" + """Gets the logging configuration of an app. + + Description for Gets the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostic_logs_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostic_logs_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs'} # type: ignore + + def update_diagnostic_logs_config( + self, + resource_group_name, # type: str + name, # type: str + site_logs_config, # type: "_models.SiteLogsConfig" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteLogsConfig" + """Updates the logging configuration of an app. + + Description for Updates the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_logs_config: A SiteLogsConfig JSON object that contains the logging configuration + to change in the "properties" property. + :type site_logs_config: ~azure.mgmt.web.v2020_09_01.models.SiteLogsConfig + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_diagnostic_logs_config.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_logs_config, 'SiteLogsConfig') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_diagnostic_logs_config.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs'} # type: ignore + + def update_metadata( + self, + resource_group_name, # type: str + name, # type: str + metadata, # type: "_models.StringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Replaces the metadata of an app. + + Description for Replaces the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param metadata: Edited metadata of the app or deployment slot. See example. + :type metadata: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_metadata.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(metadata, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_metadata.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata'} # type: ignore + + def list_metadata( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Gets the metadata of an app. + + Description for Gets the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_metadata.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_metadata.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata/list'} # type: ignore + + def _list_publishing_credentials_initial( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.User" + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._list_publishing_credentials_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_publishing_credentials_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list'} # type: ignore + + def begin_list_publishing_credentials( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.User"] + """Gets the Git/FTP publishing credentials of an app. + + Description for Gets the Git/FTP publishing credentials of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type 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: True for ARMPolling, False for no polling, or a + polling object for 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 User or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._list_publishing_credentials_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_publishing_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list'} # type: ignore + + def update_site_push_settings( + self, + resource_group_name, # type: str + name, # type: str + push_settings, # type: "_models.PushSettings" + **kwargs # type: Any + ): + # type: (...) -> "_models.PushSettings" + """Updates the Push settings associated with web app. + + Description for Updates the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param push_settings: Push settings associated with web app. + :type push_settings: ~azure.mgmt.web.v2020_09_01.models.PushSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_site_push_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(push_settings, 'PushSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_site_push_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings'} # type: ignore + + def list_site_push_settings( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PushSettings" + """Gets the Push settings associated with web app. + + Description for Gets the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_site_push_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_site_push_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings/list'} # type: ignore + + def list_slot_configuration_names( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SlotConfigNamesResource" + """Gets the names of app settings and connection strings that stick to the slot (not swapped). + + Description for Gets the names of app settings and connection strings that stick to the slot + (not swapped). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SlotConfigNamesResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SlotConfigNamesResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotConfigNamesResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_slot_configuration_names.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SlotConfigNamesResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_slot_configuration_names.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames'} # type: ignore + + def update_slot_configuration_names( + self, + resource_group_name, # type: str + name, # type: str + slot_config_names, # type: "_models.SlotConfigNamesResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.SlotConfigNamesResource" + """Updates the names of application settings and connection string that remain with the slot during swap operation. + + Description for Updates the names of application settings and connection string that remain + with the slot during swap operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_config_names: Names of application settings and connection strings. See example. + :type slot_config_names: ~azure.mgmt.web.v2020_09_01.models.SlotConfigNamesResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SlotConfigNamesResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SlotConfigNamesResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotConfigNamesResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_slot_configuration_names.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_config_names, 'SlotConfigNamesResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SlotConfigNamesResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_slot_configuration_names.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames'} # type: ignore + + def get_configuration( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, Always On, etc. + + Description for Gets the configuration of an app, such as platform version and bitness, default + documents, virtual applications, Always On, etc. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} # type: ignore + + def create_or_update_configuration( + self, + resource_group_name, # type: str + name, # type: str + site_config, # type: "_models.SiteConfigResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} # type: ignore + + def update_configuration( + self, + resource_group_name, # type: str + name, # type: str + site_config, # type: "_models.SiteConfigResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} # type: ignore + + def list_configuration_snapshot_info( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteConfigurationSnapshotInfoCollection"] + """Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. + + Description for Gets a list of web app configuration snapshots identifiers. Each element of the + list contains a timestamp and the ID of the snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigurationSnapshotInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.SiteConfigurationSnapshotInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigurationSnapshotInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configuration_snapshot_info.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigurationSnapshotInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_configuration_snapshot_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots'} # type: ignore + + def get_configuration_snapshot( + self, + resource_group_name, # type: str + name, # type: str + snapshot_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Gets a snapshot of the configuration of an app at a previous point in time. + + Description for Gets a snapshot of the configuration of an app at a previous point in time. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration_snapshot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}'} # type: ignore + + def recover_site_configuration_snapshot( + self, + resource_group_name, # type: str + name, # type: str + snapshot_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Reverts the configuration of an app to a previous snapshot. + + Description for Reverts the configuration of an app to a previous snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.recover_site_configuration_snapshot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + recover_site_configuration_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}/recover'} # type: ignore + + def get_web_site_container_logs( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[IO] + """Gets the last lines of docker logs for the given site. + + Description for Gets the last lines of docker logs for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/octet-stream" + + # Construct URL + url = self.get_web_site_container_logs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_site_container_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs'} # type: ignore + + def get_container_logs_zip( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[IO] + """Gets the ZIP archived docker log files for the given site. + + Description for Gets the ZIP archived docker log files for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/zip" + + # Construct URL + url = self.get_container_logs_zip.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_container_logs_zip.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download'} # type: ignore + + def list_continuous_web_jobs( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ContinuousWebJobCollection"] + """List continuous web jobs for an app, or a deployment slot. + + Description for List continuous web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ContinuousWebJobCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ContinuousWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContinuousWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_continuous_web_jobs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ContinuousWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_continuous_web_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs'} # type: ignore + + def get_continuous_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ContinuousWebJob"] + """Gets a continuous web job by its ID for an app, or a deployment slot. + + Description for Gets a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ContinuousWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ContinuousWebJob or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ContinuousWebJob"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ContinuousWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'} # type: ignore + + def delete_continuous_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a continuous web job by its ID for an app, or a deployment slot. + + Description for Delete a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'} # type: ignore + + def start_continuous_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Start a continuous web job for an app, or a deployment slot. + + Description for Start a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.start_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start'} # type: ignore + + def stop_continuous_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stop a continuous web job for an app, or a deployment slot. + + Description for Stop a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.stop_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop'} # type: ignore + + def list_deployments( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DeploymentCollection"] + """List deployments for an app, or a deployment slot. + + Description for List deployments for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeploymentCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.DeploymentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_deployments.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DeploymentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_deployments.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments'} # type: ignore + + def get_deployment( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Deployment" + """Get a deployment by its ID for an app, or a deployment slot. + + Description for Get a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_deployment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} # type: ignore + + def create_deployment( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + deployment, # type: "_models.Deployment" + **kwargs # type: Any + ): + # type: (...) -> "_models.Deployment" + """Create a deployment for an app, or a deployment slot. + + Description for Create a deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: ID of an existing deployment. + :type id: str + :param deployment: Deployment details. + :type deployment: ~azure.mgmt.web.v2020_09_01.models.Deployment + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_deployment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(deployment, 'Deployment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} # type: ignore + + def delete_deployment( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a deployment by its ID for an app, or a deployment slot. + + Description for Delete a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_deployment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} # type: ignore + + def list_deployment_log( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Deployment" + """List deployment log for specific deployment for an app, or a deployment slot. + + Description for List deployment log for specific deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: The ID of a specific deployment. This is the value of the name property in the JSON + response from "GET /api/sites/{siteName}/deployments". + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_deployment_log.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_deployment_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log'} # type: ignore + + def discover_backup( + self, + resource_group_name, # type: str + name, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.RestoreRequest" + """Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information about the databases stored in a backup. + + Description for Discovers an existing app backup that can be restored from a blob in Azure + storage. Use this to get information about the databases stored in a backup. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: A RestoreRequest object that includes Azure storage URL and blog name for + discovery of backup. + :type request: ~azure.mgmt.web.v2020_09_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RestoreRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RestoreRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestoreRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.discover_backup.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RestoreRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + discover_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup'} # type: ignore + + def list_domain_ownership_identifiers( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.IdentifierCollection"] + """Lists ownership identifiers for domain associated with web app. + + Description for Lists ownership identifiers for domain associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IdentifierCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.IdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_domain_ownership_identifiers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_domain_ownership_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers'} # type: ignore + + def get_domain_ownership_identifier( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Identifier" + """Get domain ownership identifier for web app. + + Description for Get domain ownership identifier for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def create_or_update_domain_ownership_identifier( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + domain_ownership_identifier, # type: "_models.Identifier" + **kwargs # type: Any + ): + # type: (...) -> "_models.Identifier" + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_09_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def delete_domain_ownership_identifier( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a domain ownership identifier for a web app. + + Description for Deletes a domain ownership identifier for a web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def update_domain_ownership_identifier( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + domain_ownership_identifier, # type: "_models.Identifier" + **kwargs # type: Any + ): + # type: (...) -> "_models.Identifier" + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_09_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def get_ms_deploy_status( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MSDeployStatus" + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} # type: ignore + + def _create_ms_deploy_operation_initial( + self, + resource_group_name, # type: str + name, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MSDeployStatus"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployStatus"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_ms_deploy_operation_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201, 409]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_ms_deploy_operation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} # type: ignore + + def begin_create_ms_deploy_operation( + self, + resource_group_name, # type: str + name, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.MSDeployStatus"] + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2020_09_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_ms_deploy_operation_initial( + resource_group_name=resource_group_name, + name=name, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_ms_deploy_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} # type: ignore + + def get_ms_deploy_log( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MSDeployLog"] + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.MSDeployLog or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployLog"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_log.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log'} # type: ignore + + def list_functions( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.FunctionEnvelopeCollection"] + """List the functions for a web site, or a deployment slot. + + Description for List the functions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FunctionEnvelopeCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.FunctionEnvelopeCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelopeCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('FunctionEnvelopeCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions'} # type: ignore + + def get_functions_admin_token( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> str + """Fetch a short lived token that can be exchanged for a master key. + + Description for Fetch a short lived token that can be exchanged for a master key. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_functions_admin_token.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_functions_admin_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token'} # type: ignore + + def get_function( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.FunctionEnvelope"] + """Get function information by its ID for web site, or a deployment slot. + + Description for Get function information by its ID for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionEnvelope, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.FunctionEnvelope or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FunctionEnvelope"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_function.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + def _create_function_initial( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + function_envelope, # type: "_models.FunctionEnvelope" + **kwargs # type: Any + ): + # type: (...) -> "_models.FunctionEnvelope" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_function_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(function_envelope, 'FunctionEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_function_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + def begin_create_function( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + function_envelope, # type: "_models.FunctionEnvelope" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.FunctionEnvelope"] + """Create function for web site, or a deployment slot. + + Description for Create function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param function_envelope: Function details. + :type function_envelope: ~azure.mgmt.web.v2020_09_01.models.FunctionEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 FunctionEnvelope or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.FunctionEnvelope] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_function_initial( + resource_group_name=resource_group_name, + name=name, + function_name=function_name, + function_envelope=function_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + def delete_function( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a function for web site, or a deployment slot. + + Description for Delete a function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_function.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + def create_or_update_function_secret( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + key_name, # type: str + key, # type: "_models.KeyInfo" + **kwargs # type: Any + ): + # type: (...) -> "_models.KeyInfo" + """Add or update a function secret. + + Description for Add or update a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2020_09_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_function_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_function_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}'} # type: ignore + + def delete_function_secret( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + key_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a function secret. + + Description for Delete a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_function_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_function_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}'} # type: ignore + + def list_function_keys( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Get function keys for a function in a web site, or a deployment slot. + + Description for Get function keys for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_function_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listkeys'} # type: ignore + + def list_function_secrets( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FunctionSecrets" + """Get function secrets for a function in a web site, or a deployment slot. + + Description for Get function secrets for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_function_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets'} # type: ignore + + def list_host_keys( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HostKeys" + """Get host secrets for a function app. + + Description for Get host secrets for a function app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostKeys, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HostKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_host_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_host_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listkeys'} # type: ignore + + def list_sync_status( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + list_sync_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listsyncstatus'} # type: ignore + + def sync_functions( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.sync_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/sync'} # type: ignore + + def create_or_update_host_secret( + self, + resource_group_name, # type: str + name, # type: str + key_type, # type: str + key_name, # type: str + key, # type: "_models.KeyInfo" + **kwargs # type: Any + ): + # type: (...) -> "_models.KeyInfo" + """Add or update a host level secret. + + Description for Add or update a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2020_09_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}'} # type: ignore + + def delete_host_secret( + self, + resource_group_name, # type: str + name, # type: str + key_type, # type: str + key_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a host level secret. + + Description for Delete a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}'} # type: ignore + + def list_host_name_bindings( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.HostNameBindingCollection"] + """Get hostname bindings for an app or a deployment slot. + + Description for Get hostname bindings for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HostNameBindingCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.HostNameBindingCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBindingCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_host_name_bindings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('HostNameBindingCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_host_name_bindings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings'} # type: ignore + + def get_host_name_binding( + self, + resource_group_name, # type: str + name, # type: str + host_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HostNameBinding" + """Get the named hostname binding for an app (or deployment slot, if specified). + + Description for Get the named hostname binding for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_host_name_binding.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} # type: ignore + + def create_or_update_host_name_binding( + self, + resource_group_name, # type: str + name, # type: str + host_name, # type: str + host_name_binding, # type: "_models.HostNameBinding" + **kwargs # type: Any + ): + # type: (...) -> "_models.HostNameBinding" + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :param host_name_binding: Binding details. This is the JSON representation of a HostNameBinding + object. + :type host_name_binding: ~azure.mgmt.web.v2020_09_01.models.HostNameBinding + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_name_binding.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(host_name_binding, 'HostNameBinding') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} # type: ignore + + def delete_host_name_binding( + self, + resource_group_name, # type: str + name, # type: str + host_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_name_binding.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} # type: ignore + + def get_hybrid_connection( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def create_or_update_hybrid_connection( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + connection_envelope, # type: "_models.HybridConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def delete_hybrid_connection( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Removes a Hybrid Connection from this site. + + Description for Removes a Hybrid Connection from this site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def update_hybrid_connection( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + connection_envelope, # type: "_models.HybridConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def list_hybrid_connections( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Retrieves all Service Bus Hybrid Connections used by this Web App. + + Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_hybrid_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_hybrid_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays'} # type: ignore + + def list_relay_service_connections( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Gets hybrid connections configured for an app (or deployment slot, if specified). + + Description for Gets hybrid connections configured for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_relay_service_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_relay_service_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection'} # type: ignore + + def get_relay_service_connection( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Gets a hybrid connection configuration by its name. + + Description for Gets a hybrid connection configuration by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection. + :type entity_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + def create_or_update_relay_service_connection( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + connection_envelope, # type: "_models.RelayServiceConnectionEntity" + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + def delete_relay_service_connection( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a relay service connection by its name. + + Description for Deletes a relay service connection by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + def update_relay_service_connection( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + connection_envelope, # type: "_models.RelayServiceConnectionEntity" + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + def list_instance_identifiers( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppInstanceStatusCollection"] + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppInstanceStatusCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.WebAppInstanceStatusCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppInstanceStatusCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_identifiers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppInstanceStatusCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances'} # type: ignore + + def get_instance_info( + self, + resource_group_name, # type: str + name, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WebSiteInstanceStatus" + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param instance_id: + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebSiteInstanceStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.WebSiteInstanceStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebSiteInstanceStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_info.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebSiteInstanceStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}'} # type: ignore + + def get_instance_ms_deploy_status( + self, + resource_group_name, # type: str + name, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MSDeployStatus" + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + def _create_instance_ms_deploy_operation_initial( + self, + resource_group_name, # type: str + name, # type: str + instance_id, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MSDeployStatus"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployStatus"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_instance_ms_deploy_operation_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201, 409]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_instance_ms_deploy_operation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + def begin_create_instance_ms_deploy_operation( + self, + resource_group_name, # type: str + name, # type: str + instance_id, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.MSDeployStatus"] + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param instance_id: ID of web app instance. + :type instance_id: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2020_09_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_instance_ms_deploy_operation_initial( + resource_group_name=resource_group_name, + name=name, + instance_id=instance_id, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_instance_ms_deploy_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + def get_instance_ms_deploy_log( + self, + resource_group_name, # type: str + name, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MSDeployLog"] + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.MSDeployLog or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployLog"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_log.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log'} # type: ignore + + def list_instance_processes( + self, + resource_group_name, # type: str + name, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessInfoCollection"] + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_processes.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_processes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes'} # type: ignore + + def get_instance_process( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProcessInfo"] + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ProcessInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'} # type: ignore + + def delete_instance_process( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_instance_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_instance_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'} # type: ignore + + def get_instance_process_dump( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[IO] + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_dump.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_dump.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump'} # type: ignore + + def list_instance_process_modules( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessModuleInfoCollection"] + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessModuleInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_modules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_process_modules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules'} # type: ignore + + def get_instance_process_module( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + base_address, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProcessModuleInfo"] + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ProcessModuleInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessModuleInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_module.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_module.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_instance_process_threads( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessThreadInfoCollection"] + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessThreadInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_threads.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_process_threads.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads'} # type: ignore + + def is_cloneable( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteCloneability" + """Shows whether an app can be cloned to another resource group or subscription. + + Description for Shows whether an app can be cloned to another resource group or subscription. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteCloneability, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteCloneability + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteCloneability"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.is_cloneable.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteCloneability', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + is_cloneable.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable'} # type: ignore + + def list_site_backups( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BackupItemCollection"] + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_backups.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_backups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listbackups'} # type: ignore + + def list_sync_function_triggers( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FunctionSecrets" + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_function_triggers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_sync_function_triggers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus'} # type: ignore + + def _migrate_storage_initial( + self, + subscription_name, # type: str + resource_group_name, # type: str + name, # type: str + migration_options, # type: "_models.StorageMigrationOptions" + **kwargs # type: Any + ): + # type: (...) -> "_models.StorageMigrationResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageMigrationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._migrate_storage_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['subscriptionName'] = self._serialize.query("subscription_name", subscription_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(migration_options, 'StorageMigrationOptions') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageMigrationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _migrate_storage_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate'} # type: ignore + + def begin_migrate_storage( + self, + subscription_name, # type: str + resource_group_name, # type: str + name, # type: str + migration_options, # type: "_models.StorageMigrationOptions" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.StorageMigrationResponse"] + """Restores a web app. + + Description for Restores a web app. + + :param subscription_name: Azure subscription. + :type subscription_name: str + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param migration_options: Migration migrationOptions. + :type migration_options: ~azure.mgmt.web.v2020_09_01.models.StorageMigrationOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 StorageMigrationResponse or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.StorageMigrationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageMigrationResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._migrate_storage_initial( + subscription_name=subscription_name, + resource_group_name=resource_group_name, + name=name, + migration_options=migration_options, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageMigrationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_migrate_storage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate'} # type: ignore + + def _migrate_my_sql_initial( + self, + resource_group_name, # type: str + name, # type: str + migration_request_envelope, # type: "_models.MigrateMySqlRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.Operation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Operation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._migrate_my_sql_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(migration_request_envelope, 'MigrateMySqlRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Operation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _migrate_my_sql_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql'} # type: ignore + + def begin_migrate_my_sql( + self, + resource_group_name, # type: str + name, # type: str + migration_request_envelope, # type: "_models.MigrateMySqlRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Operation"] + """Migrates a local (in-app) MySql database to a remote MySql database. + + Description for Migrates a local (in-app) MySql database to a remote MySql database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param migration_request_envelope: MySql migration options. + :type migration_request_envelope: ~azure.mgmt.web.v2020_09_01.models.MigrateMySqlRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 Operation or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Operation"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._migrate_my_sql_initial( + resource_group_name=resource_group_name, + name=name, + migration_request_envelope=migration_request_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Operation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_migrate_my_sql.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql'} # type: ignore + + def get_migrate_my_sql_status( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MigrateMySqlStatus" + """Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. + + Description for Returns the status of MySql in app migration, if one is active, and whether or + not MySql in app is enabled. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MigrateMySqlStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.MigrateMySqlStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrateMySqlStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_migrate_my_sql_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MigrateMySqlStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_migrate_my_sql_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status'} # type: ignore + + def get_swift_virtual_network_connection( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SwiftVirtualNetwork" + """Gets a Swift Virtual Network connection. + + Description for Gets a Swift Virtual Network connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_swift_virtual_network_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + def create_or_update_swift_virtual_network_connection( + self, + resource_group_name, # type: str + name, # type: str + connection_envelope, # type: "_models.SwiftVirtualNetwork" + **kwargs # type: Any + ): + # type: (...) -> "_models.SwiftVirtualNetwork" + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_swift_virtual_network_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + def delete_swift_virtual_network( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a Swift Virtual Network connection from an app (or deployment slot). + + Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_swift_virtual_network.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_swift_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + def update_swift_virtual_network_connection( + self, + resource_group_name, # type: str + name, # type: str + connection_envelope, # type: "_models.SwiftVirtualNetwork" + **kwargs # type: Any + ): + # type: (...) -> "_models.SwiftVirtualNetwork" + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_swift_virtual_network_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + def list_network_features( + self, + resource_group_name, # type: str + name, # type: str + view, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.NetworkFeatures"] + """Gets all network features used by the app (or deployment slot, if specified). + + Description for Gets all network features used by the app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param view: The type of view. This can either be "summary" or "detailed". + :type view: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFeatures, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.NetworkFeatures or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NetworkFeatures"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_network_features.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'view': self._serialize.url("view", view, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('NetworkFeatures', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_network_features.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}'} # type: ignore + + def get_network_trace_operation( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}'} # type: ignore + + def start_web_site_network_trace( + self, + resource_group_name, # type: str + name, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> str + """Start capturing network packets for the site (To be deprecated). + + Description for Start capturing network packets for the site (To be deprecated). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.start_web_site_network_trace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + start_web_site_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start'} # type: ignore + + def _start_web_site_network_trace_operation_initial( + self, + resource_group_name, # type: str + name, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._start_web_site_network_trace_operation_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_web_site_network_trace_operation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation'} # type: ignore + + def begin_start_web_site_network_trace_operation( + self, + resource_group_name, # type: str + name, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[List["_models.NetworkTrace"]] + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_web_site_network_trace_operation_initial( + resource_group_name=resource_group_name, + name=name, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_web_site_network_trace_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation'} # type: ignore + + def stop_web_site_network_trace( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.stop_web_site_network_trace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_web_site_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop'} # type: ignore + + def get_network_traces( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}'} # type: ignore + + def get_network_trace_operation_v2( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}'} # type: ignore + + def get_network_traces_v2( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}'} # type: ignore + + def generate_new_site_publishing_password( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Generates a new publishing password for an app (or deployment slot, if specified). + + Description for Generates a new publishing password for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.generate_new_site_publishing_password.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + generate_new_site_publishing_password.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword'} # type: ignore + + def list_perf_mon_counters( + self, + resource_group_name, # type: str + name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PerfMonCounterCollection"] + """Gets perfmon counters for web app. + + Description for Gets perfmon counters for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z + and timeGrain eq duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PerfMonCounterCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.PerfMonCounterCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PerfMonCounterCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_perf_mon_counters.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PerfMonCounterCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_perf_mon_counters.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters'} # type: ignore + + def get_site_php_error_log_flag( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SitePhpErrorLogFlag" + """Gets web app's event logs. + + Description for Gets web app's event logs. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SitePhpErrorLogFlag, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SitePhpErrorLogFlag + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SitePhpErrorLogFlag"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_php_error_log_flag.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SitePhpErrorLogFlag', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_php_error_log_flag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging'} # type: ignore + + def list_premier_add_ons( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Gets the premier add-ons of an app. + + Description for Gets the premier add-ons of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_premier_add_ons.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_premier_add_ons.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons'} # type: ignore + + def get_premier_add_on( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Gets a named add-on of an app. + + Description for Gets a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + def add_premier_add_on( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + premier_add_on, # type: "_models.PremierAddOn" + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2020_09_01.models.PremierAddOn + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.add_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOn') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + add_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + def delete_premier_add_on( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a premier add-on from an app. + + Description for Delete a premier add-on from an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + def update_premier_add_on( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + premier_add_on, # type: "_models.PremierAddOnPatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2020_09_01.models.PremierAddOnPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOnPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + def get_private_access( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateAccess" + """Gets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Gets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_private_access.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'} # type: ignore + + def put_private_access_vnet( + self, + resource_group_name, # type: str + name, # type: str + access, # type: "_models.PrivateAccess" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateAccess" + """Sets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Sets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param access: The information for the private access. + :type access: ~azure.mgmt.web.v2020_09_01.models.PrivateAccess + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put_private_access_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(access, 'PrivateAccess') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_private_access_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'} # type: ignore + + def list_processes( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessInfoCollection"] + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_processes.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_processes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes'} # type: ignore + + def get_process( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProcessInfo"] + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ProcessInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'} # type: ignore + + def delete_process( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'} # type: ignore + + def get_process_dump( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[IO] + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_process_dump.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_dump.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump'} # type: ignore + + def list_process_modules( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessModuleInfoCollection"] + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessModuleInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_modules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_process_modules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules'} # type: ignore + + def get_process_module( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + base_address, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProcessModuleInfo"] + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ProcessModuleInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessModuleInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_process_module.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_module.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_process_threads( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessThreadInfoCollection"] + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessThreadInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_threads.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_process_threads.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads'} # type: ignore + + def list_public_certificates( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PublicCertificateCollection"] + """Get public certificates for an app or a deployment slot. + + Description for Get public certificates for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicCertificateCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.PublicCertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_public_certificates.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PublicCertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_public_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates'} # type: ignore + + def get_public_certificate( + self, + resource_group_name, # type: str + name, # type: str + public_certificate_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PublicCertificate" + """Get the named public certificate for an app (or deployment slot, if specified). + + Description for Get the named public certificate for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_public_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} # type: ignore + + def create_or_update_public_certificate( + self, + resource_group_name, # type: str + name, # type: str + public_certificate_name, # type: str + public_certificate, # type: "_models.PublicCertificate" + **kwargs # type: Any + ): + # type: (...) -> "_models.PublicCertificate" + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :param public_certificate: Public certificate details. This is the JSON representation of a + PublicCertificate object. + :type public_certificate: ~azure.mgmt.web.v2020_09_01.models.PublicCertificate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_public_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(public_certificate, 'PublicCertificate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} # type: ignore + + def delete_public_certificate( + self, + resource_group_name, # type: str + name, # type: str + public_certificate_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_public_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} # type: ignore + + def list_publishing_profile_xml_with_secrets( + self, + resource_group_name, # type: str + name, # type: str + publishing_profile_options, # type: "_models.CsmPublishingProfileOptions" + **kwargs # type: Any + ): + # type: (...) -> IO + """Gets the publishing profile for an app (or deployment slot, if specified). + + Description for Gets the publishing profile for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param publishing_profile_options: Specifies publishingProfileOptions for publishing profile. + For example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + :type publishing_profile_options: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingProfileOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/xml" + + # Construct URL + url = self.list_publishing_profile_xml_with_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(publishing_profile_options, 'CsmPublishingProfileOptions') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_publishing_profile_xml_with_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml'} # type: ignore + + def reset_production_slot_config( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Resets the configuration settings of the current slot if they were previously modified by calling the API with POST. + + Description for Resets the configuration settings of the current slot if they were previously + modified by calling the API with POST. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.reset_production_slot_config.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_production_slot_config.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig'} # type: ignore + + def restart( + self, + resource_group_name, # type: str + name, # type: str + soft_restart=None, # type: Optional[bool] + synchronous=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + """Restarts an app (or deployment slot, if specified). + + Description for Restarts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param soft_restart: Specify true to apply the configuration settings and restarts the app only + if necessary. By default, the API always restarts and reprovisions the app. + :type soft_restart: bool + :param synchronous: Specify true to block until the app is restarted. By default, it is set to + false, and the API responds immediately (asynchronous). + :type synchronous: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.restart.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if soft_restart is not None: + query_parameters['softRestart'] = self._serialize.query("soft_restart", soft_restart, 'bool') + if synchronous is not None: + query_parameters['synchronous'] = self._serialize.query("synchronous", synchronous, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart'} # type: ignore + + def _restore_from_backup_blob_initial( + self, + resource_group_name, # type: str + name, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_backup_blob_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_backup_blob_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob'} # type: ignore + + def begin_restore_from_backup_blob( + self, + resource_group_name, # type: str + name, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores an app from a backup blob in Azure Storage. + + Description for Restores an app from a backup blob in Azure Storage. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2020_09_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_from_backup_blob_initial( + resource_group_name=resource_group_name, + name=name, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_backup_blob.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob'} # type: ignore + + def _restore_from_deleted_app_initial( + self, + resource_group_name, # type: str + name, # type: str + restore_request, # type: "_models.DeletedAppRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_deleted_app_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'DeletedAppRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_deleted_app_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp'} # type: ignore + + def begin_restore_from_deleted_app( + self, + resource_group_name, # type: str + name, # type: str + restore_request, # type: "_models.DeletedAppRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores a deleted web app to this web app. + + Description for Restores a deleted web app to this web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param restore_request: Deleted web app restore information. + :type restore_request: ~azure.mgmt.web.v2020_09_01.models.DeletedAppRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_from_deleted_app_initial( + resource_group_name=resource_group_name, + name=name, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_deleted_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp'} # type: ignore + + def _restore_snapshot_initial( + self, + resource_group_name, # type: str + name, # type: str + restore_request, # type: "_models.SnapshotRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_snapshot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'SnapshotRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_snapshot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot'} # type: ignore + + def begin_restore_snapshot( + self, + resource_group_name, # type: str + name, # type: str + restore_request, # type: "_models.SnapshotRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores a web app from a snapshot. + + Description for Restores a web app from a snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param restore_request: Snapshot restore settings. Snapshot information can be obtained by + calling GetDeletedSites or GetSiteSnapshots API. + :type restore_request: ~azure.mgmt.web.v2020_09_01.models.SnapshotRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_snapshot_initial( + resource_group_name=resource_group_name, + name=name, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot'} # type: ignore + + def list_site_extensions( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteExtensionInfoCollection"] + """Get list of siteextensions for a web site, or a deployment slot. + + Description for Get list of siteextensions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteExtensionInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.SiteExtensionInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_extensions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_extensions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions'} # type: ignore + + def get_site_extension( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.SiteExtensionInfo"] + """Get site extension information by its ID for a web site, or a deployment slot. + + Description for Get site extension information by its ID for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteExtensionInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteExtensionInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SiteExtensionInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_extension.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + def _install_site_extension_initial( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.SiteExtensionInfo"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SiteExtensionInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._install_site_extension_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 429]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _install_site_extension_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + def begin_install_site_extension( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SiteExtensionInfo"] + """Install site extension on a web site, or a deployment slot. + + Description for Install site extension on a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 SiteExtensionInfo or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.SiteExtensionInfo] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfo"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._install_site_extension_initial( + resource_group_name=resource_group_name, + name=name, + site_extension_id=site_extension_id, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + def delete_site_extension( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Remove a site extension from a web site, or a deployment slot. + + Description for Remove a site extension from a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_site_extension.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + def _copy_production_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + copy_slot_entity, # type: "_models.CsmCopySlotEntity" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._copy_production_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(copy_slot_entity, 'CsmCopySlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _copy_production_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotcopy'} # type: ignore + + def begin_copy_production_slot( + self, + resource_group_name, # type: str + name, # type: str + copy_slot_entity, # type: "_models.CsmCopySlotEntity" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Copies a deployment slot to another deployment slot of an app. + + Description for Copies a deployment slot to another deployment slot of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param copy_slot_entity: JSON object that contains the target slot name and site config + properties to override the source slot config. See example. + :type copy_slot_entity: ~azure.mgmt.web.v2020_09_01.models.CsmCopySlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._copy_production_slot_initial( + resource_group_name=resource_group_name, + name=name, + copy_slot_entity=copy_slot_entity, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_copy_production_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotcopy'} # type: ignore + + def list_slots( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppCollection"] + """Gets an app's deployment slots. + + Description for Gets an app's deployment slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_slots.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_slots.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots'} # type: ignore + + def get_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Site"] + """Gets the details of a web, mobile, or API app. + + Description for Gets the details of a web, mobile, or API app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. By default, this API returns the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Site or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Site"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + def _create_or_update_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_envelope, # type: "_models.Site" + **kwargs # type: Any + ): + # type: (...) -> "_models.Site" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'Site') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + def begin_create_or_update_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_envelope, # type: "_models.Site" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Site"] + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param slot: Name of the deployment slot to create or update. By default, this API attempts to + create or modify the production slot. + :type slot: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2020_09_01.models.Site + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 Site or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + site_envelope=site_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + def delete_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + delete_metrics=None, # type: Optional[bool] + delete_empty_server_farm=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a web, mobile, or API app, or one of the deployment slots. + + Description for Deletes a web, mobile, or API app, or one of the deployment slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app to delete. + :type name: str + :param slot: Name of the deployment slot to delete. By default, the API deletes the production + slot. + :type slot: str + :param delete_metrics: If true, web app metrics are also deleted. + :type delete_metrics: bool + :param delete_empty_server_farm: Specify true if the App Service plan will be empty after app + deletion and you want to delete the empty App Service plan. By default, the empty App Service + plan is not deleted. + :type delete_empty_server_farm: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if delete_metrics is not None: + query_parameters['deleteMetrics'] = self._serialize.query("delete_metrics", delete_metrics, 'bool') + if delete_empty_server_farm is not None: + query_parameters['deleteEmptyServerFarm'] = self._serialize.query("delete_empty_server_farm", delete_empty_server_farm, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + def update_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_envelope, # type: "_models.SitePatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.Site" + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param slot: Name of the deployment slot to create or update. By default, this API attempts to + create or modify the production slot. + :type slot: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2020_09_01.models.SitePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Site + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'SitePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + def analyze_custom_hostname_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + host_name=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.CustomHostnameAnalysisResult" + """Analyze a custom hostname. + + Description for Analyze a custom hostname. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param host_name: Custom hostname. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CustomHostnameAnalysisResult, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.CustomHostnameAnalysisResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomHostnameAnalysisResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.analyze_custom_hostname_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if host_name is not None: + query_parameters['hostName'] = self._serialize.query("host_name", host_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CustomHostnameAnalysisResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + analyze_custom_hostname_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/analyzeCustomHostname'} # type: ignore + + def apply_slot_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> None + """Applies the configuration settings from the target slot onto the current slot. + + Description for Applies the configuration settings from the target slot onto the current slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_09_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.apply_slot_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + apply_slot_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig'} # type: ignore + + def backup_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + request, # type: "_models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupItem" + """Creates a backup of an app. + + Description for Creates a backup of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create a + backup for the production slot. + :type slot: str + :param request: Backup configuration. You can use the JSON response from the POST action as + input here. + :type request: ~azure.mgmt.web.v2020_09_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.backup_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup'} # type: ignore + + def list_backups_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BackupItemCollection"] + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get backups + of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_backups_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_backups_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups'} # type: ignore + + def get_backup_status_slot( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupItem" + """Gets a backup of an app by its ID. + + Description for Gets a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a backup + of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}'} # type: ignore + + def delete_backup_slot( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a backup of an app by its ID. + + Description for Deletes a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete a + backup of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}'} # type: ignore + + def list_backup_status_secrets_slot( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + slot, # type: str + request, # type: "_models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupItem" + """Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + + Description for Gets status of a web app backup that may be in progress, including secrets + associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the + SAS URL for the backup if a new URL is passed in the request body. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param backup_id: ID of backup. + :type backup_id: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param request: Information on backup request. + :type request: ~azure.mgmt.web.v2020_09_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_backup_status_secrets_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_backup_status_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list'} # type: ignore + + def _restore_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + slot, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore'} # type: ignore + + def begin_restore_slot( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + slot, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores a specific backup to another app (or deployment slot, if specified). + + Description for Restores a specific backup to another app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will restore a + backup of the production slot. + :type slot: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2020_09_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_slot_initial( + resource_group_name=resource_group_name, + name=name, + backup_id=backup_id, + slot=slot, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore'} # type: ignore + + def list_configurations_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteConfigResourceCollection"] + """List the configurations of an app. + + Description for List the configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigResourceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.SiteConfigResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configurations_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_configurations_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config'} # type: ignore + + def update_application_settings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + app_settings, # type: "_models.StringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Replaces the application settings of an app. + + Description for Replaces the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + application settings for the production slot. + :type slot: str + :param app_settings: Application settings of the app. + :type app_settings: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_application_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_application_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings'} # type: ignore + + def list_application_settings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Gets the application settings of an app. + + Description for Gets the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + application settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_application_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_application_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list'} # type: ignore + + def update_auth_settings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_auth_settings, # type: "_models.SiteAuthSettings" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettings" + """Updates the Authentication / Authorization settings associated with web app. + + Description for Updates the Authentication / Authorization settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param site_auth_settings: Auth settings associated with web app. + :type site_auth_settings: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings, 'SiteAuthSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings'} # type: ignore + + def get_auth_settings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettings" + """Gets the Authentication/Authorization settings of an app. + + Description for Gets the Authentication/Authorization settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list'} # type: ignore + + def update_auth_settings_v2_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_auth_settings_v2, # type: "_models.SiteAuthSettingsV2" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettingsV2" + """Updates site's Authentication / Authorization settings for apps via the V2 format. + + Description for Updates site's Authentication / Authorization settings for apps via the V2 + format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param site_auth_settings_v2: Auth settings associated with web app. + :type site_auth_settings_v2: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettingsV2 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings_v2_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings_v2, 'SiteAuthSettingsV2') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings_v2_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2'} # type: ignore + + def get_auth_settings_v2_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettingsV2" + """Gets site's Authentication / Authorization settings for apps via the V2 format. + + Description for Gets site's Authentication / Authorization settings for apps via the V2 format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings_v2_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings_v2_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2/list'} # type: ignore + + def update_azure_storage_accounts_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + azure_storage_accounts, # type: "_models.AzureStoragePropertyDictionaryResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AzureStoragePropertyDictionaryResource" + """Updates the Azure storage account configurations of an app. + + Description for Updates the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + Azure storage account configurations for the production slot. + :type slot: str + :param azure_storage_accounts: Azure storage accounts of the app. + :type azure_storage_accounts: ~azure.mgmt.web.v2020_09_01.models.AzureStoragePropertyDictionaryResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_azure_storage_accounts_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(azure_storage_accounts, 'AzureStoragePropertyDictionaryResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_azure_storage_accounts_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts'} # type: ignore + + def list_azure_storage_accounts_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AzureStoragePropertyDictionaryResource" + """Gets the Azure storage account configurations of an app. + + Description for Gets the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + Azure storage account configurations for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_azure_storage_accounts_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_azure_storage_accounts_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts/list'} # type: ignore + + def update_backup_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + request, # type: "_models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupRequest" + """Updates the backup configuration of an app. + + Description for Updates the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + backup configuration for the production slot. + :type slot: str + :param request: Edited backup configuration. + :type request: ~azure.mgmt.web.v2020_09_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_backup_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup'} # type: ignore + + def delete_backup_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the backup configuration of an app. + + Description for Deletes the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + backup configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup'} # type: ignore + + def get_backup_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupRequest" + """Gets the backup configuration of an app. + + Description for Gets the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + backup configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list'} # type: ignore + + def update_connection_strings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + connection_strings, # type: "_models.ConnectionStringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.ConnectionStringDictionary" + """Replaces the connection strings of an app. + + Description for Replaces the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + connection settings for the production slot. + :type slot: str + :param connection_strings: Connection strings of the app or deployment slot. See example. + :type connection_strings: ~azure.mgmt.web.v2020_09_01.models.ConnectionStringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_connection_strings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_strings, 'ConnectionStringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_connection_strings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings'} # type: ignore + + def list_connection_strings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ConnectionStringDictionary" + """Gets the connection strings of an app. + + Description for Gets the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + connection settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_connection_strings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_connection_strings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list'} # type: ignore + + def get_diagnostic_logs_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteLogsConfig" + """Gets the logging configuration of an app. + + Description for Gets the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + logging configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostic_logs_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostic_logs_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs'} # type: ignore + + def update_diagnostic_logs_config_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_logs_config, # type: "_models.SiteLogsConfig" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteLogsConfig" + """Updates the logging configuration of an app. + + Description for Updates the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + logging configuration for the production slot. + :type slot: str + :param site_logs_config: A SiteLogsConfig JSON object that contains the logging configuration + to change in the "properties" property. + :type site_logs_config: ~azure.mgmt.web.v2020_09_01.models.SiteLogsConfig + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_diagnostic_logs_config_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_logs_config, 'SiteLogsConfig') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_diagnostic_logs_config_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs'} # type: ignore + + def update_metadata_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + metadata, # type: "_models.StringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Replaces the metadata of an app. + + Description for Replaces the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + metadata for the production slot. + :type slot: str + :param metadata: Edited metadata of the app or deployment slot. See example. + :type metadata: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_metadata_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(metadata, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_metadata_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata'} # type: ignore + + def list_metadata_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Gets the metadata of an app. + + Description for Gets the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + metadata for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_metadata_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_metadata_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list'} # type: ignore + + def _list_publishing_credentials_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.User" + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._list_publishing_credentials_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_publishing_credentials_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list'} # type: ignore + + def begin_list_publishing_credentials_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.User"] + """Gets the Git/FTP publishing credentials of an app. + + Description for Gets the Git/FTP publishing credentials of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + publishing credentials for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 User or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._list_publishing_credentials_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_publishing_credentials_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list'} # type: ignore + + def update_site_push_settings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + push_settings, # type: "_models.PushSettings" + **kwargs # type: Any + ): + # type: (...) -> "_models.PushSettings" + """Updates the Push settings associated with web app. + + Description for Updates the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param push_settings: Push settings associated with web app. + :type push_settings: ~azure.mgmt.web.v2020_09_01.models.PushSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_site_push_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(push_settings, 'PushSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_site_push_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings'} # type: ignore + + def list_site_push_settings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PushSettings" + """Gets the Push settings associated with web app. + + Description for Gets the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_site_push_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_site_push_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings/list'} # type: ignore + + def get_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, Always On, etc. + + Description for Gets the configuration of an app, such as platform version and bitness, default + documents, virtual applications, Always On, etc. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} # type: ignore + + def create_or_update_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_config, # type: "_models.SiteConfigResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update + configuration for the production slot. + :type slot: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} # type: ignore + + def update_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_config, # type: "_models.SiteConfigResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update + configuration for the production slot. + :type slot: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} # type: ignore + + def list_configuration_snapshot_info_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteConfigurationSnapshotInfoCollection"] + """Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. + + Description for Gets a list of web app configuration snapshots identifiers. Each element of the + list contains a timestamp and the ID of the snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigurationSnapshotInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.SiteConfigurationSnapshotInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigurationSnapshotInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configuration_snapshot_info_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigurationSnapshotInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_configuration_snapshot_info_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots'} # type: ignore + + def get_configuration_snapshot_slot( + self, + resource_group_name, # type: str + name, # type: str + snapshot_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Gets a snapshot of the configuration of an app at a previous point in time. + + Description for Gets a snapshot of the configuration of an app at a previous point in time. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration_snapshot_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}'} # type: ignore + + def recover_site_configuration_snapshot_slot( + self, + resource_group_name, # type: str + name, # type: str + snapshot_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Reverts the configuration of an app to a previous snapshot. + + Description for Reverts the configuration of an app to a previous snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.recover_site_configuration_snapshot_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + recover_site_configuration_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}/recover'} # type: ignore + + def get_web_site_container_logs_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[IO] + """Gets the last lines of docker logs for the given site. + + Description for Gets the last lines of docker logs for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/octet-stream" + + # Construct URL + url = self.get_web_site_container_logs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_site_container_logs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs'} # type: ignore + + def get_container_logs_zip_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[IO] + """Gets the ZIP archived docker log files for the given site. + + Description for Gets the ZIP archived docker log files for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/zip" + + # Construct URL + url = self.get_container_logs_zip_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_container_logs_zip_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download'} # type: ignore + + def list_continuous_web_jobs_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ContinuousWebJobCollection"] + """List continuous web jobs for an app, or a deployment slot. + + Description for List continuous web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ContinuousWebJobCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ContinuousWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContinuousWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_continuous_web_jobs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ContinuousWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_continuous_web_jobs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs'} # type: ignore + + def get_continuous_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ContinuousWebJob"] + """Gets a continuous web job by its ID for an app, or a deployment slot. + + Description for Gets a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ContinuousWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ContinuousWebJob or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ContinuousWebJob"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ContinuousWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}'} # type: ignore + + def delete_continuous_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a continuous web job by its ID for an app, or a deployment slot. + + Description for Delete a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}'} # type: ignore + + def start_continuous_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Start a continuous web job for an app, or a deployment slot. + + Description for Start a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.start_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/start'} # type: ignore + + def stop_continuous_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stop a continuous web job for an app, or a deployment slot. + + Description for Stop a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.stop_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/stop'} # type: ignore + + def list_deployments_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DeploymentCollection"] + """List deployments for an app, or a deployment slot. + + Description for List deployments for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeploymentCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.DeploymentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_deployments_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DeploymentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_deployments_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments'} # type: ignore + + def get_deployment_slot( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Deployment" + """Get a deployment by its ID for an app, or a deployment slot. + + Description for Get a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets a deployment + for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_deployment_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} # type: ignore + + def create_deployment_slot( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + slot, # type: str + deployment, # type: "_models.Deployment" + **kwargs # type: Any + ): + # type: (...) -> "_models.Deployment" + """Create a deployment for an app, or a deployment slot. + + Description for Create a deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: ID of an existing deployment. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API creates a + deployment for the production slot. + :type slot: str + :param deployment: Deployment details. + :type deployment: ~azure.mgmt.web.v2020_09_01.models.Deployment + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_deployment_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(deployment, 'Deployment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} # type: ignore + + def delete_deployment_slot( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a deployment by its ID for an app, or a deployment slot. + + Description for Delete a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_deployment_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} # type: ignore + + def list_deployment_log_slot( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Deployment" + """List deployment log for specific deployment for an app, or a deployment slot. + + Description for List deployment log for specific deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: The ID of a specific deployment. This is the value of the name property in the JSON + response from "GET /api/sites/{siteName}/deployments". + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_deployment_log_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_deployment_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log'} # type: ignore + + def discover_backup_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.RestoreRequest" + """Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information about the databases stored in a backup. + + Description for Discovers an existing app backup that can be restored from a blob in Azure + storage. Use this to get information about the databases stored in a backup. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will perform + discovery for the production slot. + :type slot: str + :param request: A RestoreRequest object that includes Azure storage URL and blog name for + discovery of backup. + :type request: ~azure.mgmt.web.v2020_09_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RestoreRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RestoreRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestoreRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.discover_backup_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RestoreRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + discover_backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/discoverbackup'} # type: ignore + + def list_domain_ownership_identifiers_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.IdentifierCollection"] + """Lists ownership identifiers for domain associated with web app. + + Description for Lists ownership identifiers for domain associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IdentifierCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.IdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_domain_ownership_identifiers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_domain_ownership_identifiers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers'} # type: ignore + + def get_domain_ownership_identifier_slot( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Identifier" + """Get domain ownership identifier for web app. + + Description for Get domain ownership identifier for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def create_or_update_domain_ownership_identifier_slot( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + slot, # type: str + domain_ownership_identifier, # type: "_models.Identifier" + **kwargs # type: Any + ): + # type: (...) -> "_models.Identifier" + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_09_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def delete_domain_ownership_identifier_slot( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a domain ownership identifier for a web app. + + Description for Deletes a domain ownership identifier for a web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def update_domain_ownership_identifier_slot( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + slot, # type: str + domain_ownership_identifier, # type: "_models.Identifier" + **kwargs # type: Any + ): + # type: (...) -> "_models.Identifier" + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2020_09_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def get_ms_deploy_status_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MSDeployStatus" + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} # type: ignore + + def _create_ms_deploy_operation_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MSDeployStatus"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployStatus"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_ms_deploy_operation_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201, 409]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_ms_deploy_operation_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} # type: ignore + + def begin_create_ms_deploy_operation_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.MSDeployStatus"] + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2020_09_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_ms_deploy_operation_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_ms_deploy_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} # type: ignore + + def get_ms_deploy_log_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MSDeployLog"] + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.MSDeployLog or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployLog"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_log_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log'} # type: ignore + + def list_instance_functions_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.FunctionEnvelopeCollection"] + """List the functions for a web site, or a deployment slot. + + Description for List the functions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FunctionEnvelopeCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.FunctionEnvelopeCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelopeCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_functions_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('FunctionEnvelopeCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_functions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions'} # type: ignore + + def get_functions_admin_token_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> str + """Fetch a short lived token that can be exchanged for a master key. + + Description for Fetch a short lived token that can be exchanged for a master key. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_functions_admin_token_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_functions_admin_token_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/admin/token'} # type: ignore + + def get_instance_function_slot( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.FunctionEnvelope"] + """Get function information by its ID for web site, or a deployment slot. + + Description for Get function information by its ID for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionEnvelope, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.FunctionEnvelope or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FunctionEnvelope"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_function_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + def _create_instance_function_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + slot, # type: str + function_envelope, # type: "_models.FunctionEnvelope" + **kwargs # type: Any + ): + # type: (...) -> "_models.FunctionEnvelope" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_instance_function_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(function_envelope, 'FunctionEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_instance_function_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + def begin_create_instance_function_slot( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + slot, # type: str + function_envelope, # type: "_models.FunctionEnvelope" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.FunctionEnvelope"] + """Create function for web site, or a deployment slot. + + Description for Create function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :param function_envelope: Function details. + :type function_envelope: ~azure.mgmt.web.v2020_09_01.models.FunctionEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 FunctionEnvelope or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.FunctionEnvelope] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_instance_function_slot_initial( + resource_group_name=resource_group_name, + name=name, + function_name=function_name, + slot=slot, + function_envelope=function_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + def delete_instance_function_slot( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a function for web site, or a deployment slot. + + Description for Delete a function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_instance_function_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + def create_or_update_function_secret_slot( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + key_name, # type: str + slot, # type: str + key, # type: "_models.KeyInfo" + **kwargs # type: Any + ): + # type: (...) -> "_models.KeyInfo" + """Add or update a function secret. + + Description for Add or update a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2020_09_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_function_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_function_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}'} # type: ignore + + def delete_function_secret_slot( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + key_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a function secret. + + Description for Delete a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_function_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_function_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}'} # type: ignore + + def list_function_keys_slot( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Get function keys for a function in a web site, or a deployment slot. + + Description for Get function keys for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_function_keys_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_keys_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listkeys'} # type: ignore + + def list_function_secrets_slot( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FunctionSecrets" + """Get function secrets for a function in a web site, or a deployment slot. + + Description for Get function secrets for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_function_secrets_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets'} # type: ignore + + def list_host_keys_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HostKeys" + """Get host secrets for a function app. + + Description for Get host secrets for a function app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostKeys, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HostKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_host_keys_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_host_keys_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listkeys'} # type: ignore + + def list_sync_status_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + list_sync_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listsyncstatus'} # type: ignore + + def sync_functions_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.sync_functions_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_functions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/sync'} # type: ignore + + def create_or_update_host_secret_slot( + self, + resource_group_name, # type: str + name, # type: str + key_type, # type: str + key_name, # type: str + slot, # type: str + key, # type: "_models.KeyInfo" + **kwargs # type: Any + ): + # type: (...) -> "_models.KeyInfo" + """Add or update a host level secret. + + Description for Add or update a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2020_09_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}'} # type: ignore + + def delete_host_secret_slot( + self, + resource_group_name, # type: str + name, # type: str + key_type, # type: str + key_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a host level secret. + + Description for Delete a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}'} # type: ignore + + def list_host_name_bindings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.HostNameBindingCollection"] + """Get hostname bindings for an app or a deployment slot. + + Description for Get hostname bindings for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets hostname + bindings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HostNameBindingCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.HostNameBindingCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBindingCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_host_name_bindings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('HostNameBindingCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_host_name_bindings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings'} # type: ignore + + def get_host_name_binding_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + host_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HostNameBinding" + """Get the named hostname binding for an app (or deployment slot, if specified). + + Description for Get the named hostname binding for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API the named binding + for the production slot. + :type slot: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_host_name_binding_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} # type: ignore + + def create_or_update_host_name_binding_slot( + self, + resource_group_name, # type: str + name, # type: str + host_name, # type: str + slot, # type: str + host_name_binding, # type: "_models.HostNameBinding" + **kwargs # type: Any + ): + # type: (...) -> "_models.HostNameBinding" + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create a + binding for the production slot. + :type slot: str + :param host_name_binding: Binding details. This is the JSON representation of a HostNameBinding + object. + :type host_name_binding: ~azure.mgmt.web.v2020_09_01.models.HostNameBinding + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_name_binding_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(host_name_binding, 'HostNameBinding') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} # type: ignore + + def delete_host_name_binding_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + host_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_name_binding_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} # type: ignore + + def get_hybrid_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def create_or_update_hybrid_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.HybridConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def delete_hybrid_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Removes a Hybrid Connection from this site. + + Description for Removes a Hybrid Connection from this site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def update_hybrid_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.HybridConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def list_hybrid_connections_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Retrieves all Service Bus Hybrid Connections used by this Web App. + + Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_hybrid_connections_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_hybrid_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays'} # type: ignore + + def list_relay_service_connections_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Gets hybrid connections configured for an app (or deployment slot, if specified). + + Description for Gets hybrid connections configured for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get hybrid + connections for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_relay_service_connections_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_relay_service_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection'} # type: ignore + + def get_relay_service_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Gets a hybrid connection configuration by its name. + + Description for Gets a hybrid connection configuration by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a hybrid + connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + def create_or_update_relay_service_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.RelayServiceConnectionEntity" + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create or + update a hybrid connection for the production slot. + :type slot: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + def delete_relay_service_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a relay service connection by its name. + + Description for Deletes a relay service connection by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete a + hybrid connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + def update_relay_service_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.RelayServiceConnectionEntity" + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create or + update a hybrid connection for the production slot. + :type slot: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + def list_instance_identifiers_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppInstanceStatusCollection"] + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets the + production slot instances. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppInstanceStatusCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.WebAppInstanceStatusCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppInstanceStatusCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_identifiers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppInstanceStatusCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_identifiers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances'} # type: ignore + + def get_instance_info_slot( + self, + resource_group_name, # type: str + name, # type: str + instance_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WebSiteInstanceStatus" + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param instance_id: + :type instance_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets the + production slot instances. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebSiteInstanceStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.WebSiteInstanceStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebSiteInstanceStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_info_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebSiteInstanceStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_info_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}'} # type: ignore + + def get_instance_ms_deploy_status_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MSDeployStatus" + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + def _create_instance_ms_deploy_operation_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + instance_id, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MSDeployStatus"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployStatus"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_instance_ms_deploy_operation_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201, 409]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_instance_ms_deploy_operation_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + def begin_create_instance_ms_deploy_operation_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + instance_id, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.MSDeployStatus"] + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param instance_id: ID of web app instance. + :type instance_id: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2020_09_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_instance_ms_deploy_operation_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + instance_id=instance_id, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_instance_ms_deploy_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + def get_instance_ms_deploy_log_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MSDeployLog"] + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.MSDeployLog or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MSDeployLog"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_log_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log'} # type: ignore + + def list_instance_processes_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessInfoCollection"] + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_processes_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_processes_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes'} # type: ignore + + def get_instance_process_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProcessInfo"] + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ProcessInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'} # type: ignore + + def delete_instance_process_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_instance_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_instance_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'} # type: ignore + + def get_instance_process_dump_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[IO] + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_dump_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_dump_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump'} # type: ignore + + def list_instance_process_modules_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessModuleInfoCollection"] + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessModuleInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_modules_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_process_modules_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules'} # type: ignore + + def get_instance_process_module_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + base_address, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProcessModuleInfo"] + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ProcessModuleInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessModuleInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_module_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_module_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_instance_process_threads_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessThreadInfoCollection"] + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessThreadInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_threads_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_process_threads_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads'} # type: ignore + + def is_cloneable_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteCloneability" + """Shows whether an app can be cloned to another resource group or subscription. + + Description for Shows whether an app can be cloned to another resource group or subscription. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. By default, this API returns information on the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteCloneability, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteCloneability + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteCloneability"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.is_cloneable_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteCloneability', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + is_cloneable_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable'} # type: ignore + + def list_site_backups_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BackupItemCollection"] + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get backups + of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_backups_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_backups_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listbackups'} # type: ignore + + def list_sync_function_triggers_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FunctionSecrets" + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_function_triggers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_sync_function_triggers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus'} # type: ignore + + def get_migrate_my_sql_status_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MigrateMySqlStatus" + """Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. + + Description for Returns the status of MySql in app migration, if one is active, and whether or + not MySql in app is enabled. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MigrateMySqlStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.MigrateMySqlStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrateMySqlStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_migrate_my_sql_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MigrateMySqlStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_migrate_my_sql_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status'} # type: ignore + + def get_swift_virtual_network_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SwiftVirtualNetwork" + """Gets a Swift Virtual Network connection. + + Description for Gets a Swift Virtual Network connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a + gateway for the production slot's Virtual Network. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_swift_virtual_network_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_swift_virtual_network_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + def create_or_update_swift_virtual_network_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + connection_envelope, # type: "_models.SwiftVirtualNetwork" + **kwargs # type: Any + ): + # type: (...) -> "_models.SwiftVirtualNetwork" + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_swift_virtual_network_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_swift_virtual_network_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + def delete_swift_virtual_network_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a Swift Virtual Network connection from an app (or deployment slot). + + Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_swift_virtual_network_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_swift_virtual_network_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + def update_swift_virtual_network_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + connection_envelope, # type: "_models.SwiftVirtualNetwork" + **kwargs # type: Any + ): + # type: (...) -> "_models.SwiftVirtualNetwork" + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_swift_virtual_network_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_swift_virtual_network_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + def list_network_features_slot( + self, + resource_group_name, # type: str + name, # type: str + view, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.NetworkFeatures"] + """Gets all network features used by the app (or deployment slot, if specified). + + Description for Gets all network features used by the app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param view: The type of view. This can either be "summary" or "detailed". + :type view: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get network + features for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFeatures, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.NetworkFeatures or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NetworkFeatures"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_network_features_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'view': self._serialize.url("view", view, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('NetworkFeatures', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_network_features_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkFeatures/{view}'} # type: ignore + + def get_network_trace_operation_slot( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/operationresults/{operationId}'} # type: ignore + + def start_web_site_network_trace_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> str + """Start capturing network packets for the site (To be deprecated). + + Description for Start capturing network packets for the site (To be deprecated). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.start_web_site_network_trace_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + start_web_site_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/start'} # type: ignore + + def _start_web_site_network_trace_operation_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._start_web_site_network_trace_operation_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_web_site_network_trace_operation_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation'} # type: ignore + + def begin_start_web_site_network_trace_operation_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[List["_models.NetworkTrace"]] + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_web_site_network_trace_operation_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_web_site_network_trace_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation'} # type: ignore + + def stop_web_site_network_trace_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.stop_web_site_network_trace_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_web_site_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/stop'} # type: ignore + + def get_network_traces_slot( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/{operationId}'} # type: ignore + + def get_network_trace_operation_slot_v2( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation_slot_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation_slot_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/current/operationresults/{operationId}'} # type: ignore + + def get_network_traces_slot_v2( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces_slot_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces_slot_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/{operationId}'} # type: ignore + + def generate_new_site_publishing_password_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Generates a new publishing password for an app (or deployment slot, if specified). + + Description for Generates a new publishing password for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API generate a new + publishing password for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.generate_new_site_publishing_password_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + generate_new_site_publishing_password_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword'} # type: ignore + + def list_perf_mon_counters_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PerfMonCounterCollection"] + """Gets perfmon counters for web app. + + Description for Gets perfmon counters for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z + and timeGrain eq duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PerfMonCounterCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.PerfMonCounterCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PerfMonCounterCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_perf_mon_counters_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PerfMonCounterCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_perf_mon_counters_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/perfcounters'} # type: ignore + + def get_site_php_error_log_flag_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SitePhpErrorLogFlag" + """Gets web app's event logs. + + Description for Gets web app's event logs. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SitePhpErrorLogFlag, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SitePhpErrorLogFlag + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SitePhpErrorLogFlag"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_php_error_log_flag_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SitePhpErrorLogFlag', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_php_error_log_flag_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging'} # type: ignore + + def list_premier_add_ons_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Gets the premier add-ons of an app. + + Description for Gets the premier add-ons of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + premier add-ons for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_premier_add_ons_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_premier_add_ons_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons'} # type: ignore + + def get_premier_add_on_slot( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Gets a named add-on of an app. + + Description for Gets a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + named add-on for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + def add_premier_add_on_slot( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + slot, # type: str + premier_add_on, # type: "_models.PremierAddOn" + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + named add-on for the production slot. + :type slot: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2020_09_01.models.PremierAddOn + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.add_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOn') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + add_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + def delete_premier_add_on_slot( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a premier add-on from an app. + + Description for Delete a premier add-on from an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + named add-on for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + def update_premier_add_on_slot( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + slot, # type: str + premier_add_on, # type: "_models.PremierAddOnPatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + named add-on for the production slot. + :type slot: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2020_09_01.models.PremierAddOnPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOnPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + def get_private_access_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateAccess" + """Gets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Gets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_private_access_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_access_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks'} # type: ignore + + def put_private_access_vnet_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + access, # type: "_models.PrivateAccess" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateAccess" + """Sets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Sets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for the web app. + :type slot: str + :param access: The information for the private access. + :type access: ~azure.mgmt.web.v2020_09_01.models.PrivateAccess + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put_private_access_vnet_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(access, 'PrivateAccess') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_private_access_vnet_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks'} # type: ignore + + def get_private_endpoint_connection( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnectionResource" + """Gets a private endpoint connection. + + Description for Gets a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PrivateEndpointConnectionResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_private_endpoint_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _approve_or_reject_private_endpoint_connection_initial( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + private_endpoint_wrapper, # type: "_models.PrivateLinkConnectionApprovalRequestResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnectionResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._approve_or_reject_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_wrapper, 'PrivateLinkConnectionApprovalRequestResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _approve_or_reject_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_approve_or_reject_private_endpoint_connection( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + private_endpoint_wrapper, # type: "_models.PrivateLinkConnectionApprovalRequestResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PrivateEndpointConnectionResource"] + """Approves or rejects a private endpoint connection. + + Description for Approves or rejects a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :param private_endpoint_wrapper: + :type private_endpoint_wrapper: ~azure.mgmt.web.v2020_09_01.models.PrivateLinkConnectionApprovalRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 PrivateEndpointConnectionResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.PrivateEndpointConnectionResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._approve_or_reject_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + private_endpoint_wrapper=private_endpoint_wrapper, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_approve_or_reject_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _delete_private_endpoint_connection_initial( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> object + cls = kwargs.pop('cls', None) # type: ClsType[object] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 204: + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_delete_private_endpoint_connection( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[object] + """Deletes a private endpoint connection. + + Description for Deletes a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_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: True for ARMPolling, False for no polling, or a + polling object for 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 object or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[object] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[object] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def get_private_link_resources( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateLinkResourcesWrapper" + """Gets the private link resources. + + Description for Gets the private link resources. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesWrapper, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PrivateLinkResourcesWrapper + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourcesWrapper"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_private_link_resources.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourcesWrapper', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_link_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateLinkResources'} # type: ignore + + def list_processes_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessInfoCollection"] + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_processes_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_processes_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes'} # type: ignore + + def get_process_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProcessInfo"] + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ProcessInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}'} # type: ignore + + def delete_process_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}'} # type: ignore + + def get_process_dump_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[IO] + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_process_dump_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_dump_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/dump'} # type: ignore + + def list_process_modules_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessModuleInfoCollection"] + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessModuleInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_modules_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_process_modules_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules'} # type: ignore + + def get_process_module_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + base_address, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProcessModuleInfo"] + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ProcessModuleInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProcessModuleInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_process_module_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_module_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_process_threads_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessThreadInfoCollection"] + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.ProcessThreadInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_threads_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_process_threads_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads'} # type: ignore + + def list_public_certificates_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PublicCertificateCollection"] + """Get public certificates for an app or a deployment slot. + + Description for Get public certificates for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets hostname + bindings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicCertificateCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.PublicCertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_public_certificates_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PublicCertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_public_certificates_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates'} # type: ignore + + def get_public_certificate_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + public_certificate_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PublicCertificate" + """Get the named public certificate for an app (or deployment slot, if specified). + + Description for Get the named public certificate for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API the named binding + for the production slot. + :type slot: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_public_certificate_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_public_certificate_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'} # type: ignore + + def create_or_update_public_certificate_slot( + self, + resource_group_name, # type: str + name, # type: str + public_certificate_name, # type: str + slot, # type: str + public_certificate, # type: "_models.PublicCertificate" + **kwargs # type: Any + ): + # type: (...) -> "_models.PublicCertificate" + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create a + binding for the production slot. + :type slot: str + :param public_certificate: Public certificate details. This is the JSON representation of a + PublicCertificate object. + :type public_certificate: ~azure.mgmt.web.v2020_09_01.models.PublicCertificate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_public_certificate_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(public_certificate, 'PublicCertificate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_public_certificate_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'} # type: ignore + + def delete_public_certificate_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + public_certificate_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_public_certificate_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_public_certificate_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'} # type: ignore + + def list_publishing_profile_xml_with_secrets_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + publishing_profile_options, # type: "_models.CsmPublishingProfileOptions" + **kwargs # type: Any + ): + # type: (...) -> IO + """Gets the publishing profile for an app (or deployment slot, if specified). + + Description for Gets the publishing profile for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + publishing profile for the production slot. + :type slot: str + :param publishing_profile_options: Specifies publishingProfileOptions for publishing profile. + For example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + :type publishing_profile_options: ~azure.mgmt.web.v2020_09_01.models.CsmPublishingProfileOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/xml" + + # Construct URL + url = self.list_publishing_profile_xml_with_secrets_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(publishing_profile_options, 'CsmPublishingProfileOptions') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_publishing_profile_xml_with_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml'} # type: ignore + + def reset_slot_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Resets the configuration settings of the current slot if they were previously modified by calling the API with POST. + + Description for Resets the configuration settings of the current slot if they were previously + modified by calling the API with POST. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API resets + configuration settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.reset_slot_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_slot_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig'} # type: ignore + + def restart_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + soft_restart=None, # type: Optional[bool] + synchronous=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + """Restarts an app (or deployment slot, if specified). + + Description for Restarts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will restart the + production slot. + :type slot: str + :param soft_restart: Specify true to apply the configuration settings and restarts the app only + if necessary. By default, the API always restarts and reprovisions the app. + :type soft_restart: bool + :param synchronous: Specify true to block until the app is restarted. By default, it is set to + false, and the API responds immediately (asynchronous). + :type synchronous: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.restart_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if soft_restart is not None: + query_parameters['softRestart'] = self._serialize.query("soft_restart", soft_restart, 'bool') + if synchronous is not None: + query_parameters['synchronous'] = self._serialize.query("synchronous", synchronous, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restart_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restart'} # type: ignore + + def _restore_from_backup_blob_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_backup_blob_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_backup_blob_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob'} # type: ignore + + def begin_restore_from_backup_blob_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores an app from a backup blob in Azure Storage. + + Description for Restores an app from a backup blob in Azure Storage. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will restore a + backup of the production slot. + :type slot: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2020_09_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_from_backup_blob_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_backup_blob_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob'} # type: ignore + + def _restore_from_deleted_app_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + restore_request, # type: "_models.DeletedAppRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_deleted_app_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'DeletedAppRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_deleted_app_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp'} # type: ignore + + def begin_restore_from_deleted_app_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + restore_request, # type: "_models.DeletedAppRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores a deleted web app to this web app. + + Description for Restores a deleted web app to this web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param restore_request: Deleted web app restore information. + :type restore_request: ~azure.mgmt.web.v2020_09_01.models.DeletedAppRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_from_deleted_app_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_deleted_app_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp'} # type: ignore + + def _restore_snapshot_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + restore_request, # type: "_models.SnapshotRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_snapshot_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'SnapshotRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_snapshot_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot'} # type: ignore + + def begin_restore_snapshot_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + restore_request, # type: "_models.SnapshotRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores a web app from a snapshot. + + Description for Restores a web app from a snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param restore_request: Snapshot restore settings. Snapshot information can be obtained by + calling GetDeletedSites or GetSiteSnapshots API. + :type restore_request: ~azure.mgmt.web.v2020_09_01.models.SnapshotRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_snapshot_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot'} # type: ignore + + def list_site_extensions_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteExtensionInfoCollection"] + """Get list of siteextensions for a web site, or a deployment slot. + + Description for Get list of siteextensions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteExtensionInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.SiteExtensionInfoCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_extensions_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_extensions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions'} # type: ignore + + def get_site_extension_slot( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.SiteExtensionInfo"] + """Get site extension information by its ID for a web site, or a deployment slot. + + Description for Get site extension information by its ID for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteExtensionInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteExtensionInfo or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SiteExtensionInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_site_extension_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_extension_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + def _install_site_extension_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.SiteExtensionInfo"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SiteExtensionInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._install_site_extension_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 429]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _install_site_extension_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + def begin_install_site_extension_slot( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SiteExtensionInfo"] + """Install site extension on a web site, or a deployment slot. + + Description for Install site extension on a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 SiteExtensionInfo or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.SiteExtensionInfo] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfo"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._install_site_extension_slot_initial( + resource_group_name=resource_group_name, + name=name, + site_extension_id=site_extension_id, + slot=slot, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_site_extension_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + def delete_site_extension_slot( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Remove a site extension from a web site, or a deployment slot. + + Description for Remove a site extension from a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_site_extension_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_site_extension_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + def _copy_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + copy_slot_entity, # type: "_models.CsmCopySlotEntity" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._copy_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(copy_slot_entity, 'CsmCopySlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _copy_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotcopy'} # type: ignore + + def begin_copy_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + copy_slot_entity, # type: "_models.CsmCopySlotEntity" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Copies a deployment slot to another deployment slot of an app. + + Description for Copies a deployment slot to another deployment slot of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param copy_slot_entity: JSON object that contains the target slot name and site config + properties to override the source slot config. See example. + :type copy_slot_entity: ~azure.mgmt.web.v2020_09_01.models.CsmCopySlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._copy_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + copy_slot_entity=copy_slot_entity, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_copy_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotcopy'} # type: ignore + + def list_slot_differences_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SlotDifferenceCollection"] + """Get the difference in configuration settings between two web app slots. + + Description for Get the difference in configuration settings between two web app slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_09_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SlotDifferenceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.SlotDifferenceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotDifferenceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_slot_differences_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SlotDifferenceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_slot_differences_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs'} # type: ignore + + def _swap_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._swap_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _swap_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap'} # type: ignore + + def begin_swap_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Swaps two deployment slots of an app. + + Description for Swaps two deployment slots of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_09_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._swap_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + slot_swap_entity=slot_swap_entity, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_swap_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap'} # type: ignore + + def list_snapshots_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SnapshotCollection"] + """Returns all Snapshots to the user. + + Description for Returns all Snapshots to the user. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :param slot: Website Slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_snapshots_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots'} # type: ignore + + def list_snapshots_from_dr_secondary_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SnapshotCollection"] + """Returns all Snapshots to the user from DRSecondary endpoint. + + Description for Returns all Snapshots to the user from DRSecondary endpoint. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :param slot: Website Slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots_from_dr_secondary_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_snapshots_from_dr_secondary_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshotsdr'} # type: ignore + + def get_source_control_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteSourceControl" + """Gets the source control configuration of an app. + + Description for Gets the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + source control configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_source_control_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + def _create_or_update_source_control_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_source_control, # type: "_models.SiteSourceControl" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteSourceControl" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_source_control_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_source_control_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + def begin_create_or_update_source_control_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_source_control, # type: "_models.SiteSourceControl" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SiteSourceControl"] + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + source control configuration for the production slot. + :type slot: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2020_09_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 SiteSourceControl or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.SiteSourceControl] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_source_control_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + site_source_control=site_source_control, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + def delete_source_control_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the source control configuration of an app. + + Description for Deletes the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + source control configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_source_control_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + def update_source_control_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_source_control, # type: "_models.SiteSourceControl" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteSourceControl" + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + source control configuration for the production slot. + :type slot: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2020_09_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_source_control_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + def start_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Starts an app (or deployment slot, if specified). + + Description for Starts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will start the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.start_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start'} # type: ignore + + def _start_network_trace_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._start_network_trace_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_network_trace_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace'} # type: ignore + + def begin_start_network_trace_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[List["_models.NetworkTrace"]] + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_network_trace_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace'} # type: ignore + + def stop_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stops an app (or deployment slot, if specified). + + Description for Stops an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will stop the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.stop_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop'} # type: ignore + + def stop_network_trace_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.stop_network_trace_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stopNetworkTrace'} # type: ignore + + def sync_repository_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Sync web app repository. + + Description for Sync web app repository. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.sync_repository_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_repository_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync'} # type: ignore + + def sync_function_triggers_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.sync_function_triggers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_function_triggers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/syncfunctiontriggers'} # type: ignore + + def list_triggered_web_jobs_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.TriggeredWebJobCollection"] + """List triggered web jobs for an app, or a deployment slot. + + Description for List triggered web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredWebJobCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.TriggeredWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_jobs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_triggered_web_jobs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs'} # type: ignore + + def get_triggered_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.TriggeredWebJob"] + """Gets a triggered web job by its ID for an app, or a deployment slot. + + Description for Gets a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.TriggeredWebJob or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.TriggeredWebJob"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TriggeredWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}'} # type: ignore + + def delete_triggered_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a triggered web job by its ID for an app, or a deployment slot. + + Description for Delete a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes web job + for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_triggered_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_triggered_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}'} # type: ignore + + def list_triggered_web_job_history_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.TriggeredJobHistoryCollection"] + """List a triggered web job's history for an app, or a deployment slot. + + Description for List a triggered web job's history for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredJobHistoryCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.TriggeredJobHistoryCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredJobHistoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_job_history_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredJobHistoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_triggered_web_job_history_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history'} # type: ignore + + def get_triggered_web_job_history_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.TriggeredJobHistory"] + """Gets a triggered web job's history by its ID for an app, , or a deployment slot. + + Description for Gets a triggered web job's history by its ID for an app, , or a deployment + slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param id: History ID. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredJobHistory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.TriggeredJobHistory or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.TriggeredJobHistory"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job_history_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TriggeredJobHistory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job_history_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}'} # type: ignore + + def run_triggered_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Run a triggered web job for an app, or a deployment slot. + + Description for Run a triggered web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.run_triggered_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + run_triggered_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/run'} # type: ignore + + def list_usages_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CsmUsageQuotaCollection"] + """Gets the quota usage information of an app (or deployment slot, if specified). + + Description for Gets the quota usage information of an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get quota + information of the production slot. + :type slot: str + :param filter: Return only information specified in the filter (using OData syntax). For + example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq + 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_usages_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages'} # type: ignore + + def list_vnet_connections_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.VnetInfo"] + """Gets the virtual networks the app (or deployment slot) is connected to. + + Description for Gets the virtual networks the app (or deployment slot) is connected to. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get virtual + network connections for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetInfo, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.VnetInfo] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_vnet_connections_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetInfo]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_vnet_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections'} # type: ignore + + def get_vnet_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetInfo" + """Gets a virtual network the app (or deployment slot) is connected to by name. + + Description for Gets a virtual network the app (or deployment slot) is connected to by name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + named virtual network for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def create_or_update_vnet_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.VnetInfo" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetInfo" + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def delete_vnet_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a connection from an app (or deployment slot to a named virtual network. + + Description for Deletes a connection from an app (or deployment slot to a named virtual + network. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def update_vnet_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.VnetInfo" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetInfo" + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfo') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def get_vnet_connection_gateway_slot( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VnetGateway"] + """Gets an app's Virtual Network gateway. + + Description for Gets an app's Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a + gateway for the production slot's Virtual Network. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetGateway or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VnetGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection_gateway_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection_gateway_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def create_or_update_vnet_connection_gateway_slot( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.VnetGateway" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetGateway" + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update a gateway for the production slot's Virtual Network. + :type slot: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection_gateway_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection_gateway_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def update_vnet_connection_gateway_slot( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.VnetGateway" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetGateway" + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update a gateway for the production slot's Virtual Network. + :type slot: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection_gateway_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection_gateway_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def list_web_jobs_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebJobCollection"] + """List webjobs for an app, or a deployment slot. + + Description for List webjobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebJobCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.WebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_jobs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_web_jobs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs'} # type: ignore + + def get_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WebJob" + """Get webjob information for an app, or a deployment slot. + + Description for Get webjob information for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of the web job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.WebJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs/{webJobName}'} # type: ignore + + def list_slot_differences_from_production( + self, + resource_group_name, # type: str + name, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SlotDifferenceCollection"] + """Get the difference in configuration settings between two web app slots. + + Description for Get the difference in configuration settings between two web app slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_09_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SlotDifferenceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.SlotDifferenceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotDifferenceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_slot_differences_from_production.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SlotDifferenceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_slot_differences_from_production.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs'} # type: ignore + + def _swap_slot_with_production_initial( + self, + resource_group_name, # type: str + name, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._swap_slot_with_production_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _swap_slot_with_production_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap'} # type: ignore + + def begin_swap_slot_with_production( + self, + resource_group_name, # type: str + name, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Swaps two deployment slots of an app. + + Description for Swaps two deployment slots of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2020_09_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._swap_slot_with_production_initial( + resource_group_name=resource_group_name, + name=name, + slot_swap_entity=slot_swap_entity, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_swap_slot_with_production.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap'} # type: ignore + + def list_snapshots( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SnapshotCollection"] + """Returns all Snapshots to the user. + + Description for Returns all Snapshots to the user. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_snapshots.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots'} # type: ignore + + def list_snapshots_from_dr_secondary( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SnapshotCollection"] + """Returns all Snapshots to the user from DRSecondary endpoint. + + Description for Returns all Snapshots to the user from DRSecondary endpoint. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots_from_dr_secondary.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_snapshots_from_dr_secondary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshotsdr'} # type: ignore + + def get_source_control( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteSourceControl" + """Gets the source control configuration of an app. + + Description for Gets the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + def _create_or_update_source_control_initial( + self, + resource_group_name, # type: str + name, # type: str + site_source_control, # type: "_models.SiteSourceControl" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteSourceControl" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_source_control_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_source_control_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + def begin_create_or_update_source_control( + self, + resource_group_name, # type: str + name, # type: str + site_source_control, # type: "_models.SiteSourceControl" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SiteSourceControl"] + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2020_09_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 SiteSourceControl or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2020_09_01.models.SiteSourceControl] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_source_control_initial( + resource_group_name=resource_group_name, + name=name, + site_source_control=site_source_control, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + def delete_source_control( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the source control configuration of an app. + + Description for Deletes the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + def update_source_control( + self, + resource_group_name, # type: str + name, # type: str + site_source_control, # type: "_models.SiteSourceControl" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteSourceControl" + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2020_09_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + def start( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Starts an app (or deployment slot, if specified). + + Description for Starts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.start.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/start'} # type: ignore + + def _start_network_trace_initial( + self, + resource_group_name, # type: str + name, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._start_network_trace_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_network_trace_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace'} # type: ignore + + def begin_start_network_trace( + self, + resource_group_name, # type: str + name, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[List["_models.NetworkTrace"]] + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[list[~azure.mgmt.web.v2020_09_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_network_trace_initial( + resource_group_name=resource_group_name, + name=name, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace'} # type: ignore + + def stop( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stops an app (or deployment slot, if specified). + + Description for Stops an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.stop.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stop'} # type: ignore + + def stop_network_trace( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.stop_network_trace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stopNetworkTrace'} # type: ignore + + def sync_repository( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Sync web app repository. + + Description for Sync web app repository. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.sync_repository.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_repository.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sync'} # type: ignore + + def sync_function_triggers( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.sync_function_triggers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_function_triggers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/syncfunctiontriggers'} # type: ignore + + def list_triggered_web_jobs( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.TriggeredWebJobCollection"] + """List triggered web jobs for an app, or a deployment slot. + + Description for List triggered web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredWebJobCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.TriggeredWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_jobs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_triggered_web_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs'} # type: ignore + + def get_triggered_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.TriggeredWebJob"] + """Gets a triggered web job by its ID for an app, or a deployment slot. + + Description for Gets a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.TriggeredWebJob or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.TriggeredWebJob"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TriggeredWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}'} # type: ignore + + def delete_triggered_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a triggered web job by its ID for an app, or a deployment slot. + + Description for Delete a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_triggered_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_triggered_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}'} # type: ignore + + def list_triggered_web_job_history( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.TriggeredJobHistoryCollection"] + """List a triggered web job's history for an app, or a deployment slot. + + Description for List a triggered web job's history for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredJobHistoryCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.TriggeredJobHistoryCollectionor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredJobHistoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_job_history.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredJobHistoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_triggered_web_job_history.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history'} # type: ignore + + def get_triggered_web_job_history( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.TriggeredJobHistory"] + """Gets a triggered web job's history by its ID for an app, , or a deployment slot. + + Description for Gets a triggered web job's history by its ID for an app, , or a deployment + slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param id: History ID. + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredJobHistory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.TriggeredJobHistory or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.TriggeredJobHistory"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job_history.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TriggeredJobHistory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job_history.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history/{id}'} # type: ignore + + def run_triggered_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Run a triggered web job for an app, or a deployment slot. + + Description for Run a triggered web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.run_triggered_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + run_triggered_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/run'} # type: ignore + + def list_usages( + self, + resource_group_name, # type: str + name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CsmUsageQuotaCollection"] + """Gets the quota usage information of an app (or deployment slot, if specified). + + Description for Gets the quota usage information of an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param filter: Return only information specified in the filter (using OData syntax). For + example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq + 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/usages'} # type: ignore + + def list_vnet_connections( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.VnetInfo"] + """Gets the virtual networks the app (or deployment slot) is connected to. + + Description for Gets the virtual networks the app (or deployment slot) is connected to. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetInfo, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2020_09_01.models.VnetInfo] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetInfo"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_vnet_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetInfo]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_vnet_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections'} # type: ignore + + def get_vnet_connection( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetInfo" + """Gets a virtual network the app (or deployment slot) is connected to by name. + + Description for Gets a virtual network the app (or deployment slot) is connected to by name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def create_or_update_vnet_connection( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + connection_envelope, # type: "_models.VnetInfo" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetInfo" + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def delete_vnet_connection( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a connection from an app (or deployment slot to a named virtual network. + + Description for Deletes a connection from an app (or deployment slot to a named virtual + network. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.delete_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def update_vnet_connection( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + connection_envelope, # type: "_models.VnetInfo" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetInfo" + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfo') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def get_vnet_connection_gateway( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VnetGateway"] + """Gets an app's Virtual Network gateway. + + Description for Gets an app's Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetGateway or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VnetGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def create_or_update_vnet_connection_gateway( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + connection_envelope, # type: "_models.VnetGateway" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetGateway" + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def update_vnet_connection_gateway( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + connection_envelope, # type: "_models.VnetGateway" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetGateway" + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def list_web_jobs( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebJobCollection"] + """List webjobs for an app, or a deployment slot. + + Description for List webjobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebJobCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.WebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_jobs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_web_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs'} # type: ignore + + def get_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WebJob" + """Get webjob information for an app, or a deployment slot. + + Description for Get webjob information for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of the web job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.WebJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs/{webJobName}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_web_site_management_client_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_web_site_management_client_operations.py new file mode 100644 index 000000000000..af2e33071d62 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_web_site_management_client_operations.py @@ -0,0 +1,1142 @@ +# 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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WebSiteManagementClientOperationsMixin(object): + + def generate_github_access_token_for_appservice_cli_async( + self, + code, # type: str + state, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AppserviceGithubToken" + """Exchange code for GitHub access token for AppService CLI. + + Description for Exchange code for GitHub access token for AppService CLI. + + :param code: Code string to exchange for Github Access token. + :type code: str + :param state: State string used for verification. + :type state: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppserviceGithubToken, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.AppserviceGithubToken + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppserviceGithubToken"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _request = _models.AppserviceGithubTokenRequest(code=code, state=state) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.generate_github_access_token_for_appservice_cli_async.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_request, 'AppserviceGithubTokenRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppserviceGithubToken', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_github_access_token_for_appservice_cli_async.metadata = {'url': '/providers/Microsoft.Web/generateGithubAccessTokenForAppserviceCLI'} # type: ignore + + def get_publishing_user( + self, + **kwargs # type: Any + ): + # type: (...) -> "_models.User" + """Gets publishing user. + + Description for Gets publishing user. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: User, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.User + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_publishing_user.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_publishing_user.metadata = {'url': '/providers/Microsoft.Web/publishingUsers/web'} # type: ignore + + def update_publishing_user( + self, + user_details, # type: "_models.User" + **kwargs # type: Any + ): + # type: (...) -> "_models.User" + """Updates publishing user. + + Description for Updates publishing user. + + :param user_details: Details of publishing user. + :type user_details: ~azure.mgmt.web.v2020_09_01.models.User + :keyword callable cls: A custom type or function that will be passed the direct response + :return: User, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.User + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_publishing_user.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(user_details, 'User') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_publishing_user.metadata = {'url': '/providers/Microsoft.Web/publishingUsers/web'} # type: ignore + + def list_source_controls( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SourceControlCollection"] + """Gets the source controls available for Azure websites. + + Description for Gets the source controls available for Azure websites. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SourceControlCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.SourceControlCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_source_controls.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SourceControlCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_source_controls.metadata = {'url': '/providers/Microsoft.Web/sourcecontrols'} # type: ignore + + def get_source_control( + self, + source_control_type, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SourceControl" + """Gets source control token. + + Description for Gets source control token. + + :param source_control_type: Type of source control. + :type source_control_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'sourceControlType': self._serialize.url("source_control_type", source_control_type, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_source_control.metadata = {'url': '/providers/Microsoft.Web/sourcecontrols/{sourceControlType}'} # type: ignore + + def update_source_control( + self, + source_control_type, # type: str + request_message, # type: "_models.SourceControl" + **kwargs # type: Any + ): + # type: (...) -> "_models.SourceControl" + """Updates source control token. + + Description for Updates source control token. + + :param source_control_type: Type of source control. + :type source_control_type: str + :param request_message: Source control token information. + :type request_message: ~azure.mgmt.web.v2020_09_01.models.SourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'sourceControlType': self._serialize.url("source_control_type", source_control_type, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request_message, 'SourceControl') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_source_control.metadata = {'url': '/providers/Microsoft.Web/sourcecontrols/{sourceControlType}'} # type: ignore + + def list_billing_meters( + self, + billing_location=None, # type: Optional[str] + os_type=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BillingMeterCollection"] + """Gets a list of meters for a given location. + + Description for Gets a list of meters for a given location. + + :param billing_location: Azure Location of billable resource. + :type billing_location: str + :param os_type: App Service OS type meters used for. + :type os_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BillingMeterCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.BillingMeterCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BillingMeterCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_billing_meters.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if billing_location is not None: + query_parameters['billingLocation'] = self._serialize.query("billing_location", billing_location, 'str') + if os_type is not None: + query_parameters['osType'] = self._serialize.query("os_type", os_type, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BillingMeterCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_billing_meters.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters'} # type: ignore + + def check_name_availability( + self, + name, # type: str + type, # type: Union[str, "_models.CheckNameResourceTypes"] + is_fqdn=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> "_models.ResourceNameAvailability" + """Check if a resource name is available. + + Description for Check if a resource name is available. + + :param name: Resource name to verify. + :type name: str + :param type: Resource type used for verification. + :type type: str or ~azure.mgmt.web.v2020_09_01.models.CheckNameResourceTypes + :param is_fqdn: Is fully qualified domain name. + :type is_fqdn: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceNameAvailability, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ResourceNameAvailability + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNameAvailability"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _request = _models.ResourceNameAvailabilityRequest(name=name, type=type, is_fqdn=is_fqdn) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_request, 'ResourceNameAvailabilityRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceNameAvailability', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability'} # type: ignore + + def get_subscription_deployment_locations( + self, + **kwargs # type: Any + ): + # type: (...) -> "_models.DeploymentLocations" + """Gets list of available geo regions plus ministamps. + + Description for Gets list of available geo regions plus ministamps. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeploymentLocations, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.DeploymentLocations + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLocations"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_subscription_deployment_locations.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeploymentLocations', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_subscription_deployment_locations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/deploymentLocations'} # type: ignore + + def list_geo_regions( + self, + sku=None, # type: Optional[Union[str, "_models.SkuName"]] + linux_workers_enabled=None, # type: Optional[bool] + xenon_workers_enabled=None, # type: Optional[bool] + linux_dynamic_workers_enabled=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GeoRegionCollection"] + """Get a list of available geographical regions. + + Description for Get a list of available geographical regions. + + :param sku: Name of SKU used to filter the regions. + :type sku: str or ~azure.mgmt.web.v2020_09_01.models.SkuName + :param linux_workers_enabled: Specify :code:`true` if you want to filter to only + regions that support Linux workers. + :type linux_workers_enabled: bool + :param xenon_workers_enabled: Specify :code:`true` if you want to filter to only + regions that support Xenon workers. + :type xenon_workers_enabled: bool + :param linux_dynamic_workers_enabled: Specify :code:`true` if you want to filter + to only regions that support Linux Consumption Workers. + :type linux_dynamic_workers_enabled: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GeoRegionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.GeoRegionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GeoRegionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_geo_regions.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if sku is not None: + query_parameters['sku'] = self._serialize.query("sku", sku, 'str') + if linux_workers_enabled is not None: + query_parameters['linuxWorkersEnabled'] = self._serialize.query("linux_workers_enabled", linux_workers_enabled, 'bool') + if xenon_workers_enabled is not None: + query_parameters['xenonWorkersEnabled'] = self._serialize.query("xenon_workers_enabled", xenon_workers_enabled, 'bool') + if linux_dynamic_workers_enabled is not None: + query_parameters['linuxDynamicWorkersEnabled'] = self._serialize.query("linux_dynamic_workers_enabled", linux_dynamic_workers_enabled, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('GeoRegionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_geo_regions.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/geoRegions'} # type: ignore + + def list_site_identifiers_assigned_to_host_name( + self, + name_identifier, # type: "_models.NameIdentifier" + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.IdentifierCollection"] + """List all apps that are assigned to a hostname. + + Description for List all apps that are assigned to a hostname. + + :param name_identifier: Hostname information. + :type name_identifier: ~azure.mgmt.web.v2020_09_01.models.NameIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IdentifierCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.IdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_identifiers_assigned_to_host_name.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(name_identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(name_identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_identifiers_assigned_to_host_name.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/listSitesAssignedToHostName'} # type: ignore + + def list_premier_add_on_offers( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PremierAddOnOfferCollection"] + """List all premier add-on offers. + + Description for List all premier add-on offers. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PremierAddOnOfferCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2020_09_01.models.PremierAddOnOfferCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOnOfferCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_premier_add_on_offers.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PremierAddOnOfferCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_premier_add_on_offers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/premieraddonoffers'} # type: ignore + + def list_skus( + self, + **kwargs # type: Any + ): + # type: (...) -> "_models.SkuInfos" + """List all SKUs. + + Description for List all SKUs. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuInfos, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.SkuInfos + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInfos"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuInfos', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/skus'} # type: ignore + + def verify_hosting_environment_vnet( + self, + parameters, # type: "_models.VnetParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetValidationFailureDetails" + """Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules. + + Description for Verifies if this VNET is compatible with an App Service Environment by + analyzing the Network Security Group rules. + + :param parameters: VNET information. + :type parameters: ~azure.mgmt.web.v2020_09_01.models.VnetParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetValidationFailureDetails, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.VnetValidationFailureDetails + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetValidationFailureDetails"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.verify_hosting_environment_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VnetParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetValidationFailureDetails', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + verify_hosting_environment_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/verifyHostingEnvironmentVnet'} # type: ignore + + def move( + self, + resource_group_name, # type: str + move_resource_envelope, # type: "_models.CsmMoveResourceEnvelope" + **kwargs # type: Any + ): + # type: (...) -> None + """Move resources between resource groups. + + Description for Move resources between resource groups. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param move_resource_envelope: Object that represents the resource to move. + :type move_resource_envelope: ~azure.mgmt.web.v2020_09_01.models.CsmMoveResourceEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.move.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(move_resource_envelope, 'CsmMoveResourceEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources'} # type: ignore + + def validate( + self, + resource_group_name, # type: str + validate_request, # type: "_models.ValidateRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.ValidateResponse" + """Validate if a resource can be created. + + Description for Validate if a resource can be created. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param validate_request: Request with the resources to validate. + :type validate_request: ~azure.mgmt.web.v2020_09_01.models.ValidateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidateResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2020_09_01.models.ValidateResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(validate_request, 'ValidateRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_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(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ValidateResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validate'} # type: ignore + + def validate_move( + self, + resource_group_name, # type: str + move_resource_envelope, # type: "_models.CsmMoveResourceEnvelope" + **kwargs # type: Any + ): + # type: (...) -> None + """Validate whether a resource can be moved. + + Description for Validate whether a resource can be moved. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param move_resource_envelope: Object that represents the resource to move. + :type move_resource_envelope: ~azure.mgmt.web.v2020_09_01.models.CsmMoveResourceEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_move.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(move_resource_envelope, 'CsmMoveResourceEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + validate_move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/validateMoveResources'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/py.typed b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/appservice/azure-mgmt-web/tests/recordings/test_cli_mgmt_app_service.test_app_service_plan.yaml b/sdk/appservice/azure-mgmt-web/tests/recordings/test_cli_mgmt_app_service.test_app_service_plan.yaml index a1cded97a63e..f38abed5d3fe 100644 --- a/sdk/appservice/azure-mgmt-web/tests/recordings/test_cli_mgmt_app_service.test_app_service_plan.yaml +++ b/sdk/appservice/azure-mgmt-web/tests/recordings/test_cli_mgmt_app_service.test_app_service_plan.yaml @@ -14,23 +14,24 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myname?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myname?api-version=2020-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myname","name":"myname","type":"Microsoft.Web/serverfarms","kind":"app","location":"East - US","properties":{"serverFarmId":19011,"name":"myname","workerSize":"Default","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Default","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"rgname-EastUSwebspace","subscription":"00000000-0000-0000-0000-000000000000","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":20,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"East - US","perSiteScaling":false,"maximumElasticWorkerCount":1,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"app","resourceGroup":"rgname","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-blu-199_19011","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded","webSiteId":null,"existingServerFarmIds":null,"azBalancing":false},"sku":{"name":"P1","tier":"Premium","size":"P1","family":"P","capacity":1}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myname","name":"myname","type":"Microsoft.Web/serverfarms","kind":"app","location":"eastus","properties":{"serverFarmId":7233,"name":"myname","sku":{"name":"P1","tier":"Premium","size":"P1","family":"P","capacity":1},"workerSize":"Default","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Default","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"rgname-EastUSwebspace","subscription":"00000000-0000-0000-0000-000000000000","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":0,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"East + US","perSiteScaling":false,"maximumElasticWorkerCount":1,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"app","resourceGroup":"rgname","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-blu-233_7233","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded","webSiteId":null,"existingServerFarmIds":null,"azBalancing":false},"sku":{"name":"P1","tier":"Premium","size":"P1","family":"P","capacity":1}}' headers: cache-control: - no-cache content-length: - - '1493' + - '1564' content-type: - application/json date: - - Mon, 23 Nov 2020 06:37:54 GMT + - Thu, 25 Feb 2021 06:16:51 GMT + etag: + - '"1D70B3DCD5F3B80"' expires: - '-1' pragma: @@ -64,23 +65,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myname?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myname?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myname","name":"myname","type":"Microsoft.Web/serverfarms","kind":"app","location":"East - US","properties":{"serverFarmId":19011,"name":"myname","workerSize":"Default","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Default","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"rgname-EastUSwebspace","subscription":"00000000-0000-0000-0000-000000000000","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":20,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"East - US","perSiteScaling":false,"maximumElasticWorkerCount":1,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"app","resourceGroup":"rgname","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-blu-199_19011","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded","webSiteId":null,"existingServerFarmIds":null,"azBalancing":false},"sku":{"name":"P1","tier":"Premium","size":"P1","family":"P","capacity":1}}' + US","properties":{"serverFarmId":7233,"name":"myname","workerSize":"Default","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Default","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"rgname-EastUSwebspace","subscription":"00000000-0000-0000-0000-000000000000","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":20,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"East + US","perSiteScaling":false,"maximumElasticWorkerCount":1,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"app","resourceGroup":"rgname","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-blu-233_7233","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded","webSiteId":null,"existingServerFarmIds":null,"azBalancing":false},"sku":{"name":"P1","tier":"Premium","size":"P1","family":"P","capacity":1}}' headers: cache-control: - no-cache content-length: - - '1493' + - '1491' content-type: - application/json date: - - Mon, 23 Nov 2020 06:37:54 GMT + - Thu, 25 Feb 2021 06:16:51 GMT expires: - '-1' pragma: @@ -116,22 +117,22 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myname?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myname?api-version=2020-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myname","name":"myname","type":"Microsoft.Web/serverfarms","kind":"app","properties":{"serverFarmId":19011,"name":"myname","sku":{"name":"P1","tier":"Premium","size":"P1","family":"P","capacity":1},"workerSize":"Default","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Default","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"rgname-EastUSwebspace","subscription":"00000000-0000-0000-0000-000000000000","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":20,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"East - US","perSiteScaling":false,"maximumElasticWorkerCount":1,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"app","resourceGroup":"rgname","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-blu-199_19011","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":null,"webSiteId":null,"existingServerFarmIds":null,"azBalancing":false},"sku":{"name":"P1","tier":"Premium","size":"P1","family":"P","capacity":1}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myname","name":"myname","type":"Microsoft.Web/serverfarms","kind":"app","properties":{"serverFarmId":7233,"name":"myname","sku":{"name":"P1","tier":"Premium","size":"P1","family":"P","capacity":1},"workerSize":"Default","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Default","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"rgname-EastUSwebspace","subscription":"00000000-0000-0000-0000-000000000000","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":20,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"East + US","perSiteScaling":false,"maximumElasticWorkerCount":1,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"app","resourceGroup":"rgname","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-blu-233_7233","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded","webSiteId":null,"existingServerFarmIds":null,"azBalancing":false},"sku":{"name":"P1","tier":"Premium","size":"P1","family":"P","capacity":1}}' headers: cache-control: - no-cache content-length: - - '1540' + - '1545' content-type: - application/json date: - - Mon, 23 Nov 2020 06:38:00 GMT + - Thu, 25 Feb 2021 06:16:55 GMT expires: - '-1' pragma: @@ -167,9 +168,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myname?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myname?api-version=2020-09-01 response: body: string: '' @@ -179,7 +180,7 @@ interactions: content-length: - '0' date: - - Mon, 23 Nov 2020 06:38:08 GMT + - Thu, 25 Feb 2021 06:17:02 GMT expires: - '-1' pragma: diff --git a/sdk/appservice/azure-mgmt-web/tests/recordings/test_cli_mgmt_static_site.test_static_site.yaml b/sdk/appservice/azure-mgmt-web/tests/recordings/test_cli_mgmt_static_site.test_static_site.yaml index cecb1ce42769..a75da64028ef 100644 --- a/sdk/appservice/azure-mgmt-web/tests/recordings/test_cli_mgmt_static_site.test_static_site.yaml +++ b/sdk/appservice/azure-mgmt-web/tests/recordings/test_cli_mgmt_static_site.test_static_site.yaml @@ -2,7 +2,7 @@ interactions: - request: body: '{"location": "eastus2", "sku": {"name": "Free"}, "properties": {"repositoryUrl": "https://github.com/00Kai0/html-docs-hello-world", "branch": "master", "repositoryToken": - "009820ffdf19db061b7e8667eabdc7f5188c3252", "buildProperties": {"appLocation": + "4ea23f4a97c54e52c7574a010b4c5d72a13a011f", "buildProperties": {"appLocation": "app", "apiLocation": "api", "appArtifactLocation": "build"}}}' headers: Accept: @@ -16,22 +16,22 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/staticSites/myname?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/staticSites/myname?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/staticSites/myname","name":"myname","type":"Microsoft.Web/staticSites","location":"East - US 2","properties":{"defaultHostname":"happy-ocean-0c2bdca0f.azurestaticapps.net","repositoryUrl":"https://github.com/00Kai0/html-docs-hello-world","branch":"master","provider":"GitHub","customDomains":[],"privateEndpointConnections":[],"contentDistributionEndpoint":"https://content-eus2.infrastructure.azurestaticapps.net"},"sku":{"name":"Free","tier":"Free"}}' + US 2","properties":{"defaultHostname":"jolly-glacier-02b80590f.azurestaticapps.net","repositoryUrl":"https://github.com/00Kai0/html-docs-hello-world","branch":"master","provider":"GitHub","customDomains":[],"privateEndpointConnections":[],"contentDistributionEndpoint":"https://content-eus2.infrastructure.azurestaticapps.net"},"sku":{"name":"Free","tier":"Free"}}' headers: cache-control: - no-cache content-length: - - '624' + - '626' content-type: - application/json date: - - Mon, 23 Nov 2020 06:58:50 GMT + - Thu, 25 Feb 2021 06:17:22 GMT expires: - '-1' pragma: @@ -65,22 +65,22 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/staticSites/myname?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/staticSites/myname?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/staticSites/myname","name":"myname","type":"Microsoft.Web/staticSites","location":"East - US 2","properties":{"defaultHostname":"happy-ocean-0c2bdca0f.azurestaticapps.net","repositoryUrl":"https://github.com/00Kai0/html-docs-hello-world","branch":"master","provider":"GitHub","customDomains":[],"privateEndpointConnections":[],"contentDistributionEndpoint":"https://content-eus2.infrastructure.azurestaticapps.net"},"sku":{"name":"Free","tier":"Free"}}' + US 2","properties":{"defaultHostname":"jolly-glacier-02b80590f.azurestaticapps.net","repositoryUrl":"https://github.com/00Kai0/html-docs-hello-world","branch":"master","provider":"GitHub","customDomains":[],"privateEndpointConnections":[],"contentDistributionEndpoint":"https://content-eus2.infrastructure.azurestaticapps.net"},"sku":{"name":"Free","tier":"Free"}}' headers: cache-control: - no-cache content-length: - - '624' + - '626' content-type: - application/json date: - - Mon, 23 Nov 2020 06:58:50 GMT + - Thu, 25 Feb 2021 06:17:23 GMT expires: - '-1' pragma: @@ -114,13 +114,13 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/staticSites/myname/listSecrets?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/staticSites/myname/listSecrets?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/staticSites/myname/secrets","name":"secrets","type":"Microsoft.Web/staticSites/secrets","location":"East - US 2","properties":{"apiKey":"10ea75f7af05e747dc6c5d70b4e1821b8a473e8ed20e6a215e2857c6281edd16-16be15f8-11ba-4874-be4f-905b1294581800f4373"}}' + US 2","properties":{"apiKey":"ad9c22e8fa4eeee58cf43f479d8ed61be9c99c8b5db94645b23c6d9e534611b8-cf34ebc8-1194-4cb6-9917-a002b7b704a500f6903"}}' headers: cache-control: - no-cache @@ -129,7 +129,7 @@ interactions: content-type: - application/json date: - - Mon, 23 Nov 2020 06:58:51 GMT + - Thu, 25 Feb 2021 06:17:23 GMT expires: - '-1' pragma: @@ -154,7 +154,7 @@ interactions: code: 200 message: OK - request: - body: '{"properties": {"repositoryToken": "009820ffdf19db061b7e8667eabdc7f5188c3252", + body: '{"properties": {"repositoryToken": "4ea23f4a97c54e52c7574a010b4c5d72a13a011f", "shouldUpdateRepository": true}}' headers: Accept: @@ -168,9 +168,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/staticSites/myname/resetapikey?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/staticSites/myname/resetapikey?api-version=2020-09-01 response: body: string: '' @@ -180,7 +180,7 @@ interactions: content-length: - '0' date: - - Mon, 23 Nov 2020 06:58:51 GMT + - Thu, 25 Feb 2021 06:17:24 GMT expires: - '-1' pragma: @@ -212,9 +212,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/staticSites/myname/detach?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/staticSites/myname/detach?api-version=2020-09-01 response: body: string: '' @@ -224,7 +224,7 @@ interactions: content-length: - '0' date: - - Mon, 23 Nov 2020 06:58:52 GMT + - Thu, 25 Feb 2021 06:17:24 GMT expires: - '-1' pragma: @@ -256,25 +256,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/staticSites/myname?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/staticSites/myname?api-version=2020-09-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/locations/eastus2/operationResults/1063d04b-0ecf-4559-8075-3db9abb0660a?api-version=2019-01-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/locations/eastus2/operationResults/ef49ed60-c947-49a6-ae27-f1a3c15f72f8?api-version=2019-01-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 23 Nov 2020 06:58:53 GMT + - Thu, 25 Feb 2021 06:17:25 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/locations/eastus2/operations/1063d04b-0ecf-4559-8075-3db9abb0660a?api-version=2019-01-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/locations/eastus2/operations/ef49ed60-c947-49a6-ae27-f1a3c15f72f8?api-version=2019-01-01 pragma: - no-cache server: @@ -286,7 +286,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14997' + - '14999' x-powered-by: - ASP.NET status: diff --git a/sdk/appservice/azure-mgmt-web/tests/recordings/test_cli_mgmt_web_app.test_web_app.yaml b/sdk/appservice/azure-mgmt-web/tests/recordings/test_cli_mgmt_web_app.test_web_app.yaml index 90d5e566eddc..202f0c3bcc5a 100644 --- a/sdk/appservice/azure-mgmt-web/tests/recordings/test_cli_mgmt_web_app.test_web_app.yaml +++ b/sdk/appservice/azure-mgmt-web/tests/recordings/test_cli_mgmt_web_app.test_web_app.yaml @@ -14,23 +14,24 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan?api-version=2020-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan","name":"myappserviceplan","type":"Microsoft.Web/serverfarms","kind":"app","location":"East - US","properties":{"serverFarmId":7432,"name":"myappserviceplan","workerSize":"Default","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Default","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"rgname-EastUSwebspace","subscription":"00000000-0000-0000-0000-000000000000","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":3,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"East - US","perSiteScaling":false,"maximumElasticWorkerCount":1,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"app","resourceGroup":"rgname","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-blu-213_7432","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded","webSiteId":null,"existingServerFarmIds":null,"azBalancing":false},"sku":{"name":"B1","tier":"Basic","size":"B1","family":"B","capacity":1}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan","name":"myappserviceplan","type":"Microsoft.Web/serverfarms","kind":"app","location":"eastus","properties":{"serverFarmId":51512,"name":"myappserviceplan","sku":{"name":"B1","tier":"Basic","size":"B1","family":"B","capacity":1},"workerSize":"Default","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Default","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"rgname-EastUSwebspace","subscription":"00000000-0000-0000-0000-000000000000","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":0,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"East + US","perSiteScaling":false,"maximumElasticWorkerCount":1,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"app","resourceGroup":"rgname","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-blu-139_51512","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded","webSiteId":null,"existingServerFarmIds":null,"azBalancing":false},"sku":{"name":"B1","tier":"Basic","size":"B1","family":"B","capacity":1}}' headers: cache-control: - no-cache content-length: - - '1518' + - '1592' content-type: - application/json date: - - Mon, 23 Nov 2020 06:38:53 GMT + - Thu, 25 Feb 2021 06:17:47 GMT + etag: + - '"1D70B3DEE6C3B20"' expires: - '-1' pragma: @@ -72,25 +73,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz?api-version=2020-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz","name":"mysitexxyzz","type":"Microsoft.Web/sites","kind":"app","location":"eastus","properties":{"name":"mysitexxyzz","state":"Running","hostNames":["mysitexxyzz.azurewebsites.net"],"webSpace":"rgname-EastUSwebspace","selfLink":"https://waws-prod-blu-213.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/rgname-EastUSwebspace/sites/mysitexxyzz","repositorySiteName":"mysitexxyzz","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["mysitexxyzz.azurewebsites.net","mysitexxyzz.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[{"name":"LinuxFxVersion","value":""},{"name":"WindowsFxVersion","value":null}],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"mysitexxyzz.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"mysitexxyzz.scm.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Repository"}],"computeMode":null,"serverFarm":null,"serverFarmId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan","reserved":false,"isXenon":false,"hyperV":false,"lastModifiedTimeUtc":"2020-11-23T06:38:57.8366667","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":{"numberOfWorkers":null,"defaultDocuments":null,"netFrameworkVersion":null,"phpVersion":null,"pythonVersion":null,"nodeVersion":null,"powerShellVersion":null,"linuxFxVersion":null,"windowsFxVersion":null,"requestTracingEnabled":null,"remoteDebuggingEnabled":null,"remoteDebuggingVersion":null,"httpLoggingEnabled":null,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":null,"detailedErrorLoggingEnabled":null,"publishingUsername":null,"publishingPassword":null,"appSettings":null,"azureStorageAccounts":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":null,"use32BitWorkerProcess":null,"webSocketsEnabled":null,"alwaysOn":null,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":null,"managedPipelineMode":null,"virtualApplications":null,"winAuthAdminState":null,"winAuthTenantState":null,"customAppPoolIdentityAdminState":null,"customAppPoolIdentityTenantState":null,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":null,"routingRules":null,"experiments":null,"limits":null,"autoHealEnabled":null,"autoHealRules":null,"tracingOptions":null,"vnetName":null,"vnetRouteAllEnabled":null,"vnetPrivatePortsCount":null,"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":null,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz","name":"mysitexxyzz","type":"Microsoft.Web/sites","kind":"app","location":"eastus","properties":{"name":"mysitexxyzz","state":"Running","hostNames":["mysitexxyzz.azurewebsites.net"],"webSpace":"rgname-EastUSwebspace","selfLink":"https://waws-prod-blu-139.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/rgname-EastUSwebspace/sites/mysitexxyzz","repositorySiteName":"mysitexxyzz","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["mysitexxyzz.azurewebsites.net","mysitexxyzz.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[{"name":"LinuxFxVersion","value":""},{"name":"WindowsFxVersion","value":null}],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"mysitexxyzz.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"mysitexxyzz.scm.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Repository"}],"computeMode":null,"serverFarm":null,"serverFarmId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan","reserved":false,"isXenon":false,"hyperV":false,"lastModifiedTimeUtc":"2021-02-25T06:17:52.36","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":{"numberOfWorkers":null,"defaultDocuments":null,"netFrameworkVersion":null,"phpVersion":null,"pythonVersion":null,"nodeVersion":null,"powerShellVersion":null,"linuxFxVersion":null,"windowsFxVersion":null,"requestTracingEnabled":null,"remoteDebuggingEnabled":null,"remoteDebuggingVersion":null,"httpLoggingEnabled":null,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":null,"detailedErrorLoggingEnabled":null,"publishingUsername":null,"publishingPassword":null,"appSettings":null,"azureStorageAccounts":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":null,"use32BitWorkerProcess":null,"webSocketsEnabled":null,"alwaysOn":null,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":null,"managedPipelineMode":null,"virtualApplications":null,"winAuthAdminState":null,"winAuthTenantState":null,"customAppPoolIdentityAdminState":null,"customAppPoolIdentityTenantState":null,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":null,"routingRules":null,"experiments":null,"limits":null,"autoHealEnabled":null,"autoHealRules":null,"tracingOptions":null,"vnetName":null,"vnetRouteAllEnabled":null,"vnetPrivatePortsCount":null,"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":null,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow all","description":"Allow all access"}],"scmIpSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow - all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":null,"http20Enabled":null,"minTlsVersion":null,"scmMinTlsVersion":null,"ftpsState":null,"preWarmedInstanceCount":null,"functionAppScaleLimit":null,"healthCheckPath":null,"fileChangeAuditEnabled":null,"functionsRuntimeScaleMonitoringEnabled":null,"websiteTimeZone":null,"minimumElasticInstanceCount":0},"deploymentId":"mysitexxyzz","trafficManagerHostNames":null,"sku":"Basic","scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"clientCertMode":"Required","clientCertExclusionPaths":null,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"customDomainVerificationId":"55F2E4435A6748F0C3A4666505B3672446A9A9AEFDDC20F98EFEE4B5DCC7807E","kind":"app","inboundIpAddress":"20.49.104.14","possibleInboundIpAddresses":"20.49.104.14","ftpUsername":"mysitexxyzz\\$mysitexxyzz","ftpsHostName":"ftps://waws-prod-blu-213.ftp.azurewebsites.windows.net/site/wwwroot","outboundIpAddresses":"52.146.80.201,52.146.80.224,52.146.80.233,52.146.80.240,52.146.80.254,52.146.81.59,52.146.82.252,52.146.83.22,52.146.83.64","possibleOutboundIpAddresses":"52.146.80.201,52.146.80.224,52.146.80.233,52.146.80.240,52.146.80.254,52.146.81.59,52.146.82.252,52.146.83.22,52.146.83.64,52.146.81.74,52.146.81.101,52.146.81.141,52.146.81.155,52.146.81.240,52.146.81.254,52.146.82.7,52.146.82.8,52.146.82.17,52.146.82.61,52.146.82.81,52.146.82.87,52.146.82.136,52.146.82.188,52.146.82.209,52.146.82.221,52.146.82.243,52.146.82.244","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-blu-213","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"rgname","defaultHostName":"mysitexxyzz.azurewebsites.net","slotSwapStatus":null,"httpsOnly":false,"redundancyMode":"None","inProgressOperationId":null,"geoDistributions":null,"privateEndpointConnections":null,"buildVersion":null,"targetBuildVersion":null,"migrationState":null}}' + all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":null,"http20Enabled":null,"minTlsVersion":null,"scmMinTlsVersion":null,"ftpsState":null,"preWarmedInstanceCount":null,"functionAppScaleLimit":null,"healthCheckPath":null,"fileChangeAuditEnabled":null,"functionsRuntimeScaleMonitoringEnabled":null,"websiteTimeZone":null,"minimumElasticInstanceCount":0},"deploymentId":"mysitexxyzz","trafficManagerHostNames":null,"sku":"Basic","scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"clientCertMode":"Required","clientCertExclusionPaths":null,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"customDomainVerificationId":"55F2E4435A6748F0C3A4666505B3672446A9A9AEFDDC20F98EFEE4B5DCC7807E","kind":"app","inboundIpAddress":"40.79.154.194","possibleInboundIpAddresses":"40.79.154.194","ftpUsername":"mysitexxyzz\\$mysitexxyzz","ftpsHostName":"ftps://waws-prod-blu-139.ftp.azurewebsites.windows.net/site/wwwroot","outboundIpAddresses":"40.79.154.194,137.117.100.130,137.117.103.80,137.117.97.189,137.117.101.166","possibleOutboundIpAddresses":"40.79.154.194,137.117.100.130,137.117.103.80,137.117.97.189,137.117.101.166,137.117.98.138,137.117.99.211,137.117.97.27","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-blu-139","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"rgname","defaultHostName":"mysitexxyzz.azurewebsites.net","slotSwapStatus":null,"httpsOnly":false,"redundancyMode":"None","inProgressOperationId":null,"geoDistributions":null,"privateEndpointConnections":null,"buildVersion":null,"targetBuildVersion":null,"migrationState":null,"eligibleLogCategories":"AppServiceAppLogs,AppServiceAuditLogs,AppServiceConsoleLogs,AppServiceHTTPLogs,AppServiceIPSecAuditLogs,AppServicePlatformLogs,ScanLogs","storageAccountRequired":false}}' headers: cache-control: - no-cache content-length: - - '6008' + - '5905' content-type: - application/json date: - - Mon, 23 Nov 2020 06:39:16 GMT + - Thu, 25 Feb 2021 06:18:09 GMT etag: - - '"1D6C16352E16035"' + - '"1D70B3DF32CDD75"' expires: - '-1' pragma: @@ -129,26 +130,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/config/web?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/config/web?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz","name":"mysitexxyzz","type":"Microsoft.Web/sites","location":"East - US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php","hostingstart.html"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","powerShellVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":null,"httpLoggingEnabled":false,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$mysitexxyzz","publishingPassword":null,"appSettings":null,"azureStorageAccounts":{},"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"None","use32BitWorkerProcess":true,"webSocketsEnabled":true,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","vnetRouteAllEnabled":false,"vnetPrivatePortsCount":0,"siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretSettingName":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"aadClaimsAuthorization":null,"googleClientId":null,"googleClientSecret":null,"googleClientSecretSettingName":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookAppSecretSettingName":null,"facebookOAuthScopes":null,"gitHubClientId":null,"gitHubClientSecret":null,"gitHubClientSecretSettingName":null,"gitHubOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"twitterConsumerSecretSettingName":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountClientSecretSettingName":null,"microsoftAccountOAuthScopes":null},"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php","hostingstart.html"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","powerShellVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":null,"httpLoggingEnabled":false,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$mysitexxyzz","publishingPassword":null,"appSettings":null,"azureStorageAccounts":{},"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"None","use32BitWorkerProcess":true,"webSocketsEnabled":true,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","vnetRouteAllEnabled":false,"vnetPrivatePortsCount":0,"siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"configVersion":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretSettingName":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"aadClaimsAuthorization":null,"googleClientId":null,"googleClientSecret":null,"googleClientSecretSettingName":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookAppSecretSettingName":null,"facebookOAuthScopes":null,"gitHubClientId":null,"gitHubClientSecret":null,"gitHubClientSecretSettingName":null,"gitHubOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"twitterConsumerSecretSettingName":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountClientSecretSettingName":null,"microsoftAccountOAuthScopes":null},"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow all","description":"Allow all access"}],"scmIpSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":false,"http20Enabled":true,"minTlsVersion":"1.2","scmMinTlsVersion":"1.0","ftpsState":"AllAllowed","preWarmedInstanceCount":0,"functionAppScaleLimit":0,"healthCheckPath":null,"fileChangeAuditEnabled":false,"functionsRuntimeScaleMonitoringEnabled":false,"websiteTimeZone":null,"minimumElasticInstanceCount":0}}' headers: cache-control: - no-cache content-length: - - '3612' + - '3633' content-type: - application/json date: - - Mon, 23 Nov 2020 06:39:18 GMT + - Thu, 25 Feb 2021 06:18:11 GMT etag: - - '"1D6C16352E16035"' + - '"1D70B3DF32CDD75"' expires: - '-1' pragma: @@ -187,9 +188,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/sourcecontrols/web?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/sourcecontrols/web?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/sourcecontrols/web","name":"mysitexxyzz","type":"Microsoft.Web/sites/sourcecontrols","location":"East @@ -202,9 +203,9 @@ interactions: content-type: - application/json date: - - Mon, 23 Nov 2020 06:39:30 GMT + - Thu, 25 Feb 2021 06:18:18 GMT etag: - - '"1D6C1636582C3C0"' + - '"1D70B3E029DE8A0"' expires: - '-1' pragma: @@ -234,64 +235,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/sourcecontrols/web?api-version=2019-08-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/sourcecontrols/web","name":"mysitexxyzz","type":"Microsoft.Web/sites/sourcecontrols","location":"East - US","properties":{"repoUrl":"https://github.com/00Kai0/azure-site-test","branch":"staging","isManualIntegration":true,"isGitHubAction":false,"deploymentRollbackEnabled":false,"isMercurial":false,"provisioningState":"InProgress","provisioningDetails":"2020-11-23T06:40:00.1948671 - https://mysitexxyzz.scm.azurewebsites.net/api/deployments/latest?deployer=GitHub&time=2020-11-23_06-39-38Z","gitHubActionConfiguration":null}}' - headers: - cache-control: - - no-cache - content-length: - - '715' - content-type: - - application/json - date: - - Mon, 23 Nov 2020 06:40:02 GMT - etag: - - '"1D6C1636582C3C0"' - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-aspnet-version: - - 4.0.30319 - x-content-type-options: - - nosniff - x-powered-by: - - ASP.NET - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/sourcecontrols/web?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/sourcecontrols/web?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/sourcecontrols/web","name":"mysitexxyzz","type":"Microsoft.Web/sites/sourcecontrols","location":"East - US","properties":{"repoUrl":"https://github.com/00Kai0/azure-site-test","branch":"staging","isManualIntegration":true,"isGitHubAction":false,"deploymentRollbackEnabled":false,"isMercurial":false,"provisioningState":"InProgress","provisioningDetails":"2020-11-23T06:40:26.2835297 - https://mysitexxyzz.scm.azurewebsites.net/api/deployments/latest?deployer=GitHub&time=2020-11-23_06-39-38Z","gitHubActionConfiguration":null}}' + US","properties":{"repoUrl":"https://github.com/00Kai0/azure-site-test","branch":"staging","isManualIntegration":true,"isGitHubAction":false,"deploymentRollbackEnabled":false,"isMercurial":false,"provisioningState":"InProgress","provisioningDetails":"2021-02-25T06:18:44.8974493 + https://mysitexxyzz.scm.azurewebsites.net/api/deployments/latest?deployer=GitHub&time=2021-02-25_06-18-31Z","gitHubActionConfiguration":null}}' headers: cache-control: - no-cache @@ -300,9 +251,9 @@ interactions: content-type: - application/json date: - - Mon, 23 Nov 2020 06:40:33 GMT + - Thu, 25 Feb 2021 06:18:50 GMT etag: - - '"1D6C1636582C3C0"' + - '"1D70B3E029DE8A0"' expires: - '-1' pragma: @@ -334,9 +285,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/sourcecontrols/web?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/sourcecontrols/web?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/sourcecontrols/web","name":"mysitexxyzz","type":"Microsoft.Web/sites/sourcecontrols","location":"East @@ -349,9 +300,9 @@ interactions: content-type: - application/json date: - - Mon, 23 Nov 2020 06:41:04 GMT + - Thu, 25 Feb 2021 06:19:20 GMT etag: - - '"1D6C1636582C3C0"' + - '"1D70B3E029DE8A0"' expires: - '-1' pragma: @@ -383,24 +334,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/config/web?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/config/web?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/config/web","name":"mysitexxyzz","type":"Microsoft.Web/sites/config","location":"East - US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php","hostingstart.html"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","powerShellVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":null,"httpLoggingEnabled":false,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$mysitexxyzz","publishingPassword":null,"appSettings":null,"azureStorageAccounts":{},"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"ExternalGit","use32BitWorkerProcess":true,"webSocketsEnabled":true,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","vnetRouteAllEnabled":false,"vnetPrivatePortsCount":0,"siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretSettingName":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"aadClaimsAuthorization":null,"googleClientId":null,"googleClientSecret":null,"googleClientSecretSettingName":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookAppSecretSettingName":null,"facebookOAuthScopes":null,"gitHubClientId":null,"gitHubClientSecret":null,"gitHubClientSecretSettingName":null,"gitHubOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"twitterConsumerSecretSettingName":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountClientSecretSettingName":null,"microsoftAccountOAuthScopes":null},"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php","hostingstart.html"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","powerShellVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":null,"httpLoggingEnabled":false,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$mysitexxyzz","publishingPassword":null,"appSettings":null,"azureStorageAccounts":{},"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"ExternalGit","use32BitWorkerProcess":true,"webSocketsEnabled":true,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","vnetRouteAllEnabled":false,"vnetPrivatePortsCount":0,"siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"configVersion":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretSettingName":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"aadClaimsAuthorization":null,"googleClientId":null,"googleClientSecret":null,"googleClientSecretSettingName":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookAppSecretSettingName":null,"facebookOAuthScopes":null,"gitHubClientId":null,"gitHubClientSecret":null,"gitHubClientSecretSettingName":null,"gitHubOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"twitterConsumerSecretSettingName":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountClientSecretSettingName":null,"microsoftAccountOAuthScopes":null},"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow all","description":"Allow all access"}],"scmIpSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":false,"http20Enabled":true,"minTlsVersion":"1.2","scmMinTlsVersion":"1.0","ftpsState":"AllAllowed","preWarmedInstanceCount":0,"functionAppScaleLimit":0,"healthCheckPath":null,"fileChangeAuditEnabled":false,"functionsRuntimeScaleMonitoringEnabled":false,"websiteTimeZone":null,"minimumElasticInstanceCount":0}}' headers: cache-control: - no-cache content-length: - - '3637' + - '3658' content-type: - application/json date: - - Mon, 23 Nov 2020 06:41:04 GMT + - Thu, 25 Feb 2021 06:19:21 GMT expires: - '-1' pragma: @@ -432,24 +383,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz","name":"mysitexxyzz","type":"Microsoft.Web/sites","kind":"app","location":"East - US","properties":{"name":"mysitexxyzz","state":"Running","hostNames":["mysitexxyzz.azurewebsites.net"],"webSpace":"rgname-EastUSwebspace","selfLink":"https://waws-prod-blu-213.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/rgname-EastUSwebspace/sites/mysitexxyzz","repositorySiteName":"mysitexxyzz","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["mysitexxyzz.azurewebsites.net","mysitexxyzz.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[{"name":"LinuxFxVersion","value":""},{"name":"WindowsFxVersion","value":null}],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"mysitexxyzz.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"mysitexxyzz.scm.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Repository"}],"computeMode":null,"serverFarm":null,"serverFarmId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan","reserved":false,"isXenon":false,"hyperV":false,"lastModifiedTimeUtc":"2020-11-23T06:39:30.3","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":{"numberOfWorkers":null,"defaultDocuments":null,"netFrameworkVersion":null,"phpVersion":null,"pythonVersion":null,"nodeVersion":null,"powerShellVersion":null,"linuxFxVersion":null,"windowsFxVersion":null,"requestTracingEnabled":null,"remoteDebuggingEnabled":null,"remoteDebuggingVersion":null,"httpLoggingEnabled":null,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":null,"detailedErrorLoggingEnabled":null,"publishingUsername":null,"publishingPassword":null,"appSettings":null,"azureStorageAccounts":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":null,"use32BitWorkerProcess":null,"webSocketsEnabled":null,"alwaysOn":null,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":null,"managedPipelineMode":null,"virtualApplications":null,"winAuthAdminState":null,"winAuthTenantState":null,"customAppPoolIdentityAdminState":null,"customAppPoolIdentityTenantState":null,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":null,"routingRules":null,"experiments":null,"limits":null,"autoHealEnabled":null,"autoHealRules":null,"tracingOptions":null,"vnetName":null,"vnetRouteAllEnabled":null,"vnetPrivatePortsCount":null,"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":null,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":null,"scmIpSecurityRestrictions":null,"scmIpSecurityRestrictionsUseMain":null,"http20Enabled":null,"minTlsVersion":null,"scmMinTlsVersion":null,"ftpsState":null,"preWarmedInstanceCount":null,"functionAppScaleLimit":null,"healthCheckPath":null,"fileChangeAuditEnabled":null,"functionsRuntimeScaleMonitoringEnabled":null,"websiteTimeZone":null,"minimumElasticInstanceCount":0},"deploymentId":"mysitexxyzz","trafficManagerHostNames":null,"sku":"Basic","scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"clientCertMode":"Required","clientCertExclusionPaths":null,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"customDomainVerificationId":"55F2E4435A6748F0C3A4666505B3672446A9A9AEFDDC20F98EFEE4B5DCC7807E","kind":"app","inboundIpAddress":"20.49.104.14","possibleInboundIpAddresses":"20.49.104.14","ftpUsername":"mysitexxyzz\\$mysitexxyzz","ftpsHostName":"ftps://waws-prod-blu-213.ftp.azurewebsites.windows.net/site/wwwroot","outboundIpAddresses":"52.146.80.201,52.146.80.224,52.146.80.233,52.146.80.240,52.146.80.254,52.146.81.59,52.146.82.252,52.146.83.22,52.146.83.64","possibleOutboundIpAddresses":"52.146.80.201,52.146.80.224,52.146.80.233,52.146.80.240,52.146.80.254,52.146.81.59,52.146.82.252,52.146.83.22,52.146.83.64,52.146.81.74,52.146.81.101,52.146.81.141,52.146.81.155,52.146.81.240,52.146.81.254,52.146.82.7,52.146.82.8,52.146.82.17,52.146.82.61,52.146.82.81,52.146.82.87,52.146.82.136,52.146.82.188,52.146.82.209,52.146.82.221,52.146.82.243,52.146.82.244","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-blu-213","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"rgname","defaultHostName":"mysitexxyzz.azurewebsites.net","slotSwapStatus":null,"httpsOnly":false,"redundancyMode":"None","inProgressOperationId":null,"geoDistributions":null,"privateEndpointConnections":[],"buildVersion":null,"targetBuildVersion":null,"migrationState":null}}' + US","properties":{"name":"mysitexxyzz","state":"Running","hostNames":["mysitexxyzz.azurewebsites.net"],"webSpace":"rgname-EastUSwebspace","selfLink":"https://waws-prod-blu-139.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/rgname-EastUSwebspace/sites/mysitexxyzz","repositorySiteName":"mysitexxyzz","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["mysitexxyzz.azurewebsites.net","mysitexxyzz.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[{"name":"LinuxFxVersion","value":""},{"name":"WindowsFxVersion","value":null}],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"mysitexxyzz.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"mysitexxyzz.scm.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Repository"}],"computeMode":null,"serverFarm":null,"serverFarmId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan","reserved":false,"isXenon":false,"hyperV":false,"lastModifiedTimeUtc":"2021-02-25T06:18:19.05","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":{"numberOfWorkers":null,"defaultDocuments":null,"netFrameworkVersion":null,"phpVersion":null,"pythonVersion":null,"nodeVersion":null,"powerShellVersion":null,"linuxFxVersion":null,"windowsFxVersion":null,"requestTracingEnabled":null,"remoteDebuggingEnabled":null,"remoteDebuggingVersion":null,"httpLoggingEnabled":null,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":null,"detailedErrorLoggingEnabled":null,"publishingUsername":null,"publishingPassword":null,"appSettings":null,"azureStorageAccounts":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":null,"use32BitWorkerProcess":null,"webSocketsEnabled":null,"alwaysOn":null,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":null,"managedPipelineMode":null,"virtualApplications":null,"winAuthAdminState":null,"winAuthTenantState":null,"customAppPoolIdentityAdminState":null,"customAppPoolIdentityTenantState":null,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":null,"routingRules":null,"experiments":null,"limits":null,"autoHealEnabled":null,"autoHealRules":null,"tracingOptions":null,"vnetName":null,"vnetRouteAllEnabled":null,"vnetPrivatePortsCount":null,"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":null,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":null,"scmIpSecurityRestrictions":null,"scmIpSecurityRestrictionsUseMain":null,"http20Enabled":null,"minTlsVersion":null,"scmMinTlsVersion":null,"ftpsState":null,"preWarmedInstanceCount":null,"functionAppScaleLimit":null,"healthCheckPath":null,"fileChangeAuditEnabled":null,"functionsRuntimeScaleMonitoringEnabled":null,"websiteTimeZone":null,"minimumElasticInstanceCount":0},"deploymentId":"mysitexxyzz","trafficManagerHostNames":null,"sku":"Basic","scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"clientCertMode":"Required","clientCertExclusionPaths":null,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"customDomainVerificationId":"55F2E4435A6748F0C3A4666505B3672446A9A9AEFDDC20F98EFEE4B5DCC7807E","kind":"app","inboundIpAddress":"40.79.154.194","possibleInboundIpAddresses":"40.79.154.194","ftpUsername":"mysitexxyzz\\$mysitexxyzz","ftpsHostName":"ftps://waws-prod-blu-139.ftp.azurewebsites.windows.net/site/wwwroot","outboundIpAddresses":"40.79.154.194,137.117.100.130,137.117.103.80,137.117.97.189,137.117.101.166","possibleOutboundIpAddresses":"40.79.154.194,137.117.100.130,137.117.103.80,137.117.97.189,137.117.101.166,137.117.98.138,137.117.99.211,137.117.97.27","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-blu-139","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"rgname","defaultHostName":"mysitexxyzz.azurewebsites.net","slotSwapStatus":null,"httpsOnly":false,"redundancyMode":"None","inProgressOperationId":null,"geoDistributions":null,"privateEndpointConnections":[],"buildVersion":null,"targetBuildVersion":null,"migrationState":null,"eligibleLogCategories":"AppServiceAppLogs,AppServiceAuditLogs,AppServiceConsoleLogs,AppServiceHTTPLogs,AppServiceIPSecAuditLogs,AppServicePlatformLogs,ScanLogs","storageAccountRequired":false}}' headers: cache-control: - no-cache content-length: - - '5803' + - '5706' content-type: - application/json date: - - Mon, 23 Nov 2020 06:41:05 GMT + - Thu, 25 Feb 2021 06:19:22 GMT etag: - - '"1D6C1636582C3C0"' + - '"1D70B3E029DE8A0"' expires: - '-1' pragma: @@ -481,9 +432,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/sourcecontrols/web?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/sourcecontrols/web?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/sourcecontrols/web","name":"mysitexxyzz","type":"Microsoft.Web/sites/sourcecontrols","location":"East @@ -496,9 +447,9 @@ interactions: content-type: - application/json date: - - Mon, 23 Nov 2020 06:41:05 GMT + - Thu, 25 Feb 2021 06:19:24 GMT etag: - - '"1D6C1636582C3C0"' + - '"1D70B3E029DE8A0"' expires: - '-1' pragma: @@ -538,26 +489,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz","name":"mysitexxyzz","type":"Microsoft.Web/sites","kind":"app","location":"East - US","properties":{"name":"mysitexxyzz","state":"Running","hostNames":["mysitexxyzz.azurewebsites.net"],"webSpace":"rgname-EastUSwebspace","selfLink":"https://waws-prod-blu-213.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/rgname-EastUSwebspace/sites/mysitexxyzz","repositorySiteName":"mysitexxyzz","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["mysitexxyzz.azurewebsites.net","mysitexxyzz.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[{"name":"LinuxFxVersion","value":""},{"name":"WindowsFxVersion","value":null}],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"mysitexxyzz.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"mysitexxyzz.scm.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Repository"}],"computeMode":null,"serverFarm":null,"serverFarmId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan","reserved":false,"isXenon":false,"hyperV":false,"lastModifiedTimeUtc":"2020-11-23T06:41:09.61","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":{"numberOfWorkers":null,"defaultDocuments":null,"netFrameworkVersion":null,"phpVersion":null,"pythonVersion":null,"nodeVersion":null,"powerShellVersion":null,"linuxFxVersion":null,"windowsFxVersion":null,"requestTracingEnabled":null,"remoteDebuggingEnabled":null,"remoteDebuggingVersion":null,"httpLoggingEnabled":null,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":null,"detailedErrorLoggingEnabled":null,"publishingUsername":null,"publishingPassword":null,"appSettings":null,"azureStorageAccounts":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":null,"use32BitWorkerProcess":null,"webSocketsEnabled":null,"alwaysOn":null,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":null,"managedPipelineMode":null,"virtualApplications":null,"winAuthAdminState":null,"winAuthTenantState":null,"customAppPoolIdentityAdminState":null,"customAppPoolIdentityTenantState":null,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":null,"routingRules":null,"experiments":null,"limits":null,"autoHealEnabled":null,"autoHealRules":null,"tracingOptions":null,"vnetName":null,"vnetRouteAllEnabled":null,"vnetPrivatePortsCount":null,"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":null,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + US","properties":{"name":"mysitexxyzz","state":"Running","hostNames":["mysitexxyzz.azurewebsites.net"],"webSpace":"rgname-EastUSwebspace","selfLink":"https://waws-prod-blu-139.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/rgname-EastUSwebspace/sites/mysitexxyzz","repositorySiteName":"mysitexxyzz","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["mysitexxyzz.azurewebsites.net","mysitexxyzz.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[{"name":"LinuxFxVersion","value":""},{"name":"WindowsFxVersion","value":null}],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"mysitexxyzz.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"mysitexxyzz.scm.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Repository"}],"computeMode":null,"serverFarm":null,"serverFarmId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan","reserved":false,"isXenon":false,"hyperV":false,"lastModifiedTimeUtc":"2021-02-25T06:19:28.1666667","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":{"numberOfWorkers":null,"defaultDocuments":null,"netFrameworkVersion":null,"phpVersion":null,"pythonVersion":null,"nodeVersion":null,"powerShellVersion":null,"linuxFxVersion":null,"windowsFxVersion":null,"requestTracingEnabled":null,"remoteDebuggingEnabled":null,"remoteDebuggingVersion":null,"httpLoggingEnabled":null,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":null,"detailedErrorLoggingEnabled":null,"publishingUsername":null,"publishingPassword":null,"appSettings":null,"azureStorageAccounts":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":null,"use32BitWorkerProcess":null,"webSocketsEnabled":null,"alwaysOn":null,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":null,"managedPipelineMode":null,"virtualApplications":null,"winAuthAdminState":null,"winAuthTenantState":null,"customAppPoolIdentityAdminState":null,"customAppPoolIdentityTenantState":null,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":null,"routingRules":null,"experiments":null,"limits":null,"autoHealEnabled":null,"autoHealRules":null,"tracingOptions":null,"vnetName":null,"vnetRouteAllEnabled":null,"vnetPrivatePortsCount":null,"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":null,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow all","description":"Allow all access"}],"scmIpSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow - all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":null,"http20Enabled":null,"minTlsVersion":null,"scmMinTlsVersion":null,"ftpsState":null,"preWarmedInstanceCount":null,"functionAppScaleLimit":null,"healthCheckPath":null,"fileChangeAuditEnabled":null,"functionsRuntimeScaleMonitoringEnabled":null,"websiteTimeZone":null,"minimumElasticInstanceCount":0},"deploymentId":"mysitexxyzz","trafficManagerHostNames":null,"sku":"Basic","scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"clientCertMode":"Required","clientCertExclusionPaths":null,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"customDomainVerificationId":"55F2E4435A6748F0C3A4666505B3672446A9A9AEFDDC20F98EFEE4B5DCC7807E","kind":"app","inboundIpAddress":"20.49.104.14","possibleInboundIpAddresses":"20.49.104.14","ftpUsername":"mysitexxyzz\\$mysitexxyzz","ftpsHostName":"ftps://waws-prod-blu-213.ftp.azurewebsites.windows.net/site/wwwroot","outboundIpAddresses":"52.146.80.201,52.146.80.224,52.146.80.233,52.146.80.240,52.146.80.254,52.146.81.59,52.146.82.252,52.146.83.22,52.146.83.64","possibleOutboundIpAddresses":"52.146.80.201,52.146.80.224,52.146.80.233,52.146.80.240,52.146.80.254,52.146.81.59,52.146.82.252,52.146.83.22,52.146.83.64,52.146.81.74,52.146.81.101,52.146.81.141,52.146.81.155,52.146.81.240,52.146.81.254,52.146.82.7,52.146.82.8,52.146.82.17,52.146.82.61,52.146.82.81,52.146.82.87,52.146.82.136,52.146.82.188,52.146.82.209,52.146.82.221,52.146.82.243,52.146.82.244","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-blu-213","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"rgname","defaultHostName":"mysitexxyzz.azurewebsites.net","slotSwapStatus":null,"httpsOnly":false,"redundancyMode":"None","inProgressOperationId":null,"geoDistributions":null,"privateEndpointConnections":null,"buildVersion":null,"targetBuildVersion":null,"migrationState":null}}' + all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":null,"http20Enabled":null,"minTlsVersion":null,"scmMinTlsVersion":null,"ftpsState":null,"preWarmedInstanceCount":null,"functionAppScaleLimit":null,"healthCheckPath":null,"fileChangeAuditEnabled":null,"functionsRuntimeScaleMonitoringEnabled":null,"websiteTimeZone":null,"minimumElasticInstanceCount":0},"deploymentId":"mysitexxyzz","trafficManagerHostNames":null,"sku":"Basic","scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"clientCertMode":"Required","clientCertExclusionPaths":null,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"customDomainVerificationId":"55F2E4435A6748F0C3A4666505B3672446A9A9AEFDDC20F98EFEE4B5DCC7807E","kind":"app","inboundIpAddress":"40.79.154.194","possibleInboundIpAddresses":"40.79.154.194","ftpUsername":"mysitexxyzz\\$mysitexxyzz","ftpsHostName":"ftps://waws-prod-blu-139.ftp.azurewebsites.windows.net/site/wwwroot","outboundIpAddresses":"40.79.154.194,137.117.100.130,137.117.103.80,137.117.97.189,137.117.101.166","possibleOutboundIpAddresses":"40.79.154.194,137.117.100.130,137.117.103.80,137.117.97.189,137.117.101.166,137.117.98.138,137.117.99.211,137.117.97.27","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-blu-139","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"rgname","defaultHostName":"mysitexxyzz.azurewebsites.net","slotSwapStatus":null,"httpsOnly":false,"redundancyMode":"None","inProgressOperationId":null,"geoDistributions":null,"privateEndpointConnections":null,"buildVersion":null,"targetBuildVersion":null,"migrationState":null,"eligibleLogCategories":"AppServiceAppLogs,AppServiceAuditLogs,AppServiceConsoleLogs,AppServiceHTTPLogs,AppServiceIPSecAuditLogs,AppServicePlatformLogs,ScanLogs","storageAccountRequired":false}}' headers: cache-control: - no-cache content-length: - - '6004' + - '5911' content-type: - application/json date: - - Mon, 23 Nov 2020 06:41:12 GMT + - Thu, 25 Feb 2021 06:19:31 GMT etag: - - '"1D6C1636582C3C0"' + - '"1D70B3E029DE8A0"' expires: - '-1' pragma: @@ -596,26 +547,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/config/web?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/config/web?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz","name":"mysitexxyzz","type":"Microsoft.Web/sites","location":"East - US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php","hostingstart.html"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","powerShellVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":null,"httpLoggingEnabled":false,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$mysitexxyzz","publishingPassword":null,"appSettings":null,"azureStorageAccounts":{},"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"ExternalGit","use32BitWorkerProcess":true,"webSocketsEnabled":true,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","vnetRouteAllEnabled":false,"vnetPrivatePortsCount":0,"siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretSettingName":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"aadClaimsAuthorization":null,"googleClientId":null,"googleClientSecret":null,"googleClientSecretSettingName":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookAppSecretSettingName":null,"facebookOAuthScopes":null,"gitHubClientId":null,"gitHubClientSecret":null,"gitHubClientSecretSettingName":null,"gitHubOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"twitterConsumerSecretSettingName":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountClientSecretSettingName":null,"microsoftAccountOAuthScopes":null},"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php","hostingstart.html"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","powerShellVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":null,"httpLoggingEnabled":false,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$mysitexxyzz","publishingPassword":null,"appSettings":null,"azureStorageAccounts":{},"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"ExternalGit","use32BitWorkerProcess":true,"webSocketsEnabled":true,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","vnetRouteAllEnabled":false,"vnetPrivatePortsCount":0,"siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"configVersion":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretSettingName":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"aadClaimsAuthorization":null,"googleClientId":null,"googleClientSecret":null,"googleClientSecretSettingName":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookAppSecretSettingName":null,"facebookOAuthScopes":null,"gitHubClientId":null,"gitHubClientSecret":null,"gitHubClientSecretSettingName":null,"gitHubOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"twitterConsumerSecretSettingName":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountClientSecretSettingName":null,"microsoftAccountOAuthScopes":null},"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow all","description":"Allow all access"}],"scmIpSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":false,"http20Enabled":true,"minTlsVersion":"1.2","scmMinTlsVersion":"1.0","ftpsState":"AllAllowed","preWarmedInstanceCount":0,"functionAppScaleLimit":0,"healthCheckPath":null,"fileChangeAuditEnabled":false,"functionsRuntimeScaleMonitoringEnabled":false,"websiteTimeZone":null,"minimumElasticInstanceCount":0}}' headers: cache-control: - no-cache content-length: - - '3619' + - '3640' content-type: - application/json date: - - Mon, 23 Nov 2020 06:41:14 GMT + - Thu, 25 Feb 2021 06:19:34 GMT etag: - - '"1D6C163A0B444A0"' + - '"1D70B3E2BD0466B"' expires: - '-1' pragma: @@ -654,9 +605,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/sourcecontrols/web?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/sourcecontrols/web?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/sourcecontrols/web","name":"mysitexxyzz","type":"Microsoft.Web/sites/sourcecontrols","location":"East @@ -669,9 +620,9 @@ interactions: content-type: - application/json date: - - Mon, 23 Nov 2020 06:41:14 GMT + - Thu, 25 Feb 2021 06:19:35 GMT etag: - - '"1D6C163A30DF915"' + - '"1D70B3E2F3EAC35"' expires: - '-1' pragma: @@ -707,9 +658,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/start?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/start?api-version=2020-09-01 response: body: string: '' @@ -719,7 +670,7 @@ interactions: content-length: - '0' date: - - Mon, 23 Nov 2020 06:41:15 GMT + - Thu, 25 Feb 2021 06:19:35 GMT expires: - '-1' pragma: @@ -751,9 +702,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/restart?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/restart?api-version=2020-09-01 response: body: string: '' @@ -763,7 +714,7 @@ interactions: content-length: - '0' date: - - Mon, 23 Nov 2020 06:41:16 GMT + - Thu, 25 Feb 2021 06:19:36 GMT expires: - '-1' pragma: @@ -795,9 +746,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/stop?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/stop?api-version=2020-09-01 response: body: string: '' @@ -807,7 +758,7 @@ interactions: content-length: - '0' date: - - Mon, 23 Nov 2020 06:41:16 GMT + - Thu, 25 Feb 2021 06:19:37 GMT expires: - '-1' pragma: @@ -839,9 +790,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/sourcecontrols/web?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/sourcecontrols/web?api-version=2020-09-01 response: body: string: '' @@ -851,9 +802,9 @@ interactions: content-length: - '0' date: - - Mon, 23 Nov 2020 06:41:33 GMT + - Thu, 25 Feb 2021 06:19:47 GMT etag: - - '"1D6C163A5BF2960"' + - '"1D70B3E322851A0"' expires: - '-1' pragma: @@ -885,9 +836,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz?api-version=2020-09-01 response: body: string: '' @@ -897,9 +848,9 @@ interactions: content-length: - '0' date: - - Mon, 23 Nov 2020 06:41:44 GMT + - Thu, 25 Feb 2021 06:20:00 GMT etag: - - '"1D6C163A5BF2960"' + - '"1D70B3E322851A0"' expires: - '-1' pragma: diff --git a/sdk/appservice/azure-mgmt-web/tests/recordings/test_cli_mgmt_web_app.test_web_app_slot.yaml b/sdk/appservice/azure-mgmt-web/tests/recordings/test_cli_mgmt_web_app.test_web_app_slot.yaml index 0470cbfa84e4..e1788d2f6f19 100644 --- a/sdk/appservice/azure-mgmt-web/tests/recordings/test_cli_mgmt_web_app.test_web_app_slot.yaml +++ b/sdk/appservice/azure-mgmt-web/tests/recordings/test_cli_mgmt_web_app.test_web_app_slot.yaml @@ -14,23 +14,24 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan?api-version=2020-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan","name":"myappserviceplan","type":"Microsoft.Web/serverfarms","kind":"app","location":"East - US","properties":{"serverFarmId":7434,"name":"myappserviceplan","workerSize":"Default","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Default","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"rgname-EastUSwebspace","subscription":"00000000-0000-0000-0000-000000000000","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":10,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"East - US","perSiteScaling":false,"maximumElasticWorkerCount":1,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"app","resourceGroup":"rgname","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-blu-213_7434","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded","webSiteId":null,"existingServerFarmIds":null,"azBalancing":false},"sku":{"name":"S1","tier":"Standard","size":"S1","family":"S","capacity":1}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan","name":"myappserviceplan","type":"Microsoft.Web/serverfarms","kind":"app","location":"eastus","properties":{"serverFarmId":42184,"name":"myappserviceplan","sku":{"name":"S1","tier":"Standard","size":"S1","family":"S","capacity":1},"workerSize":"Default","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Default","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"rgname-EastUSwebspace","subscription":"00000000-0000-0000-0000-000000000000","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":0,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"East + US","perSiteScaling":false,"maximumElasticWorkerCount":1,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"app","resourceGroup":"rgname","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-blu-143_42184","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded","webSiteId":null,"existingServerFarmIds":null,"azBalancing":false},"sku":{"name":"S1","tier":"Standard","size":"S1","family":"S","capacity":1}}' headers: cache-control: - no-cache content-length: - - '1522' + - '1598' content-type: - application/json date: - - Mon, 23 Nov 2020 06:42:03 GMT + - Thu, 25 Feb 2021 06:20:25 GMT + etag: + - '"1D70B3E4D22F495"' expires: - '-1' pragma: @@ -48,7 +49,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1194' + - '1198' x-powered-by: - ASP.NET status: @@ -72,25 +73,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz?api-version=2020-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz","name":"mysitexxyzz","type":"Microsoft.Web/sites","kind":"app","location":"eastus","properties":{"name":"mysitexxyzz","state":"Running","hostNames":["mysitexxyzz.azurewebsites.net"],"webSpace":"rgname-EastUSwebspace","selfLink":"https://waws-prod-blu-213.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/rgname-EastUSwebspace/sites/mysitexxyzz","repositorySiteName":"mysitexxyzz","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["mysitexxyzz.azurewebsites.net","mysitexxyzz.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[{"name":"LinuxFxVersion","value":""},{"name":"WindowsFxVersion","value":null}],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"mysitexxyzz.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"mysitexxyzz.scm.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Repository"}],"computeMode":null,"serverFarm":null,"serverFarmId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan","reserved":false,"isXenon":false,"hyperV":false,"lastModifiedTimeUtc":"2020-11-23T06:42:08.29","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":{"numberOfWorkers":null,"defaultDocuments":null,"netFrameworkVersion":null,"phpVersion":null,"pythonVersion":null,"nodeVersion":null,"powerShellVersion":null,"linuxFxVersion":null,"windowsFxVersion":null,"requestTracingEnabled":null,"remoteDebuggingEnabled":null,"remoteDebuggingVersion":null,"httpLoggingEnabled":null,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":null,"detailedErrorLoggingEnabled":null,"publishingUsername":null,"publishingPassword":null,"appSettings":null,"azureStorageAccounts":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":null,"use32BitWorkerProcess":null,"webSocketsEnabled":null,"alwaysOn":null,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":null,"managedPipelineMode":null,"virtualApplications":null,"winAuthAdminState":null,"winAuthTenantState":null,"customAppPoolIdentityAdminState":null,"customAppPoolIdentityTenantState":null,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":null,"routingRules":null,"experiments":null,"limits":null,"autoHealEnabled":null,"autoHealRules":null,"tracingOptions":null,"vnetName":null,"vnetRouteAllEnabled":null,"vnetPrivatePortsCount":null,"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":null,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz","name":"mysitexxyzz","type":"Microsoft.Web/sites","kind":"app","location":"eastus","properties":{"name":"mysitexxyzz","state":"Running","hostNames":["mysitexxyzz.azurewebsites.net"],"webSpace":"rgname-EastUSwebspace","selfLink":"https://waws-prod-blu-143.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/rgname-EastUSwebspace/sites/mysitexxyzz","repositorySiteName":"mysitexxyzz","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["mysitexxyzz.azurewebsites.net","mysitexxyzz.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[{"name":"LinuxFxVersion","value":""},{"name":"WindowsFxVersion","value":null}],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"mysitexxyzz.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"mysitexxyzz.scm.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Repository"}],"computeMode":null,"serverFarm":null,"serverFarmId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan","reserved":false,"isXenon":false,"hyperV":false,"lastModifiedTimeUtc":"2021-02-25T06:20:30.2433333","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":{"numberOfWorkers":null,"defaultDocuments":null,"netFrameworkVersion":null,"phpVersion":null,"pythonVersion":null,"nodeVersion":null,"powerShellVersion":null,"linuxFxVersion":null,"windowsFxVersion":null,"requestTracingEnabled":null,"remoteDebuggingEnabled":null,"remoteDebuggingVersion":null,"httpLoggingEnabled":null,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":null,"detailedErrorLoggingEnabled":null,"publishingUsername":null,"publishingPassword":null,"appSettings":null,"azureStorageAccounts":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":null,"use32BitWorkerProcess":null,"webSocketsEnabled":null,"alwaysOn":null,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":null,"managedPipelineMode":null,"virtualApplications":null,"winAuthAdminState":null,"winAuthTenantState":null,"customAppPoolIdentityAdminState":null,"customAppPoolIdentityTenantState":null,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":null,"routingRules":null,"experiments":null,"limits":null,"autoHealEnabled":null,"autoHealRules":null,"tracingOptions":null,"vnetName":null,"vnetRouteAllEnabled":null,"vnetPrivatePortsCount":null,"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":null,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow all","description":"Allow all access"}],"scmIpSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow - all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":null,"http20Enabled":null,"minTlsVersion":null,"scmMinTlsVersion":null,"ftpsState":null,"preWarmedInstanceCount":null,"functionAppScaleLimit":null,"healthCheckPath":null,"fileChangeAuditEnabled":null,"functionsRuntimeScaleMonitoringEnabled":null,"websiteTimeZone":null,"minimumElasticInstanceCount":0},"deploymentId":"mysitexxyzz","trafficManagerHostNames":null,"sku":"Standard","scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"clientCertMode":"Required","clientCertExclusionPaths":null,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"customDomainVerificationId":"55F2E4435A6748F0C3A4666505B3672446A9A9AEFDDC20F98EFEE4B5DCC7807E","kind":"app","inboundIpAddress":"20.49.104.14","possibleInboundIpAddresses":"20.49.104.14","ftpUsername":"mysitexxyzz\\$mysitexxyzz","ftpsHostName":"ftps://waws-prod-blu-213.ftp.azurewebsites.windows.net/site/wwwroot","outboundIpAddresses":"52.146.80.201,52.146.80.224,52.146.80.233,52.146.80.240,52.146.80.254,52.146.81.59,52.146.82.252,52.146.83.22,52.146.83.64","possibleOutboundIpAddresses":"52.146.80.201,52.146.80.224,52.146.80.233,52.146.80.240,52.146.80.254,52.146.81.59,52.146.82.252,52.146.83.22,52.146.83.64,52.146.81.74,52.146.81.101,52.146.81.141,52.146.81.155,52.146.81.240,52.146.81.254,52.146.82.7,52.146.82.8,52.146.82.17,52.146.82.61,52.146.82.81,52.146.82.87,52.146.82.136,52.146.82.188,52.146.82.209,52.146.82.221,52.146.82.243,52.146.82.244","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-blu-213","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"rgname","defaultHostName":"mysitexxyzz.azurewebsites.net","slotSwapStatus":null,"httpsOnly":false,"redundancyMode":"None","inProgressOperationId":null,"geoDistributions":null,"privateEndpointConnections":null,"buildVersion":null,"targetBuildVersion":null,"migrationState":null}}' + all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":null,"http20Enabled":null,"minTlsVersion":null,"scmMinTlsVersion":null,"ftpsState":null,"preWarmedInstanceCount":null,"functionAppScaleLimit":null,"healthCheckPath":null,"fileChangeAuditEnabled":null,"functionsRuntimeScaleMonitoringEnabled":null,"websiteTimeZone":null,"minimumElasticInstanceCount":0},"deploymentId":"mysitexxyzz","trafficManagerHostNames":null,"sku":"Standard","scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"clientCertMode":"Required","clientCertExclusionPaths":null,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"customDomainVerificationId":"55F2E4435A6748F0C3A4666505B3672446A9A9AEFDDC20F98EFEE4B5DCC7807E","kind":"app","inboundIpAddress":"40.71.11.133","possibleInboundIpAddresses":"40.71.11.133","ftpUsername":"mysitexxyzz\\$mysitexxyzz","ftpsHostName":"ftps://waws-prod-blu-143.ftp.azurewebsites.windows.net/site/wwwroot","outboundIpAddresses":"40.71.11.133,23.101.132.11,40.114.52.253,137.135.64.181,40.114.50.7","possibleOutboundIpAddresses":"40.71.11.133,23.101.132.11,40.114.52.253,137.135.64.181,40.114.50.7,40.114.15.207,137.135.71.113,40.114.53.155","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-blu-143","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"rgname","defaultHostName":"mysitexxyzz.azurewebsites.net","slotSwapStatus":null,"httpsOnly":false,"redundancyMode":"None","inProgressOperationId":null,"geoDistributions":null,"privateEndpointConnections":null,"buildVersion":null,"targetBuildVersion":null,"migrationState":null,"eligibleLogCategories":"AppServiceAppLogs,AppServiceAuditLogs,AppServiceConsoleLogs,AppServiceHTTPLogs,AppServiceIPSecAuditLogs,AppServicePlatformLogs,ScanLogs","storageAccountRequired":false}}' headers: cache-control: - no-cache content-length: - - '6006' + - '5894' content-type: - application/json date: - - Mon, 23 Nov 2020 06:42:25 GMT + - Thu, 25 Feb 2021 06:20:48 GMT etag: - - '"1D6C163C412532B"' + - '"1D70B3E5140D440"' expires: - '-1' pragma: @@ -108,7 +109,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-resource-requests: - - '497' + - '499' x-powered-by: - ASP.NET status: @@ -128,25 +129,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging?api-version=2020-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging","name":"mysitexxyzz/staging","type":"Microsoft.Web/sites/slots","kind":"app","location":"eastus","properties":{"name":"mysitexxyzz(staging)","state":"Running","hostNames":["mysitexxyzz-staging.azurewebsites.net"],"webSpace":"rgname-EastUSwebspace","selfLink":"https://waws-prod-blu-213.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/rgname-EastUSwebspace/sites/mysitexxyzz","repositorySiteName":"mysitexxyzz","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["mysitexxyzz-staging.azurewebsites.net","mysitexxyzz-staging.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[{"name":"LinuxFxVersion","value":""},{"name":"WindowsFxVersion","value":null}],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"mysitexxyzz-staging.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"mysitexxyzz-staging.scm.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Repository"}],"computeMode":null,"serverFarm":null,"serverFarmId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan","reserved":false,"isXenon":false,"hyperV":false,"lastModifiedTimeUtc":"2020-11-23T06:42:33.0866667","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":{"numberOfWorkers":null,"defaultDocuments":null,"netFrameworkVersion":null,"phpVersion":null,"pythonVersion":null,"nodeVersion":null,"powerShellVersion":null,"linuxFxVersion":null,"windowsFxVersion":null,"requestTracingEnabled":null,"remoteDebuggingEnabled":null,"remoteDebuggingVersion":null,"httpLoggingEnabled":null,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":null,"detailedErrorLoggingEnabled":null,"publishingUsername":null,"publishingPassword":null,"appSettings":null,"azureStorageAccounts":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":null,"use32BitWorkerProcess":null,"webSocketsEnabled":null,"alwaysOn":null,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":null,"managedPipelineMode":null,"virtualApplications":null,"winAuthAdminState":null,"winAuthTenantState":null,"customAppPoolIdentityAdminState":null,"customAppPoolIdentityTenantState":null,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":null,"routingRules":null,"experiments":null,"limits":null,"autoHealEnabled":null,"autoHealRules":null,"tracingOptions":null,"vnetName":null,"vnetRouteAllEnabled":null,"vnetPrivatePortsCount":null,"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":null,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging","name":"mysitexxyzz/staging","type":"Microsoft.Web/sites/slots","kind":"app","location":"eastus","properties":{"name":"mysitexxyzz(staging)","state":"Running","hostNames":["mysitexxyzz-staging.azurewebsites.net"],"webSpace":"rgname-EastUSwebspace","selfLink":"https://waws-prod-blu-143.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/rgname-EastUSwebspace/sites/mysitexxyzz","repositorySiteName":"mysitexxyzz","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["mysitexxyzz-staging.azurewebsites.net","mysitexxyzz-staging.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[{"name":"LinuxFxVersion","value":""},{"name":"WindowsFxVersion","value":null}],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"mysitexxyzz-staging.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"mysitexxyzz-staging.scm.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Repository"}],"computeMode":null,"serverFarm":null,"serverFarmId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan","reserved":false,"isXenon":false,"hyperV":false,"lastModifiedTimeUtc":"2021-02-25T06:20:52.81","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":{"numberOfWorkers":null,"defaultDocuments":null,"netFrameworkVersion":null,"phpVersion":null,"pythonVersion":null,"nodeVersion":null,"powerShellVersion":null,"linuxFxVersion":null,"windowsFxVersion":null,"requestTracingEnabled":null,"remoteDebuggingEnabled":null,"remoteDebuggingVersion":null,"httpLoggingEnabled":null,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":null,"detailedErrorLoggingEnabled":null,"publishingUsername":null,"publishingPassword":null,"appSettings":null,"azureStorageAccounts":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":null,"use32BitWorkerProcess":null,"webSocketsEnabled":null,"alwaysOn":null,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":null,"managedPipelineMode":null,"virtualApplications":null,"winAuthAdminState":null,"winAuthTenantState":null,"customAppPoolIdentityAdminState":null,"customAppPoolIdentityTenantState":null,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":null,"routingRules":null,"experiments":null,"limits":null,"autoHealEnabled":null,"autoHealRules":null,"tracingOptions":null,"vnetName":null,"vnetRouteAllEnabled":null,"vnetPrivatePortsCount":null,"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":null,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow all","description":"Allow all access"}],"scmIpSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow - all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":null,"http20Enabled":null,"minTlsVersion":null,"scmMinTlsVersion":null,"ftpsState":null,"preWarmedInstanceCount":null,"functionAppScaleLimit":null,"healthCheckPath":null,"fileChangeAuditEnabled":null,"functionsRuntimeScaleMonitoringEnabled":null,"websiteTimeZone":null,"minimumElasticInstanceCount":0},"deploymentId":"mysitexxyzz__13b4","trafficManagerHostNames":null,"sku":"Standard","scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"clientCertMode":"Required","clientCertExclusionPaths":null,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"customDomainVerificationId":"55F2E4435A6748F0C3A4666505B3672446A9A9AEFDDC20F98EFEE4B5DCC7807E","kind":"app","inboundIpAddress":"20.49.104.14","possibleInboundIpAddresses":"20.49.104.14","ftpUsername":"mysitexxyzz__staging\\$mysitexxyzz__staging","ftpsHostName":"ftps://waws-prod-blu-213.ftp.azurewebsites.windows.net/site/wwwroot","outboundIpAddresses":"52.146.80.201,52.146.80.224,52.146.80.233,52.146.80.240,52.146.80.254,52.146.81.59,52.146.82.252,52.146.83.22,52.146.83.64","possibleOutboundIpAddresses":"52.146.80.201,52.146.80.224,52.146.80.233,52.146.80.240,52.146.80.254,52.146.81.59,52.146.82.252,52.146.83.22,52.146.83.64,52.146.81.74,52.146.81.101,52.146.81.141,52.146.81.155,52.146.81.240,52.146.81.254,52.146.82.7,52.146.82.8,52.146.82.17,52.146.82.61,52.146.82.81,52.146.82.87,52.146.82.136,52.146.82.188,52.146.82.209,52.146.82.221,52.146.82.243,52.146.82.244","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-blu-213","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"rgname","defaultHostName":"mysitexxyzz-staging.azurewebsites.net","slotSwapStatus":null,"httpsOnly":false,"redundancyMode":"None","inProgressOperationId":null,"geoDistributions":null,"privateEndpointConnections":null,"buildVersion":null,"targetBuildVersion":null,"migrationState":null}}' + all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":null,"http20Enabled":null,"minTlsVersion":null,"scmMinTlsVersion":null,"ftpsState":null,"preWarmedInstanceCount":null,"functionAppScaleLimit":null,"healthCheckPath":null,"fileChangeAuditEnabled":null,"functionsRuntimeScaleMonitoringEnabled":null,"websiteTimeZone":null,"minimumElasticInstanceCount":0},"deploymentId":"mysitexxyzz__3f44","trafficManagerHostNames":null,"sku":"Standard","scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"clientCertMode":"Required","clientCertExclusionPaths":null,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"customDomainVerificationId":"55F2E4435A6748F0C3A4666505B3672446A9A9AEFDDC20F98EFEE4B5DCC7807E","kind":"app","inboundIpAddress":"40.71.11.133","possibleInboundIpAddresses":"40.71.11.133","ftpUsername":"mysitexxyzz__staging\\$mysitexxyzz__staging","ftpsHostName":"ftps://waws-prod-blu-143.ftp.azurewebsites.windows.net/site/wwwroot","outboundIpAddresses":"40.71.11.133,23.101.132.11,40.114.52.253,137.135.64.181,40.114.50.7","possibleOutboundIpAddresses":"40.71.11.133,23.101.132.11,40.114.52.253,137.135.64.181,40.114.50.7,40.114.15.207,137.135.71.113,40.114.53.155","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-blu-143","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"rgname","defaultHostName":"mysitexxyzz-staging.azurewebsites.net","slotSwapStatus":null,"httpsOnly":false,"redundancyMode":"None","inProgressOperationId":null,"geoDistributions":null,"privateEndpointConnections":null,"buildVersion":null,"targetBuildVersion":null,"migrationState":null,"eligibleLogCategories":"AppServiceAppLogs,AppServiceAuditLogs,AppServiceConsoleLogs,AppServiceHTTPLogs,AppServiceIPSecAuditLogs,AppServicePlatformLogs,ScanLogs","storageAccountRequired":false}}' headers: cache-control: - no-cache content-length: - - '6120' + - '5998' content-type: - application/json date: - - Mon, 23 Nov 2020 06:42:49 GMT + - Thu, 25 Feb 2021 06:21:09 GMT etag: - - '"1D6C163C412532B"' + - '"1D70B3E5140D440"' expires: - '-1' pragma: @@ -185,26 +186,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/config/web?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/config/web?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging","name":"mysitexxyzz/staging","type":"Microsoft.Web/sites/slots","location":"East - US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php","hostingstart.html"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","powerShellVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":"VS2019","httpLoggingEnabled":false,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$mysitexxyzz__staging","publishingPassword":null,"appSettings":null,"azureStorageAccounts":{},"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"None","use32BitWorkerProcess":true,"webSocketsEnabled":true,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","vnetRouteAllEnabled":false,"vnetPrivatePortsCount":0,"siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretSettingName":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"aadClaimsAuthorization":null,"googleClientId":null,"googleClientSecret":null,"googleClientSecretSettingName":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookAppSecretSettingName":null,"facebookOAuthScopes":null,"gitHubClientId":null,"gitHubClientSecret":null,"gitHubClientSecretSettingName":null,"gitHubOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"twitterConsumerSecretSettingName":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountClientSecretSettingName":null,"microsoftAccountOAuthScopes":null},"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php","hostingstart.html"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","powerShellVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":"VS2019","httpLoggingEnabled":false,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$mysitexxyzz__staging","publishingPassword":null,"appSettings":null,"azureStorageAccounts":{},"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"None","use32BitWorkerProcess":true,"webSocketsEnabled":true,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","vnetRouteAllEnabled":false,"vnetPrivatePortsCount":0,"siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"configVersion":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretSettingName":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"aadClaimsAuthorization":null,"googleClientId":null,"googleClientSecret":null,"googleClientSecretSettingName":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookAppSecretSettingName":null,"facebookOAuthScopes":null,"gitHubClientId":null,"gitHubClientSecret":null,"gitHubClientSecretSettingName":null,"gitHubOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"twitterConsumerSecretSettingName":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountClientSecretSettingName":null,"microsoftAccountOAuthScopes":null},"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow all","description":"Allow all access"}],"scmIpSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":false,"http20Enabled":true,"minTlsVersion":"1.2","scmMinTlsVersion":"1.0","ftpsState":"AllAllowed","preWarmedInstanceCount":0,"functionAppScaleLimit":0,"healthCheckPath":null,"fileChangeAuditEnabled":false,"functionsRuntimeScaleMonitoringEnabled":false,"websiteTimeZone":null,"minimumElasticInstanceCount":0}}' headers: cache-control: - no-cache content-length: - - '3653' + - '3674' content-type: - application/json date: - - Mon, 23 Nov 2020 06:42:51 GMT + - Thu, 25 Feb 2021 06:21:11 GMT etag: - - '"1D6C163D30BD760"' + - '"1D70B3E5EF6DBF5"' expires: - '-1' pragma: @@ -222,7 +223,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1193' + - '1197' x-powered-by: - ASP.NET status: @@ -243,9 +244,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/sourcecontrols/web?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/sourcecontrols/web?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/sourcecontrols/web","name":"mysitexxyzz","type":"Microsoft.Web/sites/sourcecontrols","location":"East @@ -258,9 +259,9 @@ interactions: content-type: - application/json date: - - Mon, 23 Nov 2020 06:42:58 GMT + - Thu, 25 Feb 2021 06:21:18 GMT etag: - - '"1D6C163E1C85295"' + - '"1D70B3E6D55C0D5"' expires: - '-1' pragma: @@ -274,7 +275,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1192' + - '1196' x-powered-by: - ASP.NET status: @@ -290,14 +291,14 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/sourcecontrols/web?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/sourcecontrols/web?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/sourcecontrols/web","name":"mysitexxyzz","type":"Microsoft.Web/sites/sourcecontrols","location":"East - US","properties":{"repoUrl":"https://github.com/00Kai0/azure-site-test","branch":"staging","isManualIntegration":true,"isGitHubAction":false,"deploymentRollbackEnabled":false,"isMercurial":false,"provisioningState":"InProgress","provisioningDetails":"2020-11-23T06:43:20.1613008 - https://mysitexxyzz-staging.scm.azurewebsites.net/api/deployments/latest?deployer=GitHub&time=2020-11-23_06-43-08Z","gitHubActionConfiguration":null}}' + US","properties":{"repoUrl":"https://github.com/00Kai0/azure-site-test","branch":"staging","isManualIntegration":true,"isGitHubAction":false,"deploymentRollbackEnabled":false,"isMercurial":false,"provisioningState":"InProgress","provisioningDetails":"2021-02-25T06:21:48.1220627 + https://mysitexxyzz-staging.scm.azurewebsites.net/api/deployments/latest?deployer=GitHub&time=2021-02-25_06-21-26Z","gitHubActionConfiguration":null}}' headers: cache-control: - no-cache @@ -306,9 +307,9 @@ interactions: content-type: - application/json date: - - Mon, 23 Nov 2020 06:43:29 GMT + - Thu, 25 Feb 2021 06:21:48 GMT etag: - - '"1D6C163E1C85295"' + - '"1D70B3E6D55C0D5"' expires: - '-1' pragma: @@ -340,9 +341,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/sourcecontrols/web?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/sourcecontrols/web?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/sourcecontrols/web","name":"mysitexxyzz","type":"Microsoft.Web/sites/sourcecontrols","location":"East @@ -355,9 +356,9 @@ interactions: content-type: - application/json date: - - Mon, 23 Nov 2020 06:44:01 GMT + - Thu, 25 Feb 2021 06:22:19 GMT etag: - - '"1D6C163E1C85295"' + - '"1D70B3E6D55C0D5"' expires: - '-1' pragma: @@ -389,24 +390,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging","name":"mysitexxyzz/staging","type":"Microsoft.Web/sites/slots","kind":"app","location":"East - US","properties":{"name":"mysitexxyzz(staging)","state":"Running","hostNames":["mysitexxyzz-staging.azurewebsites.net"],"webSpace":"rgname-EastUSwebspace","selfLink":"https://waws-prod-blu-213.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/rgname-EastUSwebspace/sites/mysitexxyzz","repositorySiteName":"mysitexxyzz","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["mysitexxyzz-staging.azurewebsites.net","mysitexxyzz-staging.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[{"name":"LinuxFxVersion","value":""},{"name":"WindowsFxVersion","value":null}],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"mysitexxyzz-staging.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"mysitexxyzz-staging.scm.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Repository"}],"computeMode":null,"serverFarm":null,"serverFarmId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan","reserved":false,"isXenon":false,"hyperV":false,"lastModifiedTimeUtc":"2020-11-23T06:42:58.7933333","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":{"numberOfWorkers":null,"defaultDocuments":null,"netFrameworkVersion":null,"phpVersion":null,"pythonVersion":null,"nodeVersion":null,"powerShellVersion":null,"linuxFxVersion":null,"windowsFxVersion":null,"requestTracingEnabled":null,"remoteDebuggingEnabled":null,"remoteDebuggingVersion":null,"httpLoggingEnabled":null,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":null,"detailedErrorLoggingEnabled":null,"publishingUsername":null,"publishingPassword":null,"appSettings":null,"azureStorageAccounts":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":null,"use32BitWorkerProcess":null,"webSocketsEnabled":null,"alwaysOn":null,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":null,"managedPipelineMode":null,"virtualApplications":null,"winAuthAdminState":null,"winAuthTenantState":null,"customAppPoolIdentityAdminState":null,"customAppPoolIdentityTenantState":null,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":null,"routingRules":null,"experiments":null,"limits":null,"autoHealEnabled":null,"autoHealRules":null,"tracingOptions":null,"vnetName":null,"vnetRouteAllEnabled":null,"vnetPrivatePortsCount":null,"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":null,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":null,"scmIpSecurityRestrictions":null,"scmIpSecurityRestrictionsUseMain":null,"http20Enabled":null,"minTlsVersion":null,"scmMinTlsVersion":null,"ftpsState":null,"preWarmedInstanceCount":null,"functionAppScaleLimit":null,"healthCheckPath":null,"fileChangeAuditEnabled":null,"functionsRuntimeScaleMonitoringEnabled":null,"websiteTimeZone":null,"minimumElasticInstanceCount":0},"deploymentId":"mysitexxyzz__13b4","trafficManagerHostNames":null,"sku":"Standard","scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"clientCertMode":"Required","clientCertExclusionPaths":null,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"customDomainVerificationId":"55F2E4435A6748F0C3A4666505B3672446A9A9AEFDDC20F98EFEE4B5DCC7807E","kind":"app","inboundIpAddress":"20.49.104.14","possibleInboundIpAddresses":"20.49.104.14","ftpUsername":"mysitexxyzz__staging\\$mysitexxyzz__staging","ftpsHostName":"ftps://waws-prod-blu-213.ftp.azurewebsites.windows.net/site/wwwroot","outboundIpAddresses":"52.146.80.201,52.146.80.224,52.146.80.233,52.146.80.240,52.146.80.254,52.146.81.59,52.146.82.252,52.146.83.22,52.146.83.64","possibleOutboundIpAddresses":"52.146.80.201,52.146.80.224,52.146.80.233,52.146.80.240,52.146.80.254,52.146.81.59,52.146.82.252,52.146.83.22,52.146.83.64,52.146.81.74,52.146.81.101,52.146.81.141,52.146.81.155,52.146.81.240,52.146.81.254,52.146.82.7,52.146.82.8,52.146.82.17,52.146.82.61,52.146.82.81,52.146.82.87,52.146.82.136,52.146.82.188,52.146.82.209,52.146.82.221,52.146.82.243,52.146.82.244","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-blu-213","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"rgname","defaultHostName":"mysitexxyzz-staging.azurewebsites.net","slotSwapStatus":null,"httpsOnly":false,"redundancyMode":"None","inProgressOperationId":null,"geoDistributions":null,"privateEndpointConnections":[],"buildVersion":null,"targetBuildVersion":null,"migrationState":null}}' + US","properties":{"name":"mysitexxyzz(staging)","state":"Running","hostNames":["mysitexxyzz-staging.azurewebsites.net"],"webSpace":"rgname-EastUSwebspace","selfLink":"https://waws-prod-blu-143.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/rgname-EastUSwebspace/sites/mysitexxyzz","repositorySiteName":"mysitexxyzz","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["mysitexxyzz-staging.azurewebsites.net","mysitexxyzz-staging.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[{"name":"LinuxFxVersion","value":""},{"name":"WindowsFxVersion","value":null}],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"mysitexxyzz-staging.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"mysitexxyzz-staging.scm.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Repository"}],"computeMode":null,"serverFarm":null,"serverFarmId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan","reserved":false,"isXenon":false,"hyperV":false,"lastModifiedTimeUtc":"2021-02-25T06:21:18.0933333","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":{"numberOfWorkers":null,"defaultDocuments":null,"netFrameworkVersion":null,"phpVersion":null,"pythonVersion":null,"nodeVersion":null,"powerShellVersion":null,"linuxFxVersion":null,"windowsFxVersion":null,"requestTracingEnabled":null,"remoteDebuggingEnabled":null,"remoteDebuggingVersion":null,"httpLoggingEnabled":null,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":null,"detailedErrorLoggingEnabled":null,"publishingUsername":null,"publishingPassword":null,"appSettings":null,"azureStorageAccounts":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":null,"use32BitWorkerProcess":null,"webSocketsEnabled":null,"alwaysOn":null,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":null,"managedPipelineMode":null,"virtualApplications":null,"winAuthAdminState":null,"winAuthTenantState":null,"customAppPoolIdentityAdminState":null,"customAppPoolIdentityTenantState":null,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":null,"routingRules":null,"experiments":null,"limits":null,"autoHealEnabled":null,"autoHealRules":null,"tracingOptions":null,"vnetName":null,"vnetRouteAllEnabled":null,"vnetPrivatePortsCount":null,"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":null,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":null,"scmIpSecurityRestrictions":null,"scmIpSecurityRestrictionsUseMain":null,"http20Enabled":null,"minTlsVersion":null,"scmMinTlsVersion":null,"ftpsState":null,"preWarmedInstanceCount":null,"functionAppScaleLimit":null,"healthCheckPath":null,"fileChangeAuditEnabled":null,"functionsRuntimeScaleMonitoringEnabled":null,"websiteTimeZone":null,"minimumElasticInstanceCount":0},"deploymentId":"mysitexxyzz__3f44","trafficManagerHostNames":null,"sku":"Standard","scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"clientCertMode":"Required","clientCertExclusionPaths":null,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"customDomainVerificationId":"55F2E4435A6748F0C3A4666505B3672446A9A9AEFDDC20F98EFEE4B5DCC7807E","kind":"app","inboundIpAddress":"40.71.11.133","possibleInboundIpAddresses":"40.71.11.133","ftpUsername":"mysitexxyzz__staging\\$mysitexxyzz__staging","ftpsHostName":"ftps://waws-prod-blu-143.ftp.azurewebsites.windows.net/site/wwwroot","outboundIpAddresses":"40.71.11.133,23.101.132.11,40.114.52.253,137.135.64.181,40.114.50.7","possibleOutboundIpAddresses":"40.71.11.133,23.101.132.11,40.114.52.253,137.135.64.181,40.114.50.7,40.114.15.207,137.135.71.113,40.114.53.155","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-blu-143","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"rgname","defaultHostName":"mysitexxyzz-staging.azurewebsites.net","slotSwapStatus":null,"httpsOnly":false,"redundancyMode":"None","inProgressOperationId":null,"geoDistributions":null,"privateEndpointConnections":[],"buildVersion":null,"targetBuildVersion":null,"migrationState":null,"eligibleLogCategories":"AppServiceAppLogs,AppServiceAuditLogs,AppServiceConsoleLogs,AppServiceHTTPLogs,AppServiceIPSecAuditLogs,AppServicePlatformLogs,ScanLogs","storageAccountRequired":false}}' headers: cache-control: - no-cache content-length: - - '5921' + - '5804' content-type: - application/json date: - - Mon, 23 Nov 2020 06:44:02 GMT + - Thu, 25 Feb 2021 06:22:19 GMT etag: - - '"1D6C163E1C85295"' + - '"1D70B3E6D55C0D5"' expires: - '-1' pragma: @@ -438,24 +439,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/config/web?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/config/web?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/config/web","name":"mysitexxyzz","type":"Microsoft.Web/sites/config","location":"East - US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php","hostingstart.html"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","powerShellVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":"VS2019","httpLoggingEnabled":false,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$mysitexxyzz__staging","publishingPassword":null,"appSettings":null,"azureStorageAccounts":{},"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"ExternalGit","use32BitWorkerProcess":true,"webSocketsEnabled":true,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","vnetRouteAllEnabled":false,"vnetPrivatePortsCount":0,"siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretSettingName":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"aadClaimsAuthorization":null,"googleClientId":null,"googleClientSecret":null,"googleClientSecretSettingName":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookAppSecretSettingName":null,"facebookOAuthScopes":null,"gitHubClientId":null,"gitHubClientSecret":null,"gitHubClientSecretSettingName":null,"gitHubOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"twitterConsumerSecretSettingName":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountClientSecretSettingName":null,"microsoftAccountOAuthScopes":null},"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php","hostingstart.html"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","powerShellVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":"VS2019","httpLoggingEnabled":false,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$mysitexxyzz__staging","publishingPassword":null,"appSettings":null,"azureStorageAccounts":{},"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"ExternalGit","use32BitWorkerProcess":true,"webSocketsEnabled":true,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","vnetRouteAllEnabled":false,"vnetPrivatePortsCount":0,"siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"configVersion":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretSettingName":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"aadClaimsAuthorization":null,"googleClientId":null,"googleClientSecret":null,"googleClientSecretSettingName":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookAppSecretSettingName":null,"facebookOAuthScopes":null,"gitHubClientId":null,"gitHubClientSecret":null,"gitHubClientSecretSettingName":null,"gitHubOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"twitterConsumerSecretSettingName":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountClientSecretSettingName":null,"microsoftAccountOAuthScopes":null},"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow all","description":"Allow all access"}],"scmIpSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":false,"http20Enabled":true,"minTlsVersion":"1.2","scmMinTlsVersion":"1.0","ftpsState":"AllAllowed","preWarmedInstanceCount":0,"functionAppScaleLimit":0,"healthCheckPath":null,"fileChangeAuditEnabled":false,"functionsRuntimeScaleMonitoringEnabled":false,"websiteTimeZone":null,"minimumElasticInstanceCount":0}}' headers: cache-control: - no-cache content-length: - - '3664' + - '3685' content-type: - application/json date: - - Mon, 23 Nov 2020 06:44:03 GMT + - Thu, 25 Feb 2021 06:22:20 GMT expires: - '-1' pragma: @@ -487,9 +488,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/sourcecontrols/web?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/sourcecontrols/web?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/sourcecontrols/web","name":"mysitexxyzz","type":"Microsoft.Web/sites/sourcecontrols","location":"East @@ -502,9 +503,9 @@ interactions: content-type: - application/json date: - - Mon, 23 Nov 2020 06:44:04 GMT + - Thu, 25 Feb 2021 06:22:20 GMT etag: - - '"1D6C163E1C85295"' + - '"1D70B3E6D55C0D5"' expires: - '-1' pragma: @@ -540,26 +541,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging","name":"mysitexxyzz/staging","type":"Microsoft.Web/sites/slots","kind":"app","location":"East - US","properties":{"name":"mysitexxyzz(staging)","state":"Running","hostNames":["mysitexxyzz-staging.azurewebsites.net"],"webSpace":"rgname-EastUSwebspace","selfLink":"https://waws-prod-blu-213.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/rgname-EastUSwebspace/sites/mysitexxyzz","repositorySiteName":"mysitexxyzz","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["mysitexxyzz-staging.azurewebsites.net","mysitexxyzz-staging.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[{"name":"LinuxFxVersion","value":""},{"name":"WindowsFxVersion","value":null}],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"mysitexxyzz-staging.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"mysitexxyzz-staging.scm.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Repository"}],"computeMode":null,"serverFarm":null,"serverFarmId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan","reserved":false,"isXenon":false,"hyperV":false,"lastModifiedTimeUtc":"2020-11-23T06:42:58.7933333","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":{"numberOfWorkers":null,"defaultDocuments":null,"netFrameworkVersion":null,"phpVersion":null,"pythonVersion":null,"nodeVersion":null,"powerShellVersion":null,"linuxFxVersion":null,"windowsFxVersion":null,"requestTracingEnabled":null,"remoteDebuggingEnabled":null,"remoteDebuggingVersion":null,"httpLoggingEnabled":null,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":null,"detailedErrorLoggingEnabled":null,"publishingUsername":null,"publishingPassword":null,"appSettings":null,"azureStorageAccounts":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":null,"use32BitWorkerProcess":null,"webSocketsEnabled":null,"alwaysOn":null,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":null,"managedPipelineMode":null,"virtualApplications":null,"winAuthAdminState":null,"winAuthTenantState":null,"customAppPoolIdentityAdminState":null,"customAppPoolIdentityTenantState":null,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":null,"routingRules":null,"experiments":null,"limits":null,"autoHealEnabled":null,"autoHealRules":null,"tracingOptions":null,"vnetName":null,"vnetRouteAllEnabled":null,"vnetPrivatePortsCount":null,"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":null,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + US","properties":{"name":"mysitexxyzz(staging)","state":"Running","hostNames":["mysitexxyzz-staging.azurewebsites.net"],"webSpace":"rgname-EastUSwebspace","selfLink":"https://waws-prod-blu-143.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/rgname-EastUSwebspace/sites/mysitexxyzz","repositorySiteName":"mysitexxyzz","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["mysitexxyzz-staging.azurewebsites.net","mysitexxyzz-staging.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[{"name":"LinuxFxVersion","value":""},{"name":"WindowsFxVersion","value":null}],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"mysitexxyzz-staging.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"mysitexxyzz-staging.scm.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Repository"}],"computeMode":null,"serverFarm":null,"serverFarmId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/serverfarms/myappserviceplan","reserved":false,"isXenon":false,"hyperV":false,"lastModifiedTimeUtc":"2021-02-25T06:22:22.55","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":{"numberOfWorkers":null,"defaultDocuments":null,"netFrameworkVersion":null,"phpVersion":null,"pythonVersion":null,"nodeVersion":null,"powerShellVersion":null,"linuxFxVersion":null,"windowsFxVersion":null,"requestTracingEnabled":null,"remoteDebuggingEnabled":null,"remoteDebuggingVersion":null,"httpLoggingEnabled":null,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":null,"detailedErrorLoggingEnabled":null,"publishingUsername":null,"publishingPassword":null,"appSettings":null,"azureStorageAccounts":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":null,"use32BitWorkerProcess":null,"webSocketsEnabled":null,"alwaysOn":null,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":null,"managedPipelineMode":null,"virtualApplications":null,"winAuthAdminState":null,"winAuthTenantState":null,"customAppPoolIdentityAdminState":null,"customAppPoolIdentityTenantState":null,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":null,"routingRules":null,"experiments":null,"limits":null,"autoHealEnabled":null,"autoHealRules":null,"tracingOptions":null,"vnetName":null,"vnetRouteAllEnabled":null,"vnetPrivatePortsCount":null,"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":null,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow all","description":"Allow all access"}],"scmIpSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow - all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":null,"http20Enabled":null,"minTlsVersion":null,"scmMinTlsVersion":null,"ftpsState":null,"preWarmedInstanceCount":null,"functionAppScaleLimit":null,"healthCheckPath":null,"fileChangeAuditEnabled":null,"functionsRuntimeScaleMonitoringEnabled":null,"websiteTimeZone":null,"minimumElasticInstanceCount":0},"deploymentId":"mysitexxyzz__13b4","trafficManagerHostNames":null,"sku":"Standard","scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"clientCertMode":"Required","clientCertExclusionPaths":null,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"customDomainVerificationId":"55F2E4435A6748F0C3A4666505B3672446A9A9AEFDDC20F98EFEE4B5DCC7807E","kind":"app","inboundIpAddress":"20.49.104.14","possibleInboundIpAddresses":"20.49.104.14","ftpUsername":"mysitexxyzz__staging\\$mysitexxyzz__staging","ftpsHostName":"ftps://waws-prod-blu-213.ftp.azurewebsites.windows.net/site/wwwroot","outboundIpAddresses":"52.146.80.201,52.146.80.224,52.146.80.233,52.146.80.240,52.146.80.254,52.146.81.59,52.146.82.252,52.146.83.22,52.146.83.64","possibleOutboundIpAddresses":"52.146.80.201,52.146.80.224,52.146.80.233,52.146.80.240,52.146.80.254,52.146.81.59,52.146.82.252,52.146.83.22,52.146.83.64,52.146.81.74,52.146.81.101,52.146.81.141,52.146.81.155,52.146.81.240,52.146.81.254,52.146.82.7,52.146.82.8,52.146.82.17,52.146.82.61,52.146.82.81,52.146.82.87,52.146.82.136,52.146.82.188,52.146.82.209,52.146.82.221,52.146.82.243,52.146.82.244","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-blu-213","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"rgname","defaultHostName":"mysitexxyzz-staging.azurewebsites.net","slotSwapStatus":null,"httpsOnly":false,"redundancyMode":"None","inProgressOperationId":null,"geoDistributions":null,"privateEndpointConnections":null,"buildVersion":null,"targetBuildVersion":null,"migrationState":null}}' + all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":null,"http20Enabled":null,"minTlsVersion":null,"scmMinTlsVersion":null,"ftpsState":null,"preWarmedInstanceCount":null,"functionAppScaleLimit":null,"healthCheckPath":null,"fileChangeAuditEnabled":null,"functionsRuntimeScaleMonitoringEnabled":null,"websiteTimeZone":null,"minimumElasticInstanceCount":0},"deploymentId":"mysitexxyzz__3f44","trafficManagerHostNames":null,"sku":"Standard","scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"clientCertMode":"Required","clientCertExclusionPaths":null,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"customDomainVerificationId":"55F2E4435A6748F0C3A4666505B3672446A9A9AEFDDC20F98EFEE4B5DCC7807E","kind":"app","inboundIpAddress":"40.71.11.133","possibleInboundIpAddresses":"40.71.11.133","ftpUsername":"mysitexxyzz__staging\\$mysitexxyzz__staging","ftpsHostName":"ftps://waws-prod-blu-143.ftp.azurewebsites.windows.net/site/wwwroot","outboundIpAddresses":"40.71.11.133,23.101.132.11,40.114.52.253,137.135.64.181,40.114.50.7","possibleOutboundIpAddresses":"40.71.11.133,23.101.132.11,40.114.52.253,137.135.64.181,40.114.50.7,40.114.15.207,137.135.71.113,40.114.53.155","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-blu-143","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"rgname","defaultHostName":"mysitexxyzz-staging.azurewebsites.net","slotSwapStatus":null,"httpsOnly":false,"redundancyMode":"None","inProgressOperationId":null,"geoDistributions":null,"privateEndpointConnections":null,"buildVersion":null,"targetBuildVersion":null,"migrationState":null,"eligibleLogCategories":"AppServiceAppLogs,AppServiceAuditLogs,AppServiceConsoleLogs,AppServiceHTTPLogs,AppServiceIPSecAuditLogs,AppServicePlatformLogs,ScanLogs","storageAccountRequired":false}}' headers: cache-control: - no-cache content-length: - - '6121' + - '5999' content-type: - application/json date: - - Mon, 23 Nov 2020 06:44:06 GMT + - Thu, 25 Feb 2021 06:22:25 GMT etag: - - '"1D6C163E1C85295"' + - '"1D70B3E6D55C0D5"' expires: - '-1' pragma: @@ -598,26 +599,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/config/web?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/config/web?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging","name":"mysitexxyzz/staging","type":"Microsoft.Web/sites/slots","location":"East - US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php","hostingstart.html"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","powerShellVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":"VS2019","httpLoggingEnabled":false,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$mysitexxyzz__staging","publishingPassword":null,"appSettings":null,"azureStorageAccounts":{},"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"ExternalGit","use32BitWorkerProcess":true,"webSocketsEnabled":true,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","vnetRouteAllEnabled":false,"vnetPrivatePortsCount":0,"siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretSettingName":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"aadClaimsAuthorization":null,"googleClientId":null,"googleClientSecret":null,"googleClientSecretSettingName":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookAppSecretSettingName":null,"facebookOAuthScopes":null,"gitHubClientId":null,"gitHubClientSecret":null,"gitHubClientSecretSettingName":null,"gitHubOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"twitterConsumerSecretSettingName":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountClientSecretSettingName":null,"microsoftAccountOAuthScopes":null},"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php","hostingstart.html"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","powerShellVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":"VS2019","httpLoggingEnabled":false,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$mysitexxyzz__staging","publishingPassword":null,"appSettings":null,"azureStorageAccounts":{},"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"ExternalGit","use32BitWorkerProcess":true,"webSocketsEnabled":true,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","vnetRouteAllEnabled":false,"vnetPrivatePortsCount":0,"siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"configVersion":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretSettingName":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"aadClaimsAuthorization":null,"googleClientId":null,"googleClientSecret":null,"googleClientSecretSettingName":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookAppSecretSettingName":null,"facebookOAuthScopes":null,"gitHubClientId":null,"gitHubClientSecret":null,"gitHubClientSecretSettingName":null,"gitHubOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"twitterConsumerSecretSettingName":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountClientSecretSettingName":null,"microsoftAccountOAuthScopes":null},"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow all","description":"Allow all access"}],"scmIpSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":false,"http20Enabled":true,"minTlsVersion":"1.2","scmMinTlsVersion":"1.0","ftpsState":"AllAllowed","preWarmedInstanceCount":0,"functionAppScaleLimit":0,"healthCheckPath":null,"fileChangeAuditEnabled":false,"functionsRuntimeScaleMonitoringEnabled":false,"websiteTimeZone":null,"minimumElasticInstanceCount":0}}' headers: cache-control: - no-cache content-length: - - '3660' + - '3681' content-type: - application/json date: - - Mon, 23 Nov 2020 06:44:09 GMT + - Thu, 25 Feb 2021 06:22:27 GMT etag: - - '"1D6C163E1C85295"' + - '"1D70B3E93C10F60"' expires: - '-1' pragma: @@ -635,7 +636,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1191' + - '1195' x-powered-by: - ASP.NET status: @@ -656,9 +657,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/sourcecontrols/web?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/sourcecontrols/web?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/sourcecontrols/web","name":"mysitexxyzz","type":"Microsoft.Web/sites/sourcecontrols","location":"East @@ -671,9 +672,9 @@ interactions: content-type: - application/json date: - - Mon, 23 Nov 2020 06:44:10 GMT + - Thu, 25 Feb 2021 06:22:28 GMT etag: - - '"1D6C1640BE29F60"' + - '"1D70B3E9705C015"' expires: - '-1' pragma: @@ -691,7 +692,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1190' + - '1194' x-powered-by: - ASP.NET status: @@ -709,9 +710,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/start?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/start?api-version=2020-09-01 response: body: string: '' @@ -721,7 +722,7 @@ interactions: content-length: - '0' date: - - Mon, 23 Nov 2020 06:44:10 GMT + - Thu, 25 Feb 2021 06:22:29 GMT expires: - '-1' pragma: @@ -735,7 +736,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1199' x-powered-by: - ASP.NET status: @@ -753,9 +754,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/restart?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/restart?api-version=2020-09-01 response: body: string: '' @@ -765,7 +766,7 @@ interactions: content-length: - '0' date: - - Mon, 23 Nov 2020 06:44:11 GMT + - Thu, 25 Feb 2021 06:22:30 GMT expires: - '-1' pragma: @@ -779,7 +780,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1195' + - '1198' x-powered-by: - ASP.NET status: @@ -797,9 +798,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/stop?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/stop?api-version=2020-09-01 response: body: string: '' @@ -809,7 +810,7 @@ interactions: content-length: - '0' date: - - Mon, 23 Nov 2020 06:44:12 GMT + - Thu, 25 Feb 2021 06:22:30 GMT expires: - '-1' pragma: @@ -823,7 +824,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1194' + - '1197' x-powered-by: - ASP.NET status: @@ -841,9 +842,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/sourcecontrols/web?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging/sourcecontrols/web?api-version=2020-09-01 response: body: string: '' @@ -853,9 +854,9 @@ interactions: content-length: - '0' date: - - Mon, 23 Nov 2020 06:44:22 GMT + - Thu, 25 Feb 2021 06:22:41 GMT etag: - - '"1D6C1640E5029F5"' + - '"1D70B3E998DBD80"' expires: - '-1' pragma: @@ -869,7 +870,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14997' + - '14999' x-powered-by: - ASP.NET status: @@ -887,9 +888,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz/slots/staging?api-version=2020-09-01 response: body: string: '' @@ -899,9 +900,9 @@ interactions: content-length: - '0' date: - - Mon, 23 Nov 2020 06:44:31 GMT + - Thu, 25 Feb 2021 06:22:52 GMT etag: - - '"1D6C1640E5029F5"' + - '"1D70B3E998DBD80"' expires: - '-1' pragma: @@ -915,7 +916,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14996' + - '14998' x-powered-by: - ASP.NET status: @@ -933,9 +934,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-web/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-web/2.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz?api-version=2019-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Web/sites/mysitexxyzz?api-version=2020-09-01 response: body: string: '' @@ -945,9 +946,9 @@ interactions: content-length: - '0' date: - - Mon, 23 Nov 2020 06:44:37 GMT + - Thu, 25 Feb 2021 06:23:02 GMT etag: - - '"1D6C163C412532B"' + - '"1D70B3E5140D440"' expires: - '-1' pragma: @@ -961,7 +962,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14995' + - '14997' x-powered-by: - ASP.NET status: